Agent Memory, Vector Stores, Temporal Knowledge Graphs & Context Consolidation Hub
How to equip an autonomous agent with short-term working state, episodic session history, consolidated semantic memory, and ACID vector retrieval without context rot or $400/mo cluster lock-in.
Persist tool outputs and step checkpoints outside the prompt so retries resume from the failed node.
Never append raw chat logs forever. Extract atomic facts with timestamps and resolve contradictions when facts change.
Start in Postgres (`pgvector` + HNSW + BM25/tsvector) until you prove you need a separate vector cluster.
Memory, Vector & Retrieval JTBDs
Extract durable user preferences, domain facts, and past episode outcomes from raw conversation and tool traces so an agent learns across sessions without bloating the context window or poisoning future runs with stale hallucinations.
When not top pick: Need temporal bi-temporal knowledge-graph edges with explicit validity windows (`valid_from` / `invalid_at`) for changing facts — Zep (Graphiti); need explicit OS-style self-editing core/archival memory blocks managed by the agent via tool calls — Letta; need DIY SQL + vector episodic tables inside existing Postgres — Supabase pgvector.
Keep vectors next to relational data with minimal new systems.
When not top pick: Corpus/QPS exceeds comfortable Postgres vector range — Qdrant/Milvus/Turbopuffer.
High-quality embeddings (+ optional rerank) for retrieval pipelines.
When not top pick: Already standardized on OpenAI embeddings operationally; retrieval-quality bake-off winner is Voyage; need local/open embed models on HF/Fireworks; want URL-to-markdown + embeddings together — Jina.
Keep vectors next to relational data with minimal new systems.
When not top pick: Corpus/QPS exceeds comfortable Postgres vector range — Qdrant/Milvus/Turbopuffer.