Memory and RAG Pattern
Workflow-native memory primitives are available in
design_research_agents.workflow:
MemoryReadStepMemoryWriteStep
And a local pluggable persistent memory store:
SQLiteMemoryStore(default path:artifacts/memory/memory.sqlite3)
Memory retrieval
SQLiteMemoryStore.search(...) always computes lexical relevance.
When embeddings are available, the final ranking score uses:
0.7 * vector_score + 0.3 * lexical_score
If embeddings are unavailable, retrieval falls back to lexical-only ranking.
RAG orchestration
RAGPattern composes memory and reasoning as:
MemoryReadStepDelegateStepreasoning delegate (with retrieved context injection)MemoryWriteStep(optional write-back)
Background reference
The original RAG formulation combines a retriever and generator with non-parametric memory; this implementation uses workflow-level retrieval and context injection.
Examples
examples/patterns/rag.pyexamples/agents/multi_step_json_with_memory.py