Skip to main content
Cost: 2 operations per call

POST /brain/retrieve

Runs the full query-adaptive retrieval pipeline:
  1. Session context — loads rolling topic vector from Redis (if session_id provided)
  2. Episodic search — similarity search in Qdrant (text chunks)
  3. Semantic search — vector lookup in Neo4j entity graph
  4. Graph traversal — multi-hop BFS from seed entities (if max_hops > 1)
  5. Working memory injection — appends hot-cached facts from the current session
  6. Hybrid scoring — across all candidates
  7. Conflict resolution — deduplicates facts by slot, preferring user-sourced and newer
  8. 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:

Score interpretation