← All work

2025

RAG Knowledge Agent with Persistent Memory

A retrieval-augmented Claude agent that answers cross-document questions with inline citations a non-technical operator can audit.

Year
2025
Stack
5 technologies
Deep-dive
Read the essay →
PythonClaude APIChromaDBSentence-TransformersStreamlit

Highlights

  • 01Semantic chunking that respects headings, paragraphs, and table boundaries
  • 02Inline source citations with an out-of-context detector that flags unsupported claims
  • 03Incremental ingestion: content-hash dedupe, delta-only embedding, atomic manifest writes

Built a Retrieval-Augmented Generation knowledge agent that ingests organisational documents (reports, exported email threads, meeting notes), builds a semantic vector store, and answers complex cross-document queries with inline source citations and confidence indicators.

Replaced naive fixed-length chunking with a structure-aware heuristic that never splits inside a sentence and never separates a table from its header row, then exposed the retrieved chunks directly in the UI so operators can distinguish retrieval bugs from generation bugs in seconds.

Session memory persists across conversations via a per-session vector namespace, retrieved only when the new query references prior turns, which stopped the agent from leaking stale context into unrelated questions. An incremental ingestion pipeline keyed on content hashes processes only changed files and writes the manifest atomically for crash safety.

Related essay

Retrieval Is a Product Problem: Building a RAG Agent That a Small Ops Team Actually Uses

How I built a Retrieval-Augmented Generation knowledge agent on Claude and ChromaDB that ingests messy organisational documents, answers cross-document questions with inline citations, and keeps session memory without poisoning new conversations.

13 min · Read the deep-dive

Next project

AI-Powered PNR Intelligence Layer