recall()for answer-oriented retrievalgetContext()/get_context()for prompt-ready context assembly- raw
control.querywhen you need wire-level control
Mental model
- Default to the routed retrieval path.
- Keep
run_id/session_idstable. - Use
entry_typeswhen you need only facts, lessons, or rules. - Use explicit context budgeting when the downstream model window matters.
Minimal helper-first example
query_payload.json
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| Sparse evidence | Scope mismatch or weak memory writes | Keep one stable run scope and tag memory intentionally |
| Context is too wide | No token budget or type restriction | Use getContext() budgeting and entry_types |
| Retrieval still looks weak | Memory quality degraded | Use diagnose() and memoryHealth() / memory_health() |
Next steps
- Compare retrieval styles at Associative retrieval vs RAG.
- Implement retrieval patterns at Retrieve data.