1. Cortex Rail
  2. How the memory works

Memory and context

A project memory for AI coding agents.

AI coding tools forget. Every new chat starts from zero and learns the project again, at your expense. Cortex Rail keeps what was decided as small notes inside your project, and hands the AI only the few that matter for the message in front of it.

93%of the time the right note is among the top five, in our own test of 95 questions
~9 msfor a search, on your own computer, with nothing sent anywhere
Any AIClaude Code, Codex, OpenCode and the others read and write the same notes
Cortex Rail · Memory map
The memory map in Cortex Rail: each dot is a named note, joined to the notes it relates to

The problem with how AI tools remember today

Most AI coding tools give you two choices. A short memory, so the AI forgets why things were built the way they were. Or one long instructions file that is loaded in full with every message, so it costs more each week and the AI still skims it.

Neither holds up on a real project. After a month there are hundreds of decisions: why prices are kept in cents, which service sends the emails, what broke last time someone changed the sign-in. An AI that does not know them will decide again, differently.

How Cortex Rail remembers

Cortex Rail keeps each thing worth remembering as its own small note. There are five kinds:

  • Decisions. What was chosen, and why.
  • Rules. What must always or never be done in this project.
  • Things to watch out for. Pitfalls somebody already fell into.
  • Lessons. What was learned while doing a task.
  • Preferences. How you like things done.

Notes are plain text files in a folder of your project, saved in git with the code. You can read them, change them and delete them. Notes link to the notes they relate to, and the app draws them as a map.

How the right note is found

Before each message reaches the AI, Cortex Rail looks through the notes and hands over the few that match. It matches by meaning, not only by words: ask about “money” and it finds the note about prices in cents.

A small search model does this on your own computer. Nothing is sent to a search service, and there is no extra bill. In our own test of 95 questions, the right note was among the top five 93% of the time; looking for the same words alone managed 75%. When the question was asked in different words than the note uses, it was 89% against 58%.

What the AI loads, and what stays on disk

For every message the AI gets three small things: a tiny core that is always loaded, a map of the notes, and the few notes that match. Everything else stays on disk, untouched and unpaid for, until a message needs it.

That is why a long project stays about as cheap to work on as a new one. Task number 300 loads about as much as task number 3 did.

The AI writes its own notes

When a task is done, the AI saves what it learned: the decision, the reason, the pitfall. You do not press anything. Every save can be undone, and a small task that taught nothing new saves nothing.

This works in the Cortex Rail app and in any supported AI tool used by itself, also when the app is closed.

It survives long conversations

When a conversation gets long, AI tools shorten it to make room, and details get lost. Cortex Rail saves the important parts first and gives them back afterwards, so the AI carries on where it was.

It knows when a note may be wrong

Code changes. If the files a note describes have changed since the note was written, the note is marked “check this”. The AI then reads those files before it trusts the note, and corrects the note if it no longer holds.

It tidies itself

Old notes that are no longer used are put away automatically, so the working set stays small. Decisions, rules and things to watch out for are never deleted or shortened by the tidy-up.

One memory for the whole team

Because the notes travel with the code, a teammate who pulls the project has the same memory you have, whichever AI they use. On top of that:

  • Starting a task puts your name on it. Start one that is taken and you get a heads-up first.
  • When someone stops, a short note is saved: what they were on, what is not saved yet, what comes next.
  • The next person, or the same person next week, is greeted with it.

How it differs from one big instructions file

One big fileCortex Rail
What is loadedAll of it, with every messageA tiny core and the few notes that match
As the project growsIt gets longer and costs moreThe cost of a task stays about the same
Who writes itYou, by handThe AI, after each task, with an Undo
Out-of-date partsStay until someone noticesMarked “check this” when the code changed
Other AI toolsEach tool has its own fileOne memory that every tool shares

Cortex Rail works together with files such as CLAUDE.md and AGENTS.md. It adds one short pointer to them and leaves the rest of your file alone.

Private by design

The notes are files on your computer. The search runs on your computer. There is no Cortex Rail account and no Cortex Rail server holding your notes or your code.