Skip to content
all work
Agentic AIRAG· 2025 · Big Kitty Labs

Persistent Agentic Memory

Grounded LLM agents in domain data with pgvector + a Graphiti knowledge graph, cutting hallucinations on high-stakes queries.

roleLead engineer
impact↓ Hallucinations — on high-stakes queries
LangGraphpgvectorGraphitiPostgreSQLPythonFastAPI

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 answer

Outcome

Agents now cite grounded sources, recall prior interactions, and degrade gracefully when context is missing — with audit trails that satisfy regulated-enterprise review.

2-tier
vector + graph memory
Audit-ready
grounded citations
Stateful
cross-session recall