<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Swapnanil Saha</title>
    <link>https://swapnanilsaha.com/blog/</link>
    <description>Long-form engineering deep dives and research on retrieval, agent memory, and context engineering. Every number traces back to an instrumented run.</description>
    <language>en-us</language>
    <lastBuildDate>Wed, 30 Sep 2026 09:00:00 +0530</lastBuildDate>
    <atom:link href="https://swapnanilsaha.com/feed.xml" rel="self" type="application/rss+xml"/>
    <managingEditor>swapnanilsaha26@gmail.com (Swapnanil Saha)</managingEditor>

    <item>
      <title>When a Memory Should Become a Check: Advice, Enforcement, and Agent Memory</title>
      <link>https://swapnanilsaha.com/blog/when-a-memory-should-become-a-check/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/when-a-memory-should-become-a-check/</guid>
      <pubDate>Wed, 30 Sep 2026 09:00:00 +0530</pubDate>
      <description>Advice needs the agent to believe it; a check does not. But an enforced rule can never be tested again. Which memories should be checks, and what a check must keep.</description>
    </item>
    <item>
      <title>A Lesson Is a Failure Plus the Change That Fixed It: Surprise as the Write Signal for Agent Memory</title>
      <link>https://swapnanilsaha.com/blog/a-lesson-is-a-failure-plus-a-change/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/a-lesson-is-a-failure-plus-a-change/</guid>
      <pubDate>Sun, 27 Sep 2026 09:00:00 +0530</pubDate>
      <description>Agent memory saves what the model chooses to save. Learning runs on surprise: a failure, a change, then a pass. Without the change it is a retry, not a lesson.</description>
    </item>
    <item>
      <title>Two Identical Chunks Are Not Always Duplicates: Why Text Cannot Decide Search Deduplication</title>
      <link>https://swapnanilsaha.com/blog/identical-chunks-are-not-duplicates/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/identical-chunks-are-not-duplicates/</guid>
      <pubDate>Thu, 24 Sep 2026 09:00:00 +0530</pubDate>
      <description>Copied scripts must collapse into one search result; generated accessors must not. Their text has the same shape, so near-duplicate dedup needs signals outside it.</description>
    </item>
    <item>
      <title>Filtering After Top-k Is a Silent Bug in RAG: Why a Short Result Looks Like a Complete One</title>
      <link>https://swapnanilsaha.com/blog/filtering-after-top-k-silent-rag-bug/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/filtering-after-top-k-silent-rag-bug/</guid>
      <pubDate>Mon, 21 Sep 2026 09:00:00 +0530</pubDate>
      <description>Fetch the nearest k, then filter: a filtered vector search comes back short and nothing says so. The math, four real instances, and the fixes that hold.</description>
    </item>
    <item>
      <title>Should a Correction Repeat the Mistake? Retracting a Belief in Agent Memory</title>
      <link>https://swapnanilsaha.com/blog/should-a-correction-repeat-the-mistake/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/should-a-correction-repeat-the-mistake/</guid>
      <pubDate>Fri, 18 Sep 2026 09:00:00 +0530</pubDate>
      <description>Agent memory can delete a wrong belief, replace it, or keep it labelled false. Human research says restate the myth; transformer research says that may prime it.</description>
    </item>
    <item>
      <title>Agents Forget How, Not What: Procedural Memory and the Green Test That Verified Nothing</title>
      <link>https://swapnanilsaha.com/blog/agents-forget-how-not-what/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agents-forget-how-not-what/</guid>
      <pubDate>Tue, 15 Sep 2026 09:00:00 +0530</pubDate>
      <description>Agent memory stores facts about code. In real bugfix runs the missing piece was how to get an honest test result, and when that knowledge is absent nothing fails.</description>
    </item>
    <item>
      <title>Forgetting Is a Capability, Not a Failure: Why Generalization Cannot Outlive an Append-Only Memory</title>
      <link>https://swapnanilsaha.com/blog/forgetting-is-a-capability/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/forgetting-is-a-capability/</guid>
      <pubDate>Fri, 11 Sep 2026 09:00:00 +0530</pubDate>
      <description>Every memory system optimizes retention. Generalization is lossy compression, so a system that keeps every particular cannot abstract. The operation that fixes this is missing.</description>
    </item>
    <item>
      <title>Identity Is Made of Memory, and Memory Is Shaped by Identity</title>
      <link>https://swapnanilsaha.com/blog/identity-is-made-of-memory/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/identity-is-made-of-memory/</guid>
      <pubDate>Wed, 09 Sep 2026 09:00:00 +0530</pubDate>
      <description>An agent has no way to be the same agent twice. Without a "self", nothing decides what is worth remembering. The two problems are one.</description>
    </item>
    <item>
      <title>Consolidation Is the Missing Phase in Agent Memory: Capacity Was Never the Problem</title>
      <link>https://swapnanilsaha.com/blog/consolidation-is-the-missing-phase/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/consolidation-is-the-missing-phase/</guid>
      <pubDate>Mon, 07 Sep 2026 09:00:00 +0530</pubDate>
      <description>Every answer to 'not enough context' is more context. Biological memory never scaled capacity. It built an offline phase that decides what survives.</description>
    </item>
    <item>
      <title>The Writer Cannot Know the Reader's Question: Why Agent Memory Stores Conditions, Not Answers</title>
      <link>https://swapnanilsaha.com/blog/the-writer-cannot-know-the-readers-question/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/the-writer-cannot-know-the-readers-question/</guid>
      <pubDate>Sat, 05 Sep 2026 09:00:00 +0530</pubDate>
      <description>Every note is written before the query that will need it exists. That makes write-time precision undefined, and the fix is the unit of storage, not a better guess.</description>
    </item>
    <item>
      <title>Recall Is a Write Operation: Why Usage-Weighted Memory Ranking Cannot Discover It Was Wrong</title>
      <link>https://swapnanilsaha.com/blog/recall-is-a-write-operation/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/recall-is-a-write-operation/</guid>
      <pubDate>Tue, 01 Sep 2026 09:00:00 +0530</pubDate>
      <description>Retrieving a memory changes what gets retrieved next. That feedback loop makes early accidents permanent and hides the evidence that would correct them.</description>
    </item>
    <item>
      <title>A Guess Becomes a Fact on the Next Read: Why Agent Memory Cannot Be Just Save and Search</title>
      <link>https://swapnanilsaha.com/blog/a-guess-becomes-a-fact/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/a-guess-becomes-a-fact/</guid>
      <pubDate>Mon, 31 Aug 2026 09:00:00 +0530</pubDate>
      <description>A user instruction, a tool result, a file fact, and the model's own guess end up as the same type once they leave the context window. Forgetting costs a re-derivation. Laundering corrupts everything downstream.</description>
    </item>
    <item>
      <title>Relevance Is the Wrong Sort Order for Agent Memory: Why Cosine Ranking Drops the Notes That Carry the Truth</title>
      <link>https://swapnanilsaha.com/blog/relevance-is-the-wrong-sort-order/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/relevance-is-the-wrong-sort-order/</guid>
      <pubDate>Sun, 30 Aug 2026 09:00:00 +0530</pubDate>
      <description>Semantic recall inherited an assumption from document search that is false for notes. Ranking by similarity drops the very notes that carry the truth of a correction.</description>
    </item>
    <item>
      <title>Agents Never Remember What Isn't There: The Half of Memory That Has No Anchor</title>
      <link>https://swapnanilsaha.com/blog/absence-is-the-memory-nobody-writes/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/absence-is-the-memory-nobody-writes/</guid>
      <pubDate>Sat, 29 Aug 2026 09:00:00 +0530</pubDate>
      <description>Every agent memory system stores what was found. The expensive half of any session is what was looked for and not found, and that is the half no memory can carry.</description>
    </item>
    <item>
      <title>A Directive Is Not a Memory: Why Agent Memory Cannot Test Its Own Rules</title>
      <link>https://swapnanilsaha.com/blog/a-directive-is-not-a-memory/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/a-directive-is-not-a-memory/</guid>
      <pubDate>Fri, 28 Aug 2026 09:00:00 +0530</pubDate>
      <description>Obeying a rule destroys the evidence that would test it. Agent memory stores directives next to observations and applies the same checks, which all miss.</description>
    </item>
    <item>
      <title>Reinstatement Is the Missing Primitive in Agent Memory: Why Deletion Cannot Undo a Derivation</title>
      <link>https://swapnanilsaha.com/blog/reinstatement-is-the-missing-primitive/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/reinstatement-is-the-missing-primitive/</guid>
      <pubDate>Wed, 26 Aug 2026 09:00:00 +0530</pubDate>
      <description>Every agent memory system can delete or supersede a belief. Almost none can un-revoke one, and that missing edge manufactures self-reinforcing error.</description>
    </item>
    <item>
      <title>Search Is Memory's Write Path: Two Products, One System</title>
      <link>https://swapnanilsaha.com/blog/search-is-memorys-write-path/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/search-is-memorys-write-path/</guid>
      <pubDate>Tue, 25 Aug 2026 09:00:00 +0530</pubDate>
      <description>Agent search and agent memory ship as separate products. They are two phases of one system: the first search is the write, every repeat is the read.</description>
    </item>
    <item>
      <title>Agents Over-Trust Instructions and Under-Trust Corrections: Shape Beats Source in Agent Memory</title>
      <link>https://swapnanilsaha.com/blog/agents-over-trust-instructions-and-under-trust-corrections/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agents-over-trust-instructions-and-under-trust-corrections/</guid>
      <pubDate>Mon, 24 Aug 2026 09:00:00 +0530</pubDate>
      <description>Agents obey planted instructions in memory files and ignore true corrections in the same files. Trust in ambient context is not a scalar, it is shaped.</description>
    </item>
    <item>
      <title>Verifying AI Subagent Work: Nine Checks That Turn Testimony Into Evidence</title>
      <link>https://swapnanilsaha.com/blog/verifying-ai-subagent-work/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/verifying-ai-subagent-work/</guid>
      <pubDate>Wed, 19 Aug 2026 09:00:00 +0530</pubDate>
      <description>A subagent's completion report is testimony, not evidence. Nine mechanical, adversarial checks that turn the claim into a fact, with real cases.</description>
    </item>
    <item>
      <title>The Memory Legibility Problem: Why a Text File Still Beats My Own Product</title>
      <link>https://swapnanilsaha.com/blog/agent-memory-legibility-problem/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agent-memory-legibility-problem/</guid>
      <pubDate>Tue, 18 Aug 2026 09:00:00 +0530</pubDate>
      <description>A flat MEMORY.md file never misses, because it never chooses. My semantic memory store can miss silently: a new deterministic export closes part of that gap.</description>
    </item>
    <item>
      <title>Agent Memory Expiry Is a State, Not a Delete: Four Bugs I Shipped Against My Own Thesis</title>
      <link>https://swapnanilsaha.com/blog/agent-memory-expiry-is-a-state-not-a-delete/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agent-memory-expiry-is-a-state-not-a-delete/</guid>
      <pubDate>Sun, 16 Aug 2026 09:00:00 +0530</pubDate>
      <description>Most agent-memory systems age notes out with a TTL delete. I shipped that bug myself, then fixed it: expiry should be a visibility state.</description>
    </item>
    <item>
      <title>Your Eval Is Leaking the Answer: Paths, Fixtures, Residue, and Your Own Git Identity</title>
      <link>https://swapnanilsaha.com/blog/agent-eval-leaks/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agent-eval-leaks/</guid>
      <pubDate>Sat, 01 Aug 2026 09:00:00 +0530</pubDate>
      <description>A control arm that should have known nothing named the hidden mechanism out loud. It read it off its own working directory. Five leak classes and the fixes.</description>
    </item>
    <item>
      <title>The Bugs Only Dogfooding Finds: A Month Living Inside My Own Memory Daemon</title>
      <link>https://swapnanilsaha.com/blog/dogfooding-bugs-ai-memory-daemon/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/dogfooding-bugs-ai-memory-daemon/</guid>
      <pubDate>Thu, 30 Jul 2026 09:00:00 +0530</pubDate>
      <description>Six real bugs no test suite and no reviewer caught. Only residency did. Each one is a boundary a test harness has no way to represent.</description>
    </item>
    <item>
      <title>Agent Memory Needs a Trust Ladder: Provenance, Revocation, and Notes That Lie</title>
      <link>https://swapnanilsaha.com/blog/agent-memory-trust-ladder/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agent-memory-trust-ladder/</guid>
      <pubDate>Tue, 28 Jul 2026 09:00:00 +0530</pubDate>
      <description>Three ways a stored note lies, the trust ladder I shipped to handle them, and the three problems I have not solved.</description>
    </item>
    <item>
      <title>The Sentinel Pattern: A Multi-Agent Dev Loop That Doesn't Trust Its Own Agents</title>
      <link>https://swapnanilsaha.com/blog/sentinel-pattern-multi-agent-development/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/sentinel-pattern-multi-agent-development/</guid>
      <pubDate>Sun, 26 Jul 2026 09:00:00 +0530</pubDate>
      <description>One orchestrator that writes no product code, disposable coders in isolated worktrees, reviewers paid to attack, and seven rules that each cost me something to learn.</description>
    </item>
    <item>
      <title>The Agent Never Chooses to Remember: Memory as a Harness Property</title>
      <link>https://swapnanilsaha.com/blog/agent-memory-harness-property/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/agent-memory-harness-property/</guid>
      <pubDate>Fri, 24 Jul 2026 09:00:00 +0530</pubDate>
      <description>Every shipped agent memory design assumes the model volunteers to save and recall. In a seeded control it volunteered zero times in 114 turns. What to build instead.</description>
    </item>
    <item>
      <title>Your MCP Tool Works. The Model Still Won't Call It.</title>
      <link>https://swapnanilsaha.com/blog/mcp-tool-adoption-agents/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/mcp-tool-adoption-agents/</guid>
      <pubDate>Mon, 20 Jul 2026 09:00:00 +0530</pubDate>
      <description>A controlled study of MCP tool adoption: 0 calls in 63 turns with 30 mentions of the tool — and what actually moves the number.</description>
    </item>
    <item>
      <title>I Deleted Every Ranking Heuristic From My Code Search Engine</title>
      <link>https://swapnanilsaha.com/blog/deleting-ranking-heuristics-code-search/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/deleting-ranking-heuristics-code-search/</guid>
      <pubDate>Sun, 19 Jul 2026 09:00:00 +0530</pubDate>
      <description>3,817 lines of if/else, deleted in one commit — and the measured evidence for why query-keyword branches can never rank code search.</description>
    </item>
    <item>
      <title>Embedding Dilution: Why Semantic Code Search Misses the Answer</title>
      <link>https://swapnanilsaha.com/blog/embedding-dilution-code-search/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/embedding-dilution-code-search/</guid>
      <pubDate>Sat, 18 Jul 2026 09:00:00 +0530</pubDate>
      <description>The docstring paraphrased the query and it still ranked below 200 look-alikes. A measured post-mortem of embedding dilution — and the dual-vector fix it shipped.</description>
    </item>
    <item>
      <title>What Actually Survives /compact in Claude Code: An Empirical Map</title>
      <link>https://swapnanilsaha.com/blog/what-survives-compact-claude-code/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/what-survives-compact-claude-code/</guid>
      <pubDate>Fri, 17 Jul 2026 09:00:00 +0530</pubDate>
      <description>We forced 100+ compactions and graded, fact by fact, what the boundary keeps and what silently dies. The measured map, honest costs included.</description>
    </item>
    <item>
      <title>Vectr 1.1.0: Seven Agents, One Shared Memory, Zero Shared Chat</title>
      <link>https://swapnanilsaha.com/blog/vectr-1-1-team-mode-seven-agent-test/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/vectr-1-1-team-mode-seven-agent-test/</guid>
      <pubDate>Sat, 11 Jul 2026 09:00:00 +0530</pubDate>
      <description>Team mode, auth, and encryption at rest — gated by a test where seven AI agents built and reviewed a product coordinating only through vectr's shared memory.</description>
    </item>
    <item>
      <title>Vectr v1.0.0: The Release Gate, the Bugs It Caught, and the Numbers I Didn't Round Up</title>
      <link>https://swapnanilsaha.com/blog/vectr-v1-release-gate-honest-numbers/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/vectr-v1-release-gate-honest-numbers/</guid>
      <pubDate>Wed, 08 Jul 2026 09:00:00 +0530</pubDate>
      <description>A first-person dogfood gate caught two release-blocking bugs before the tag — and the honest cost numbers, wins and losses, that shipped with v1.0.0.</description>
    </item>
    <item>
      <title>The Four Families of Context Relief for LLM Coding Agents</title>
      <link>https://swapnanilsaha.com/blog/four-families-llm-context-relief-eviction/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/four-families-llm-context-relief-eviction/</guid>
      <pubDate>Mon, 06 Jul 2026 09:00:00 +0530</pubDate>
      <description>Eviction, offload-and-recall, retrieval-over-stuffing, and subagent isolation — how to keep a coding agent from drowning in its own context, and why the four only work when composed.</description>
    </item>
    <item>
      <title>Claude Code Hooks: A Practical Deep-Dive on Deterministic Agent Behavior</title>
      <link>https://swapnanilsaha.com/blog/claude-code-hooks-deterministic-agent-memory/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/claude-code-hooks-deterministic-agent-memory/</guid>
      <pubDate>Sat, 04 Jul 2026 09:00:00 +0530</pubDate>
      <description>Events, the settings.json contract, exit codes — and a real production hook pipeline that injects working memory into an agent deterministically.</description>
    </item>
    <item>
      <title>Building Vectr Part 3: What the Benchmark Numbers Actually Mean</title>
      <link>https://swapnanilsaha.com/blog/building-vectr-part-3-benchmark-methodology-results/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/building-vectr-part-3-benchmark-methodology-results/</guid>
      <pubDate>Sun, 14 Jun 2026 09:00:00 +0530</pubDate>
      <description>How I benchmarked an AI code editor tool without fooling myself — methodology, the research vs implementation distinction, and what the CPython results actually show.</description>
    </item>
    <item>
      <title>Building Vectr Part 2: What /compact Destroys and How to Survive It</title>
      <link>https://swapnanilsaha.com/blog/building-vectr-part-2-working-memory-compact-survival/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/building-vectr-part-2-working-memory-compact-survival/</guid>
      <pubDate>Thu, 11 Jun 2026 09:00:00 +0530</pubDate>
      <description>Why /compact kills precision, what the KV cache actually is, and how I built a working memory layer that survives session boundaries — with the bugs that made it real.</description>
    </item>
    <item>
      <title>Building Vectr Part 1: Why grep Fails When You Don't Know the Keywords</title>
      <link>https://swapnanilsaha.com/blog/building-vectr-part-1-semantic-code-search/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/building-vectr-part-1-semantic-code-search/</guid>
      <pubDate>Tue, 09 Jun 2026 09:00:00 +0530</pubDate>
      <description>How I built a local semantic code indexer for AI editors — covering AST chunking, hybrid vector+BM25 search, symbol graphs, and why naive approaches break on real codebases.</description>
    </item>
    <item>
      <title>LLM Context Window Token Budget: Why Your Window Fills Up Fast</title>
      <link>https://swapnanilsaha.com/blog/llm-context-window-token-budget-guide/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/llm-context-window-token-budget-guide/</guid>
      <pubDate>Tue, 26 May 2026 09:00:00 +0530</pubDate>
      <description>Token budget arithmetic for LLM context windows: why system prompts, tool schemas, RAG, and history drain your window — and four strategies to manage it.</description>
    </item>
    <item>
      <title>Why AI Code Assistants Waste Context — and How RAG Fixes It</title>
      <link>https://swapnanilsaha.com/blog/why-ai-code-assistants-waste-context-rag/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/why-ai-code-assistants-waste-context-rag/</guid>
      <pubDate>Sun, 24 May 2026 09:00:00 +0530</pubDate>
      <description>Context window stuffing silently degrades AI code assistant accuracy. Learn exactly why attention dilutes over long inputs and how RAG for code fixes it.</description>
    </item>
    <item>
      <title>The Complete Guide to Text Embeddings, Vector Databases &amp; LLMs</title>
      <link>https://swapnanilsaha.com/blog/text-embeddings-llms-rag-complete-guide/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/text-embeddings-llms-rag-complete-guide/</guid>
      <pubDate>Sat, 23 May 2026 09:00:00 +0530</pubDate>
      <description>From tokenization and transformers to cosine similarity, HNSW, RAG pipelines, and LLM training costs. With 7 interactive demos.</description>
    </item>
    <item>
      <title>DPDP Act 2023 + AI/LLM: Automating Data Principal Requests in India</title>
      <link>https://swapnanilsaha.com/blog/dpdp-act-ai-llm-automation/</link>
      <guid isPermaLink="true">https://swapnanilsaha.com/blog/dpdp-act-ai-llm-automation/</guid>
      <pubDate>Fri, 22 May 2026 09:00:00 +0530</pubDate>
      <description>What the DPDP Act actually requires, why shared inboxes fail, and how AI classifies requests, drafts multilingual replies, and generates audit-ready evidence — a deep technical guide.</description>
    </item>
  </channel>
</rss>
