Skip to content

mem::smart-search ignores the project filter on observation results (cross-project leak) #868

Closed as not planned

Description

@jwfaye

Problem

I run a single agentmemory instance and want to scope memory per concern using the project field — one logical space per workstream. I can't isolate them: mem::smart-search with project: "A" still returns observations stored under project: "B".

Repro

  1. remember an observation with project: "A", and another with project: "B".
  2. POST /agentmemory/smart-search {"query": "...", "project": "A"}
  3. The results include the project: "B" observation.
curl -s -XPOST localhost:3111/agentmemory/remember -d '{"content":"alpha note","project":"A"}'
curl -s -XPOST localhost:3111/agentmemory/remember -d '{"content":"beta note","project":"B"}'
curl -s -XPOST localhost:3111/agentmemory/smart-search -d '{"query":"note","project":"A"}'
# -> returns both the A and the B observation

Cause

mem::smart-search accepts project but only forwards it to mem::lesson-recall. The primary observation results — filteredHybrid in the hybrid branch and scoped in the expand-ids branch — are filtered by agentId alone; project is never applied to them. Other functions (actions, timeline, crystallize) already filter by project, so smart-search is the gap.

Expected

A project-scoped search returns only that project's observations; omitting project returns all (unchanged).

Environment

  • Node: v24
  • OS: Linux
  • agentmemory: 0.9.27

Happy to send a PR — it mirrors the existing agentId post-filter and the project filtering already done elsewhere.

Activity

  1. jwfaye commented on Jun 9, 2026

    @jwfaye
    Author

    Closing as a duplicate of #787, which reported this first. The fix lives in #869, now linked to #787.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions