Agents that retrieve the relevant file, not the similar one
A coding agent’s context is almost always full and almost always wrong: five files that mention the symbol, none of which is where the behaviour actually lives.
Similar code is not related code
Every one of these is a selection failure. The right file was in the index the whole time and lost to something that read more like the query.
Vector search returns the other four call sites
The helper is used in twelve places. Similarity ranks them by how much they look like each other, which is a property of the codebase's style, not of where the bug is.
The reason for the code is not in the code
Why this retry exists, and why the timeout is 40 seconds and not 30, was argued in a pull request last year. The diff survived; the argument did not, so the agent removes it as dead weight.
Every session re-learns the repository
An hour of exploration builds a working map of how the thing fits together. The task ends and the map is discarded, so the next task pays for it again.
Mostly decision context. Then three others.
Every application built on CortexDB is a different mixture of the same five memory jobs. That mixture is what makes this a different piece of software from the one next to it, even though the infrastructure underneath is identical.
Selection weighs state, validity and relationships — not similarity alone
Retrieval over a codebase is not nearest-neighbour with a larger k. Candidates are weighed on how they relate to what is already in the pack and to the change actually being made.
- Fewer, better files in the window.
- The closest match stops winning by default.
- The rationale travels with the code.
What was already tried here
The approach that failed on this module last week comes back as experience rather than being rediscovered.
The conventions of this codebase
Learned once — the error style, the test layout, the thing the team always rejects in review.
What the other agents changed
A fleet working one repository contributes to one picture of it rather than four.
That is four of the five. The fifth — valid time, two clocks on every memory — leads for employee support, legal and financial operations instead. Same engine, different mixture.
The repository, and the argument around it
The code is the easy half. The half that decides whether an agent's change is any good is in the review threads, the issues and the incidents.
01 Wire the sources
Vendor connectors ship as extras on the connector package.
pip install 'cortexdb-connectors[slack,github]'
02 Write the rationale, not the diff
Version control already has the change. What it does not have is why the change is the way it is, in a form the next agent can retrieve.
curl -X POST http://localhost:3141/v1/experience \
-H 'Content-Type: application/json' \
-d '{
"scope": "ws:repo/platform",
"modality": "observation",
"content": {
"kind": "text",
"text": "The 40s retry window in the payments client exists because the upstream 3DS step can block that long. It was 30s and caused intermittent declines — do not lower it."
},
"context": { "observed_at": "2026-08-27T09:14:00Z" },
"idempotency_key": "github:platform:pr-4412"
}'
03 Recall on a budget
The budget is the point. Forcing selection to choose is what makes it choose well, and a pack that fits is a pack the model can use.
from cortexdb.v1 import V1Client
client = V1Client(api_url="http://localhost:3141", actor="agent:coding")
pack = client.recall(
scope="ws:repo/platform",
query=task_description,
view="holistic",
include=["facts", "beliefs", "episodes"],
budgets={"max_tokens": 1200},
)
reply = llm.respond(task_description, context=pack["context_block"])
pip install cortexdbai
or npm i cortexdbai — both ship the same client.
Full endpoint reference in the
docs.
Source code is the asset, and the memory is a map of it
A codebase memory holds architecture, credentials mentioned in passing, and the reasoning behind every unshipped decision. Most engineering organisations treat that as the thing that must not leave.
CortexDB is a single container. It runs on your own hardware, inside your VPC, or air-gapped — with the embedding and generation calls pointed at a local model if nothing may leave at all.
docker run -d --name cortexdb -p 3141:3141 -v cortexdb-data:/data cortexdb/cortexdb:latest
Deployment options, model routing and the enterprise notes are on the download page.
The same infrastructure, a different mixture
Each of these leads with a different memory job, pulls from a different set of sources, and needs a different call. <a class="ul" href="../index.html">All of them, by job</a>.
Bring the workflow that gets it wrong.
One command starts a local instance with its own volume. The changelog carries every release behind it.