Agent memory · Retrieval · Context engineering

Swapnanil Saha

An agent that runs for hours forgets what it worked out in the first ten minutes. These essays are about why that happens and what a memory system would have to do instead. Vectr is where the answers get tested; the underlying research is on arXiv.

Essays
on retrieval and agent memory

Long-form engineering essays on retrieval, agent memory, and context engineering — built on instrumented runs and honest ledgers, with every number traceable to an artifact.

Vectr
semantic search and working memory

Open source · MCP · Zero config
Vectr gives AI coding agents the two things they lack: retrieval that understands code, and memory that survives.
An AST-aware codebase indexer with hybrid semantic + BM25 search, a symbol graph, and a persistent working-memory tier delivered through hooks — findings survive context compaction and session restarts instead of dying with the conversation. Any MCP-compatible AI code editor connects automatically. v1.1 added team mode — many agents, one shared memory; v1.3 added per-memory triggers, so a note resurfaces exactly when its path, symbol, or lifecycle condition matches; v1.5 added automatic episode capture, where the harness records what was tried and what failed, and distils the recurring arcs into notes; v1.8 added a machine-checked user-stated trust class, where a note quoting the user's own words verbatim proves it; v1.10 made expiry a state transition instead of a delete, so an aged-out note is marked expired and stays auditable rather than vanishing, added pinned notes that recall returns whatever the query says, and rendered working memory to a read-only MEMORY.md a person can actually open and read; v1.11 lets a note be retired after the fact without the "proven wrong" framing revocation carries, records whether the agent actually read the file a note is anchored to rather than assuming it, and opens working memory in your own editor while still writing every change back through the append-only lifecycle.

Six tools
built to test the ideas

Six tools, each built to test an idea against something real rather than argue it in the abstract. Vectr came out of the agent-memory work and is the one still under active development. The others answer narrower questions and are finished. All open source.

Developer Tools · Code AI · MCP

vectr

Zero-config codebase indexer for AI assistants. AST-aware chunking, hybrid semantic + BM25 search, and cross-session memory via MCP. An AI code editor gets only the relevant chunks over MCP, not entire files. Benchmarked on Apache Camel: −58% Phase 2 cost, −72% tool calls.
Compliance · DPDP Act · India

dpdp-copilot

Self-hosted operator tool for India's DPDP Act. Public intake form accepts data principal requests in 5 Indian languages. Automatically classifies and drafts a compliant multilingual reply. Operator inbox shows live SLA status. Every action logged as immutable evidence — exportable as PDF or CSV for regulatory audit.
AI Architecture · RAG

rag-readiness

Opinionated architecture recommendation per component. Diagnoses existing broken stacks with root causes by severity. Rule-based cost estimation, iterative refinement with session persistence, and RAGAS eval dataset generation.
LLM · Evaluation · Regression · CI/CD

llm-eval-suite

Evidence-backed multi-dimensional scoring across 10 task types including RAGAS-compatible RAG eval. Regression testing saves baselines and blocks CI when scores drop. Claim-level hallucination detection, prompt sensitivity analysis across variants, and multi-judge panel consensus with disagreement flagging.
Enterprise AI · Strategy · LangGraph

ai-use-case-scoper

Hybrid 8-question flow with optional Graph RAG doc enrichment — pre-fills tech context, always asks qualitative questions. LangGraph check-in pipeline evolves plans. Company memory persists across sessions.
Productivity · Meeting AI

meeting-to-action

Normalizes Zoom/Teams/Meet transcripts, detects meeting type, extracts structured decisions and action items. Cross-meeting commitment tracker flags missed items by severity. Weekly digest aggregates open work by owner across all sessions.

Current work
and what changed recently

Active · Vectr
Shipping the memory half of Vectr
v1.11 separates being out of date from being wrong: a note can now be retired after the fact in favour of a newer one, without the "proven wrong" framing revocation carries, and reinstating one actually reverses it instead of leaving it half-retired. An anchor now records whether the agent ever actually read the file it points at, so a note anchored to a file nobody opened no longer looks identical to one that was genuinely bound. And working memory opens in your own editor, with every change written back through the append-only lifecycle rather than around it. v1.10 made memory expiry a state transition rather than a delete: an aged-out note is marked expired and keeps its place in the audit trail, directives never age out at any age, and a pinned note comes back from recall whatever the query says. It also rendered a workspace's notes to a read-only MEMORY.md, so what the agent remembers is finally something a person can open and read. v1.8 shipped a machine-checked user-stated provenance class (a note binding a verbatim excerpt of the user's words earns a stronger recall frame; the class is earned by a deterministic check, never claimed), after 1.6 and 1.7 made proactive delivery the default and made it worth reading. v1.5 shipped automatic episode capture with arc distillation, and a note lifecycle where a wrong note is revoked rather than deleted, so the mistake is not silently re-derived, on top of 1.3's per-memory trigger engine and 1.1's team mode. The research underneath it is now published: Delivery, Not Storage (arXiv:2607.20972), a controlled study of agent memory under repeated context compaction across 108 and 138 forced boundaries, graded token by token. A second report from the same programme is published beside it: Deterministic, Reproducible, and Wrong, on how our own deterministic scorer manufactured an agent-memory headline that the transcripts refuted, and the contradiction guard that would have caught it. Running alongside it: an upstream feature request to Claude Code (#78795) proposing triggered injection for auto-memory files, so the findings become platform behavior rather than a workaround.
Writing · Next up
Next deep dives in the pipeline
The arXiv paper rewritten as a readable deep dive, and the cue-anchored trigger vocabulary taken apart condition by condition. Each one built on measured runs, like everything else here.
Retrieval research
Understanding-grade code retrieval
Moving Vectr's search from embeddings-plus-heuristics to structural signals: per-symbol purpose vectors shipped in v1.0, a file-level reference-importance prior ships in the ranking layer, and the class-level owning-class prior is next, each one evidence-gated on public corpora.

Background
nine years in ad infrastructure

Nine years of this work happened somewhere else first: real-time digital advertising, infrastructure deciding in milliseconds which ad a user sees. A custom Redis module that cut filtering latency 5×, first-price and second-price auction engines, real-time budget pacing on Cassandra across billions of daily requests.

Ad-tech has an unusually short feedback loop. Every latency improvement carries a win-rate implication, every auction change shows up in revenue by the same afternoon. That is where the habit of refusing a claim without an instrumented run behind it comes from, and it is the standard everything published here is held to.

Building
Vectr · The deep-dive blog
Research
Agent memory · Context engineering
Background
Real-time systems · Ad-tech
Location
Mumbai, India

Get in touch
corrections included

Open to conversations about agentic AI, context engineering, retrieval, and the harness problems that surface when a model has to hold state across long-running work. Early results, half-formed hypotheses, and work that has not been written up yet are the most interesting kind of mail to get, and the topic does not have to be one covered here.

Corrections carry the same weight as agreement. A number on this site that does not reproduce is worth an email.

Most of the interesting problems in this field are still unsolved and largely undocumented. Writing them down carefully, with the run attached, is how they stop being folklore.