writing

The decision nobody wrote down

Every Gagarin project has one memory, and everyone on the project shares it, along with every agent they use. A team can keep the reasons behind its decisions there, and each deploy can leave a note for the next one.

Three people work on saas, an invoicing app for small agencies. In October Ana moved the worker service from size s to size m, because rendering a long invoice got it OOM-killed. That costs $20.44 a month more. In late November Dana, who pays for the project, asks their agent to cut the bill. The agent reads gg status, sees a worker at m using a tenth of its CPU, and suggests moving it back to s.

Anyone who missed October would suggest the same, and the agent missed it too. gg status shows the size, and the person who chose it holds the reason. You'd find it in a chat thread from six weeks ago, or by messaging whoever is on holiday this week.

Project memory gives that reason a home. An agent writes it down once. Every later session on the project reads it back before it suggests anything, on anyone's machine.

The memory belongs to the project

A Gagarin project keeps its memory next to its services, so you can move to a new laptop or lose a chat history without losing it. The rule that decides who can deploy also decides who can use the memory. Dana shared saas with Ana as an editor and with Ben as a viewer. Pick a person to see what their agent may do:

OWNERpays
EDITORS1
VIEWERS1
ben’s agent, signed in as them
  • memory_briefingread the briefing●
  • memory_searchsearch it●
  • rememberwrite a memoryrefused
  • memory_updateconfirm, dispute, editrefused
remember → what the engine answers
[insufficient_role] you are a viewer on project "saas", which is read-only
hint: ask the project's owner or an editor to give you edit access

The ledger is the console's Members tab, where gg share adds people. Reads need viewer and writes need editor, the same rule the engine applies to a deploy, so Ben's agent can brief itself on everything the team knows and can't change any of it.

Each person's agent signs in to Gagarin's MCP server as that person and reads the memory through it. Commit .gagarin.json to the repository, and a teammate's agent will know which project it's working on. From then on your agent and theirs read the same facts, and whatever one of them learns, the next session starts with.

A memory holds one small fact of one kind: overview, architecture, decision, convention, gotcha, howto, reference or state. Write down what a future session would spend an hour rediscovering: why a decision went the way it did, a gotcha that cost an afternoon, where this deploy differs from the obvious one. Leave out what the repository already says, and keep credentials out. Gagarin encrypts the title and body at rest. It stores tags, keys, file paths and the kind as plain text, so keep secrets out of those too.

A briefing for the task at hand

An agent opens each session with memory_briefing. If it knows the task, it passes the task as a focus and the files it will touch as paths, and the matching memories come first. Dana's agent asks with the focus "cut the bill: move worker to size s", at a budget of 600 tokens. Switch the focus off to see what a session that names no task gets instead:

memory_briefing · saas · 600 tokens
focus: cut the bill: move worker to size s
what the memory holds, and when it was last written
# saas — 23 memories, 31 links · last write 2026-11-27
gotcha 6 · decision 5 · architecture 3 · state 3 · convention 2 · howto 2 · overview 1 · reference 1
pinned: always first
## #1 overview · saas: invoicing for small agencies, on Gagarin
tags: overview · pinned · importance 4 · updated 2026-09-28 · confirmed 2026-11-02
Three services (api, web, worker) and one managed Postgres, pg. web is the only public service. Money moves through Stripe; everything else is ours.
↔ #3 api, worker and web; pg is the only store of record
matches the task you named
## #18 gotcha · worker runs at size m: PDF rendering is OOM-killed at s [0.74]
tags: worker, sizing, pdf · paths: worker/render.ts · importance 4 · updated 2026-10-14 · confirmed 2026-11-20
Headless Chromium renders each invoice as one page. At s, any batch with an invoice over 30 pages was OOM-killed, and the retry rendered the same invoice again until the run timed out. m is the smallest size that renders our longest invoice (61 pages). Rendering page by page would let worker go back to s; nobody has built it.
↔ #22 Invoice batches run at 02:00 UTC · #24 What worker runs now
matches the task you named
## #24 state · What worker runs now [0.58]
key deploy/worker · tags: deploy, worker · updated 2026-11-19 · confirmed 2026-11-27
Size m, 1 copy. pg and the stripe resource reach it through deps. PDF_FONT_DIR and LOG_LEVEL are set on the deploy itself, so every deploy must restate both. The Dockerfile copies fonts into /app/fonts; without them the renderer falls back to a font with no ł or ő.
↔ #18 worker runs at size m: PDF rendering is OOM-killed at s · #4 worker drains the jobs table with SKIP LOCKED
matches the task you named
Relevant to focus:
#9 decision · Sizes are set per service, never one size for the project · 39t ↔2 [0.52]
#22 howto · Invoice batches run at 02:00 UTC · 33t ↔2 [0.49]
what the team changed this week
Recent (7d):
#31 decision · Invoice numbers are per agency, not global · 58t ↔3 · new
#26 howto · Rotate the Stripe key without a deploy · 44t ↔1 · new
#12 gotcha · Login reads the sessions table on every request · 37t ↔3 · updated
#19 state · Stripe webhooks still point at the old host · 31t ↔1 · archived
the rest, one line each
More:
#3 architecture · api, worker and web; pg is the only store of record · 47t ↔6
#7 decision · Sessions stay in Postgres, not valkey · 52t ↔4
#5 convention · Migrations are numbered and forward-only · 42t ↔3
#11 howto · Run migrations with gg run before deploying api ⚠ disputed · 36t ↔2
#14 state · The EU VAT export is half built · 40t ↔1 · unconfirmed 74d
what needs a look
tags: worker(7) deploy(6) pg(5) stripe(4) sessions(3)
⚠ 1 disputed memory (#11) — confirm, fix or archive them
Next: search · get ids · related id (follow ↔ links) · remember what you learn · update confirm/dispute what you checked

An example project, laid out line for line the way axon's briefing code lays one out. The worker's gotcha, outlined, is an index line on a cold start and the first thing in full once the task mentions the worker's size.

The agent reads #18 before it has touched a file. It leaves the worker at m and comes back with a better plan: render page by page, then move to s. #18 also tells it nobody has built that yet.

Read the Recent (7d): group as the team's changelog of decisions. It shows what your teammates' sessions learned this week: a new rule for invoice numbers, a new howto, a gotcha somebody corrected, a stale fact somebody archived. The header carries the date of the last write, so you can see whether the team keeps the memory up.

Each deploy leaves a note for the next one

Gagarin's deploy skill asks for a briefing focused on the deploy before it starts. Afterwards, it writes down what the next session would otherwise rediscover the slow way: the port, a Dockerfile quirk, and the names of the variables the application insists on (never their values).

On Gagarin those names carry extra weight. A deploy replaces the whole environment, and any variable it leaves out is gone from the next revision. An agent deploying worker for the first time reads in #24 that it has to restate PDF_FONT_DIR and LOG_LEVEL, and the renderer keeps its fonts.

The skill files the state of each service under a key, deploy/<service>, the name that fact will always go by. A project allows one active memory per key, so each deploy's note replaces the last. Step through the worker's three deploys:

key deploy/worker
  1. #172026-10-14
    What worker runs now
    size m · moved from s after the OOM kills
    PDF_FONT_DIR
    superseded by #21
  2. #212026-11-02
    What worker runs now
    size m · LOG_LEVEL added
    PDF_FONT_DIRLOG_LEVEL
    superseded by #24
  3. #242026-11-19
    What worker runs now
    size m · fonts copied into /app/fonts
    PDF_FONT_DIRLOG_LEVEL
    holds deploy/worker
remember → axon answers
Saved #24 (71t, key deploy/worker) in saas.
Replaced #21 (key deploy/worker); its links moved to #24.

The links move with the note, so the OOM gotcha points at whatever the worker runs today. The older notes stay in the project, marked superseded, as the record of what was true before. A variable new to a deploy is outlined in green.

Two agents, one fact

Two people on a team will learn the same thing in the same week. If both their agents write it down, the briefing spends its budget on the fact twice. So remember compares each new memory with the ones the project holds, and answers by how close the nearest one comes. Try three things Dana's agent might write after reading about the OOM kills:

already in memory, written by ana’s agent in October
#18 gotcha · worker runs at size m: PDF rendering is OOM-killed at s
dana’s agent tries to remember
0.400.550.750.851.00
remember → axon answers
Not saved — near-duplicate of:
#18 gotcha · worker runs at size m: PDF rendering is OOM-killed at s [0.91]
Use update to amend it, supersedes=<id> to replace it, or force=true to keep both.

The thresholds are axon's defaults; the similarities are illustrative, since the real ones come from the embedding model. At 0.85 and above nothing is saved. Below it, the write goes through with a warning to merge it.

A refused agent adds what it learned to #18, or links its finding to #18, and the team keeps one wording of the fact.

Facts go stale, and the memory says so

Say somebody removes a deploy flag in March. The note telling agents to pass it is still there in April, and an agent that trusts the note does worse than one with no memory at all. So each memory records when someone last checked it:

  • confirm means "I checked, this is still true." It resets the memory's age. Editing a memory confirms it too, since whoever rewrote it has read it.
  • dispute means "this looks wrong, and I can't tell what's right." The memory sinks to the bottom of the briefing marked ⚠ disputed, and the footer counts it until somebody confirms it, fixes it or archives it. In the example above, a teammate's agent noticed that api runs its migrations at boot now, which puts the howto in #11 in doubt.
  • Age lowers a memory's rank at a rate set by its kind. A state memory loses half its weight in 30 days. Gotchas, howtos and references take 180 days, and the rest take a year. Rank stops falling at 40%, so a fact can't age out of the briefing. A state memory unchecked for more than 60 days, or a gotcha unchecked for more than 180, carries its age on its line, as #14 does.
rank weight, days since anyone confirmed it
06 months1 year18 months
state
40%
gotcha · howto · reference
75%
decision · architecture · …
87%

Drag to age the memories, and press confirm to do what memory_update confirm=true does. The curves are axon's: each kind halves at its own half-life, and none falls below the dashed floor at 40%.

Every month or so, or when a briefing starts counting disputed memories, ask your agent to call memory_review. It lists likely duplicates, memories with no links, oversized ones, stale and unread ones, disputed ones, and the distance to the project's cap. An agent can do most of the tidy-up in ten minutes.

A decision keeps its history

To reverse a decision, an agent writes the new one and has it supersede the old. The old memory stays, linked and marked superseded, so a later reader sees what the team believed and why that changed. In the example project, sessions lived in valkey until a restart logged every user out. A team that keeps that record won't move sessions back into valkey a year later, after everyone has forgotten the restart.

What it costs

Memories in use cost $0.10 per 1,000 a month, and reads cost nothing. A project holds up to 5,000 memories, so memory costs at most $0.50 a month. Most projects hold a few dozen and pay a fraction of a cent. Archived and superseded memories don't count, so archiving a fact that has stopped being true also takes it off the bill.

What it doesn't do yet

  • Your agent has to write. Axon stores what an agent decides to remember, and it reads neither your Slack nor your pull requests. The Gagarin skill teaches agents when to write. A decision you make in a meeting reaches memory when you tell an agent about it.
  • It needs the MCP server. gg has no memory command yet, and the console has no memory tab. An agent without Gagarin's MCP server goes without memory, and deploys as before.
  • The whole team shares one memory per project. That suits decisions. Keep a personal preference in your own agent's notes.
  • We hold the encryption key. To hold it yourself, run your own instance of axon on Gagarin. The code is open source.

If you run a project on Gagarin, it has a memory. Next time you start on a task, tell your agent what the task is and ask it for a briefing. Before the session ends, ask it to remember why it did what it did.