豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

memory_search defaults to namespace 'default', returning empty results when entries use named namespaces #1489

@stuinfla

Description

@stuinfla

Bug Description

memory_search returns 0 results for every query when no namespace parameter is provided, even though the brain has 100+ entries with valid 384-dimension HNSW embeddings.

Root Cause

In dist/src/mcp-tools/memory-tools.js, line 288 (and 3 other locations):

const namespace = input.namespace || 'default';

When memory_search is called without an explicit namespace parameter, it defaults to 'default'. This is passed to bridgeSearchEntries, which applies a SQL filter:

WHERE status = 'active' AND namespace = 'default'

However, entries stored via memory_store are typically stored under specific namespaces like health, bwe, business, calendar, etc. — NOT under 'default'. The SQL pre-filter excludes ALL entries before the HNSW vector search even runs.

Reproduction

# Store an entry with a specific namespace
memory_store({ key: "test-1", value: "Hello world", namespace: "myns" })

# Search without specifying namespace — returns 0 results
memory_search({ query: "Hello" })
# Returns: { results: [], total: 0 }

# Search with namespace: "all" — works correctly
memory_search({ query: "Hello", namespace: "all" })
# Returns: { results: [{ key: "test-1", similarity: 0.85, ... }], total: 1 }

Expected Behavior

memory_search without a namespace should search across ALL namespaces (equivalent to namespace: "all"), not filter to the 'default' namespace.

Suggested Fix

Change line 288 (and lines 159, 225, 350) from:

const namespace = input.namespace || 'default';

to:

const namespace = input.namespace || 'all';

Impact

This bug makes the MCP memory search appear completely broken. Users store entries, confirm they exist via memory_stats and memory_list, but every search query returns empty. The failure is silent — no error message, just 0 results with a valid response structure.

Environment

  • ruflo v3.5.48 / @claude-flow/cli v3.5.48
  • Node.js v25.8.2 (Homebrew)
  • macOS 15 (Darwin 25.4.0)

Workaround

Always pass namespace: "all" explicitly when calling memory_search.

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