Hybrid search across episodic, semantic, and working memory with multi-hop graph traversal.
/brain/retrieveRuns the full query-adaptive retrieval pipeline:
session_id provided)max_hops > 1)| Field | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | ✓ | — | Natural language query. |
k | int | 5 | Number of results to return (1–20). | |
persona | string | null | Filter results to a specific persona (+ always includes "shared"). | |
session_id | string | null | Enables working memory context blending. | |
include_episodic | bool | true | Search Qdrant vector store. | |
include_semantic | bool | true | Search Neo4j entity graph. | |
include_working | bool | true | Inject hot-cached session facts. | |
max_hops | int | null | Graph traversal depth (1–5). Set null to skip traversal. | |
min_score | float | null | Minimum hybrid score threshold (0.0–1.0). | |
use_compression | bool | false | LLM-based contextual compression (requires OpenAI). |
| Field | Type | Description |
|---|---|---|
context | string | Pre-formatted memory context string ready to inject into an LLM system prompt. |
facts | array | Ranked list of memory facts. |
facts[].fact | string | Human-readable fact text. |
facts[].score | float | Hybrid score (0.0–1.0). Higher is more relevant. |
facts[].source_type | string | "episodic", "semantic", or "working". |
facts[].created_at | float | Unix timestamp when this memory was created. |
facts[].confidence | float | Extraction confidence (1.0 for user-sourced). |
episodic_count | int | Facts from Qdrant vector store. |
semantic_count | int | Facts from Neo4j graph. |
reasoning_chain | array|null | Traversal steps when max_hops > 1. |
latency_ms | float | Total retrieval time in milliseconds. |
context in your LLM promptThe context field is a pre-formatted string designed to drop directly into an LLM system prompt:
| Score range | Meaning |
|---|---|
0.7 – 1.0 | High confidence — directly relevant |
0.4 – 0.7 | Medium confidence — probably relevant |
0.2 – 0.4 | Low confidence — tangentially related |
< 0.2 | Filtered out by v_floor (not returned by default) |