Cost: 2 operations per call
POST /brain/retrieve
Runs the full query-adaptive retrieval pipeline:
- Session context — loads rolling topic vector from Redis (if
session_idprovided) - Episodic search — similarity search in Qdrant (text chunks)
- Semantic search — vector lookup in Neo4j entity graph
- Graph traversal — multi-hop BFS from seed entities (if
max_hops> 1) - Working memory injection — appends hot-cached facts from the current session
- Hybrid scoring — across all candidates
- Conflict resolution — deduplicates facts by slot, preferring user-sourced and newer
- LongContextReorder — reorders results for optimal LLM prompt position
Request body
Response
Code examples
Using context in your LLM prompt
The context field is a pre-formatted string designed to drop directly into an LLM system prompt: