<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Code-Navigation | Antoine Weill--Duflos</title>
    <link>https://antoine.weill-duflos.fr/en/tag/code-navigation/</link>
      <atom:link href="https://antoine.weill-duflos.fr/en/tag/code-navigation/index.xml" rel="self" type="application/rss+xml" />
    <description>Code-Navigation</description>
    <generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Sat, 06 Jun 2026 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://antoine.weill-duflos.fr/media/icon_hu_d686267daab28486.png</url>
      <title>Code-Navigation</title>
      <link>https://antoine.weill-duflos.fr/en/tag/code-navigation/</link>
    </image>
    
    <item>
      <title>cortexmd: a long-term memory and code-navigation brain for AI agents</title>
      <link>https://antoine.weill-duflos.fr/en/project/cortexmd/</link>
      <pubDate>Wed, 03 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://antoine.weill-duflos.fr/en/project/cortexmd/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/Leicas/cortexmd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;cortexmd&lt;/a&gt; is a long-term memory and code-navigation brain for AI agents, exposed over the &lt;strong&gt;Model Context Protocol&lt;/strong&gt;. It started as a private project on my homelab called obsidian-mcp, a server that let Claude read, search, and write notes in my Obsidian vault. I built it for myself, then cleaned it up to share.&lt;/p&gt;
&lt;p&gt;It does two things.&lt;/p&gt;
&lt;p&gt;The first is &lt;strong&gt;memory&lt;/strong&gt;. Agents forget everything between sessions. cortexmd gives them somewhere to put what they learn: memories auto-categorised into kinds like observation, decision, insight, and plan, with a heat lifecycle where reading a memory warms it and inactivity cools it down. Recall is hybrid, fusing full-text and semantic search, boosted by temperature and links. At the start of a session the agent does a wakeup that surfaces the hottest, most relevant memories, so it picks up where it left off.&lt;/p&gt;
&lt;p&gt;The second is &lt;strong&gt;code navigation&lt;/strong&gt;. A Rust indexer walks a repo, parses it with tree-sitter, and builds a SQLite symbol database recording each symbol&amp;rsquo;s name, kind, signature, docstring, file range, and call graph. That index is exposed as cheap MCP tools: symbol search, file outline, callers and callees, change-impact, call-chain, dead code, import cycles, and copy-paste duplicates. The design goal is that an agent navigates code by querying the index, at roughly 60 tokens per result, instead of reading whole files. There is an opt-in shell hook that rewrites things like grep and cat on an indexed repo into the equivalent code-nav call.&lt;/p&gt;
&lt;p&gt;The piece that made it shippable is the &lt;strong&gt;brain-vault model&lt;/strong&gt;. cortexmd owns a separate brain vault that is the only thing it ever writes to. Your own vaults are attached as read-only sources, indexed for search and code-nav, never modified, with a default-deny allowlist so private subtrees stay out. Data flows one way, so there is no shared mutable file and no merge race.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  SOURCE_VAULTS[]  (read-only, opt-in, allowlisted)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  ┌───────────┐  ┌───────────┐  ┌───────────┐
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  │  notes/   │  │  code/    │  │  docs/    │
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  └─────┬─────┘  └─────┬─────┘  └─────┬─────┘
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        │  index (one-way, read)      │
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        └──────────────┼──────────────┘
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                       ▼
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              ┌──────────────────┐
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              │     cortexmd     │   &amp;lt;- sole writer
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              │   (MCP server)   │
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              └────────┬─────────┘
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                       │ writes
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                       ▼
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              ┌──────────────────┐
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              │   BRAIN_VAULT    │   memories · journal · diaries
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              │ (own dir, not    │   tasks · KG notes · code-repos.json
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              │  your vault)     │
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;              └──────────────────┘
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It runs in two modes: a &lt;strong&gt;local-stdio&lt;/strong&gt; mode with no Docker, no auth, and no network, recommended for one person; and a &lt;strong&gt;self-hosted HTTP&lt;/strong&gt; mode with auth for multi-client setups. The repo is a polyglot monorepo, a TypeScript MCP server and a single Rust binary, kept honest by a shared contract and a CI parity check.&lt;/p&gt;
&lt;p&gt;cortexmd is &lt;strong&gt;pre-alpha and MIT licensed&lt;/strong&gt;. APIs and config names are still in flux.&lt;/p&gt;
&lt;p&gt;The full story is in a four-part blog series. Start with &lt;a href=&#34;../../post/cortexmd-second-brain/&#34;&gt;Giving an AI Agent a Second Brain&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The Token Killer: Navigating Code Without Reading It</title>
      <link>https://antoine.weill-duflos.fr/en/post/cortexmd-token-killer/</link>
      <pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://antoine.weill-duflos.fr/en/post/cortexmd-token-killer/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;../cortexmd-memory-engine/&#34;&gt;part two&lt;/a&gt; I wrote about the half of cortexmd that fights forgetting: the memory engine, with its heat and decay and its nightly dream. This post is about the other half, the half that fights waste.&lt;/p&gt;
&lt;p&gt;Here is the problem. When you ask an AI agent to work on a real codebase, the default move is to read files. The agent opens a file, the whole thing lands in its context, and now you are paying for every line of it. Most of those lines are noise for the task at hand. You wanted to know what one function does and who calls it, and instead you bought a thousand-line file plus imports plus three helper modules it pulled in to be safe. Do that a few times and the context window is full of code the agent will never use, the signal is buried, and the bill is real.&lt;/p&gt;
&lt;p&gt;The fix is to stop reading code and start querying it.&lt;/p&gt;
&lt;h2 id=&#34;a-repo-is-a-graph-not-a-pile-of-text&#34;&gt;A repo is a graph, not a pile of text&lt;/h2&gt;
&lt;p&gt;The insight is old and boring and correct: source code is not really a flat pile of text. It is a graph of symbols. Functions, methods, types, and the edges between them, who calls whom. An IDE knows this. &amp;ldquo;Go to definition&amp;rdquo; and &amp;ldquo;find all references&amp;rdquo; do not read your files top to bottom every time you click. They consult an index. cortexmd gives an agent the same thing.&lt;/p&gt;
&lt;p&gt;The indexer is a Rust binary (&lt;code&gt;cortexmd-cli&lt;/code&gt;, the same binary that ships the CLI client and the session hooks I will get to). It walks a repo, parses each file with tree-sitter, and writes the result into a SQLite symbol database. For every symbol it records the name, the kind (function, method, type, and so on), the signature, the docstring if there is one, the file range, and, crucially, the call graph: callers and callees. tree-sitter is the right tool here because it is fast, it is incremental, and it speaks a lot of languages, so the same indexing pass works across a polyglot repo instead of needing one bespoke parser per toolchain.&lt;/p&gt;
&lt;p&gt;Once that database exists, the agent never has to open a file just to orient itself.&lt;/p&gt;
&lt;h2 id=&#34;the-code-nav-tools&#34;&gt;The code-nav tools&lt;/h2&gt;
&lt;p&gt;The index is exposed to MCP clients as a set of cheap tools. Each one answers a specific question that an agent actually asks while working:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;symbol search&lt;/strong&gt;: find symbols by name, signature, or docstring text. The entry point into everything else.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;file outline&lt;/strong&gt;: the shape of a file (its symbols and their signatures) without the bodies. You get the table of contents instead of the book.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;get one symbol&lt;/strong&gt;: pull the body of exactly one symbol when you have decided you need it, and nothing else.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;callers and callees&lt;/strong&gt;: walk the call graph in either direction. Who calls this, what does this call.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;change impact&lt;/strong&gt;: the transitive answer to &amp;ldquo;if I change this, who breaks?&amp;rdquo; This is the one I reach for most before touching anything load-bearing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;call chain&lt;/strong&gt;: the path from one symbol to another, so you can see how A actually reaches Z.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;find dead code&lt;/strong&gt;: symbols nothing resolves to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;find import cycles&lt;/strong&gt;: where the module graph loops back on itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;find semantic duplicates&lt;/strong&gt;: copy-paste detection, the near-identical bodies that drifted apart.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;















&lt;figure  id=&#34;figure-the-code-nav-savings-view-with-cortexmd-indexing-its-own-repository-the-project-dogfooding-its-indexer-the-figures-here-come-from-the-projects-seeded-demo-not-a-formal-benchmark&#34;&gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://antoine.weill-duflos.fr/img/cortexmd/code.png&#34; alt=&#34;The Code tab of the cortexmd dashboard, showing tokens saved per tool, a cumulative savings chart, and the indexed repositories&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;figcaption&gt;
      The code-nav savings view, with cortexmd indexing its own repository (the project dogfooding its indexer). The figures here come from the project&amp;rsquo;s seeded demo, not a formal benchmark.
    &lt;/figcaption&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;The pattern across all of them is the same. The agent narrows before it reads. Search to find the symbol, outline to see the neighbourhood, callers and change-impact to understand the blast radius, and only then, if it truly needs the body, get one symbol. Most tasks never need a full file at all.&lt;/p&gt;
&lt;h2 id=&#34;roughly-60-tokens-per-result&#34;&gt;Roughly 60 tokens per result&lt;/h2&gt;
&lt;p&gt;Here is the design goal that drove the whole thing. A code-nav lookup is meant to cost roughly 60 tokens per result. Reading a whole file costs thousands. So querying the index is meant to be many times cheaper than reading, for the same useful answer.&lt;/p&gt;
&lt;p&gt;I want to be honest about what that number is and is not. It is a target I designed toward, not a benchmark I am quoting at you. The exact cost depends on the symbol, the language, how much docstring there is. But the shape of it is the entire point: a result is a compact record (name, kind, signature, a range, some edges), not a slab of source. When the unit of work is a 60-token fact instead of a 2,000-token file, an agent can ask twenty questions for the price of one read, and the context window stays full of answers instead of haystack.&lt;/p&gt;
&lt;p&gt;It also reads better for the model. A clean list of callers is easier to reason over than the same information smeared across five files the agent had to load to reconstruct it.&lt;/p&gt;
&lt;h2 id=&#34;catching-the-old-habit&#34;&gt;Catching the old habit&lt;/h2&gt;
&lt;p&gt;There is a catch with giving an agent better tools: it has to remember to use them. The muscle memory of &amp;ldquo;investigate the code&amp;rdquo; is &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;head&lt;/code&gt;, &lt;code&gt;tail&lt;/code&gt;. Those habits are deep, and an agent will happily fall back to them and start hauling files into context the moment you stop watching.&lt;/p&gt;
&lt;p&gt;So cortexmd ships an opt-in shell hook. When it is on and you are working in an indexed repo, it rewrites those commands into their cheap code-nav equivalents. A &lt;code&gt;grep&lt;/code&gt; for a symbol becomes a symbol search. A &lt;code&gt;cat&lt;/code&gt; of a file becomes a file outline. The agent thinks it is doing the old thing, and the index quietly answers instead. It is opt-in on purpose, because rewriting someone&amp;rsquo;s shell commands is exactly the kind of magic you want to consent to rather than discover, and because the rewrite only makes sense on a repo that is actually indexed.&lt;/p&gt;
&lt;p&gt;The nice property is that it meets the agent where its habits already are. You do not have to retrain the reflex, you just intercept it.&lt;/p&gt;
&lt;h2 id=&#34;dogfooding-on-its-own-source&#34;&gt;Dogfooding on its own source&lt;/h2&gt;
&lt;p&gt;I did not test this on a toy. cortexmd is a polyglot monorepo (TypeScript on one side, Rust on the other, more on that in part four), and I pointed the indexer at the project&amp;rsquo;s own source and worked on it through its own code-nav tools. That is the test that matters. When you are changing the indexer while navigating with the indexer, the rough edges find you fast. &amp;ldquo;Change impact says nothing breaks, so why did that break&amp;rdquo; is a very motivating sentence to read in your own logs.&lt;/p&gt;
&lt;p&gt;Dogfooding is also where the two halves of cortexmd meet. The code index tells the agent what the code is right now. The memory engine from &lt;a href=&#34;../cortexmd-memory-engine/&#34;&gt;part two&lt;/a&gt; tells it why the code is the way it is, the decisions and the dead ends that no symbol database will ever record. Structure plus history. One is queried, one is recalled, and together they are most of what I want a collaborator to have.&lt;/p&gt;
&lt;p&gt;This is still pre-alpha, so the exact tool names and config will move around. The idea underneath is stable: navigate code by querying an index, not by reading files, and pay 60 tokens for a fact instead of thousands for a haystack.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&#34;../cortexmd-open-source/&#34;&gt;part four&lt;/a&gt; I get to the part that turned a private homelab tool into something I could put on the internet: why a tool tuned entirely to my own setup could not be shared as-is, the brain-vault redesign that generalised it, and why I open-sourced it.&lt;/p&gt;
&lt;p&gt;The project page is &lt;a href=&#34;../../project/cortexmd/&#34;&gt;here&lt;/a&gt;, and the code is at &lt;a href=&#34;https://github.com/Leicas/cortexmd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;github.com/Leicas/cortexmd&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;series&#34;&gt;Series&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&#34;../cortexmd-second-brain/&#34;&gt;Giving an AI Agent a Second Brain&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../cortexmd-memory-engine/&#34;&gt;The Memory Engine: Heat, Decay, and Dreams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The Token Killer: Navigating Code Without Reading It (you are here)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../cortexmd-open-source/&#34;&gt;Open-Sourcing the Brain: the Brain-Vault Model&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
    </item>
    
    <item>
      <title>Giving an AI Agent a Second Brain</title>
      <link>https://antoine.weill-duflos.fr/en/post/cortexmd-second-brain/</link>
      <pubDate>Thu, 04 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://antoine.weill-duflos.fr/en/post/cortexmd-second-brain/</guid>
      <description>&lt;p&gt;I work with a coding agent most days now. It is genuinely good. It reads my code, reasons about it, proposes changes, runs the tests, fixes what it broke. And every single time I open a fresh session, it has the memory of a goldfish.&lt;/p&gt;
&lt;p&gt;It does not remember the decision we made last week about why a module is structured the way it is. It does not remember that I prefer commas to dashes, or that one corner of the codebase is load-bearing and fragile. It does not remember the conversation where we ruled out an approach for good reasons. All of that context lived in the previous session, and the previous session is gone. So I re-explain. Then I re-explain again the next day.&lt;/p&gt;
&lt;p&gt;That is the first problem. The agent forgets.&lt;/p&gt;
&lt;p&gt;And it is not only the code. The moment I ask it to help with anything human, the same hole opens up. Ask it to draft an email and it has no idea who the recipient is to me, whether this is a close friend, a colleague, or a partner I need to handle with care, so it has no idea what tone to take, because the tone lived in past conversations it can no longer see. It does a poor job of linking one session to the next, so every thread starts cold. And the way I keep my life split makes it worse: personal in one account, work in another, the way most people do. The moment I cross from one to the other, whatever the agent had learned about me is simply gone. Poof. No memory.&lt;/p&gt;
&lt;h2 id=&#34;two-problems-not-one&#34;&gt;Two problems, not one&lt;/h2&gt;
&lt;p&gt;The second problem is quieter but it shows up on every invoice. To do anything useful, the agent has to understand the code, and the way it understands code is by reading it. So it reads files. Whole files. To answer a small question about one function, it will pull an entire module into context, and often the modules that call that module too. Multiply that across a working session and you are paying, in tokens, to load the same source over and over, most of which is irrelevant to the question at hand.&lt;/p&gt;
&lt;p&gt;Both problems come from the same place: the agent has no persistent store of what it has learned, and no cheap way to look things up. It only has the context window in front of it, and the context window is both forgetful and expensive to fill.&lt;/p&gt;
&lt;p&gt;I decided to do something about both. Not because I had a product idea, but because it was annoying me on a daily basis and I had a homelab sitting there asking to be useful.&lt;/p&gt;
&lt;p&gt;There was also a personal reason the shape of the solution felt obvious. A while ago, after reading a &lt;a href=&#34;https://blog.tolki.dev/posts/2022/pkm/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;friend&amp;rsquo;s long write-up of his own personal-knowledge-management journey&lt;/a&gt;, I started keeping notes in Obsidian. Building that second brain for myself changed how I thought about the problem. If a vault of linked notes works as external memory for me, it should work as external memory for the agent too. I could let it read mine to get started, as a read-only source, and then let it build its own brain, one that I could actually open, navigate, and understand. Not a black box of embeddings somewhere, but notes, in a vault, that I own.&lt;/p&gt;
&lt;h2 id=&#34;the-homelab-origin&#34;&gt;The homelab origin&lt;/h2&gt;
&lt;p&gt;For a while now I have run a small MCP server on my homelab. MCP, the Model Context Protocol, is the standard way to give an AI client tools and data it can reach out to. The server I built was called obsidian-mcp, and its first job was simple: give Claude the ability to read, search, and write notes in my Obsidian vault.&lt;/p&gt;
&lt;p&gt;It ran in a Docker container behind a reverse proxy, my notes were already there, and suddenly the agent could reach into them. That alone was useful. But it also turned the vault into a natural place to put the answers to my two problems, because a vault is just structured text that an agent can read and write, and that is exactly what both a memory and a code index need to be backed by.&lt;/p&gt;
&lt;p&gt;So the server grew two new capabilities, one for each problem.&lt;/p&gt;
&lt;p&gt;The first capability is a memory system, inspired by &lt;a href=&#34;https://github.com/mempalace/mempalace&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;mempalace&lt;/a&gt;, a memory-palace project for AI agents. Instead of letting everything evaporate at the end of a session, the agent can store what it learns: an observation, a decision, an insight, a preference I stated out loud. Those memories do not just pile up forever in a flat list. They have a lifecycle. The ones that get used stay warm and easy to surface, the ones nobody touches cool off and eventually get folded into summaries, and at the start of a new session the agent does a wakeup that brings the hottest, most relevant memories back to the surface. The point is continuity. The agent picks up roughly where it left off instead of from zero. That is the subject of part two.&lt;/p&gt;
&lt;p&gt;The second capability is a code index. Rather than read whole files to understand a repository, the agent queries an index of it. A Rust indexer walks the repo, parses it, and records the things you actually want to look up: what symbols exist, their signatures, where they live, and crucially who calls whom. Then the agent asks targeted questions. What does this function look like? Who calls it? What breaks if I change it? Each answer is small and cheap, on the order of a lookup rather than a full read, instead of dragging the entire file into context. The design goal is blunt: a code-nav lookup should cost roughly sixty tokens per result and be many times cheaper than reading the file it came from. That is the subject of part three.&lt;/p&gt;
&lt;h2 id=&#34;from-a-private-tool-to-cortexmd&#34;&gt;From a private tool to cortexmd&lt;/h2&gt;
&lt;p&gt;For months this was a personal thing. It ran on my hardware, over my own private Obsidian vault, the one that holds both personal and work notes. I am not going to quote any of it here, and the tool itself is deliberately built so that the data stays mine. But the point stands: it was a tool I made for myself, and I used it every day.&lt;/p&gt;
&lt;p&gt;Then I hit a different kind of wall, one that came precisely from how well it worked for me. I will tell it properly in part four, but the short version is that the whole thing was tuned to my own setup, my vault, mounted and synced my way, so it was a great personal tool and impossible for anyone else to run. Making it shareable meant a redesign, and that redesign is what finally turned it into something other people could use.&lt;/p&gt;
&lt;p&gt;That redesign became cortexmd. It is open source, MIT licensed, and public at &lt;a href=&#34;https://github.com/Leicas/cortexmd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;github.com/Leicas/cortexmd&lt;/a&gt;. It is honestly pre-alpha. The APIs and the config names are still in flux, and I would not bet a production workflow on it yet. The honest framing is the right one: I built this for myself, then cleaned it up to share. The cleanup is real work and it is most of part four.&lt;/p&gt;
&lt;p&gt;















&lt;figure  id=&#34;figure-what-it-became-the-cortexmd-control-panel-this-screenshot-is-from-the-projects-self-contained-demo-so-the-data-is-seeded-samples-not-my-own-vault&#34;&gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://antoine.weill-duflos.fr/img/cortexmd/overview.png&#34; alt=&#34;The cortexmd control panel overview tab, with request, latency, memory and code-nav panels and a tool-usage table&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;figcaption&gt;
      What it became: the cortexmd control panel. This screenshot is from the project&amp;rsquo;s self-contained demo, so the data is seeded samples, not my own vault.
    &lt;/figcaption&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;So that is the shape of the series. There were two problems, an agent that forgets and an agent that burns tokens re-reading code. There are two answers, a memory system and a code index, both born inside a homelab MCP server. And there is the redesign that turned a private tool into something you can run yourself.&lt;/p&gt;
&lt;h2 id=&#34;what-is-coming&#34;&gt;What is coming&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Part 2, the memory engine.&lt;/strong&gt; Heat, decay, and dreams. The eight categories a memory can fall into, the hot to warm to cold lifecycle, promote-on-access, consolidation, hybrid recall that fuses full-text and semantic search, the session wakeup, and the auto-linking graph that wires notes together as they are stored.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part 3, the token killer.&lt;/strong&gt; The Rust and tree-sitter indexer, the SQLite symbol database, the code-nav tools, the roughly sixty tokens per result idea, the opt-in shell hook that rewrites things like grep and cat on an indexed repo into the cheap equivalent, and what it was like to dogfood all of it on the project&amp;rsquo;s own source.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Part 4, open-sourcing the brain.&lt;/strong&gt; Why a tool that only worked for me had to be redesigned to share, the brain-vault model that generalises it, the two deployment modes, the polyglot monorepo held together by a shared contract, the rename, and why I care about owning my own data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to skip ahead to the code, the project page is over &lt;a href=&#34;../../project/cortexmd/&#34;&gt;here&lt;/a&gt; and the repo is &lt;a href=&#34;https://github.com/Leicas/cortexmd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;on GitHub&lt;/a&gt;. Otherwise, part two is where the agent starts to remember.&lt;/p&gt;
&lt;h2 id=&#34;series&#34;&gt;Series&lt;/h2&gt;
&lt;p&gt;This is &lt;strong&gt;Part 1: Giving an AI Agent a Second Brain&lt;/strong&gt; (you are here).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Part 1: Giving an AI Agent a Second Brain (this post)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../cortexmd-memory-engine/&#34;&gt;Part 2: The Memory Engine: Heat, Decay, and Dreams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../cortexmd-token-killer/&#34;&gt;Part 3: The Token Killer: Navigating Code Without Reading It&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../cortexmd-open-source/&#34;&gt;Part 4: Open-Sourcing the Brain: the Brain-Vault Model&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Project page: &lt;a href=&#34;../../project/cortexmd/&#34;&gt;cortexmd&lt;/a&gt;. Source: &lt;a href=&#34;https://github.com/Leicas/cortexmd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;github.com/Leicas/cortexmd&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
