memory_search
Retrieve and rank memories using hybrid semantic and full-text search. Filter by category, source, or knowledge graph properties for precise recall.
Instructions
Search memories by semantic + FTS5 hybrid search.
The primary recall tool. Returns ranked memories matching the query. When the CQRS write journal is enabled, pending (not-yet-materialized) entries are also checked and surfaced as a supplement when the main search returns no results.
Args: query: Natural-language search query (required). category: Filter to a category (e.g. "lessons", "decisions"). limit: Max results (default 10). include_global: Include global memories (default True for default agent, scoped for non-default agents). mode: "hybrid" (default), "semantic", "fts", "facts", "graph". belief_status: Filter KG facts by belief status (active, retracted, deprecated, unconfirmed). epistemic_source: Filter KG facts by epistemic source (agent, auto_save, hook, import, cron). fact_type: Filter KG facts by type (observation, agent_inference, external_stated, hypothesis, derived). memory_source: Filter memories by source type ("agent", "auto_save", "import"). Only returns memories whose source file category matches the given type. shared_with_me: If True, also include memories explicitly shared with the current agent (via the shared pool's target_agent_id).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | fts | |
| limit | No | ||
| query | Yes | ||
| category | No | ||
| fact_type | No | ||
| tenant_id | No | default | |
| belief_status | No | ||
| memory_source | No | ||
| include_global | No | ||
| shared_with_me | No | ||
| epistemic_source | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |