Persistent Agentic Memory
Grounded LLM agents in domain data with pgvector + a Graphiti knowledge graph, cutting hallucinations on high-stakes queries.
Context
The agents were stateless — every turn re-derived context from scratch, drifting on domain specifics and hallucinating on the exact high-stakes questions where accuracy mattered most.
The goal was an environment that becomes progressively more useful over time: agents that remember, ground answers in real domain data, and stay auditable for regulated clients.
Approach
I designed a two-tier memory system: dense semantic recall over pgvector for retrieval, and a Graphiti knowledge graph for relationship-aware, temporally-scoped facts.
LangGraph orchestrates retrieval, grounding, and tool calls as an explicit state machine with structured output schemas, so every step is inspectable and safe to retry.
user turn
│
▼
┌─────────────┐ semantic ┌────────────┐
│ LangGraph │──────────────▶│ pgvector │
│ orchestrator│◀──────────────│ recall │
└─────┬───────┘ grounding └────────────┘
│ relations ┌────────────┐
├───────────────────────▶│ Graphiti │
│ │ graph │
▼ └────────────┘
grounded, cited answerOutcome
Agents now cite grounded sources, recall prior interactions, and degrade gracefully when context is missing — with audit trails that satisfy regulated-enterprise review.