Every company has knowledge that lives only in people’s heads: why the team picked this design over the obvious one, what was tried first and failed, which constraint shaped the schema. A new engineer needs months to absorb it, every new task starts with asking around, and when someone leaves, part of it leaves with them.
Our CEO’s idea was one knowledge base for the whole company, one that anyone, from engineers to sales, could ask about how the company works and get an answer. It would start with the code, the decisions behind it, and what Jira and Confluence already hold, and later grow to Slack, meeting transcripts and whatever else the company writes down.
He built the seed: he had Claude Code read the monorepo, its git history, PRs and tickets, and write the first version of Atlas: “a structured map of subsystems, decisions, and abstractions that a new engineer could use to onboard without bugging anyone.” A colleague picked it up and started building a curator, an agent that takes notes from engineers and folds them into Atlas. Then other priorities took over, as they do in a small company, and the project went quiet.
A few months later I revived Atlas, starting where the idea started: the code and the decisions behind it. This is how I built it: what goes into Atlas, how it’s built from the repo, the loops that keep it current, and how I tuned the curator prompt with a test harness.
What goes into Atlas
The seed showed what an LLM does well and where it needs help. Reading history, it writes a convincing design narrative, and where the history is thin, it fills the gap with a story that sounds right. So I split Atlas by where each kind of fact comes from:
- Structure comes from the code: services, topics, API contracts, deployments, and the typed connections between them (this service calls that one, publishes to that topic). Scripts derive it, so nobody has to guess.
- The why comes from people: decisions, rejected alternatives, constraints, gotchas. It enters through an inbox and a curator, and a person approves every change.
Each concept is a markdown page in the Open Knowledge Format (OKF), with its connections in the frontmatter. Decisions get their own type, shaped as Architecture Decision Records, the format Michael Nygard proposed: context, decision, consequences. They’re append-only. A reversal is a new decision that supersedes the old one, so the reasoning behind the old choice stays readable.
Building it from the repo
The build has one rule: “No LLM invents a concept.” A script reads what the repo already declares (service configs, build files, topic and schema definitions, API specs, deployment manifests, CI workflows) and writes a manifest of concepts and connections. Every connection carries its proof as path:line@commit, so anyone, human or agent, can check it.
The first full build came out at 487 concepts of 15 types and 1,397 connections. To trust the connections, a second model family tried to refute a sample of them, since the model that writes a claim shouldn’t be the one that verifies it. The worst connection type started at 40% wrong, and after two rewrites of its rules, the sample came back clean.
The map says what exists and what connects to what. It doesn’t explain what a service does, and that part needs an LLM. Each concept page has fixed sections for its type (a service gets what it does, how it works, data and events, and so on), and every factual sentence carries a footnote to a file and a line. A script writes the pages that only summarize one config file, like an event schema or a CI workflow. A model writes the rest by reading the code at the manifest’s commit, and a model from another vendor tries to refute a sample of the sentences before a type is accepted.
The loops around it
A knowledge base helps only if it’s read at the moment of work and fed at the end of it. Three loops do that:
flowchart LR
task["Task"] --> search["Search Atlas<br>with QMD"]
search --> work["Plan, code, PR"]
work --> note["Propose a note<br>to the inbox"]
note --> curator["Curator<br>checks the code"]
curator --> person["Person<br>approves"]
person --> atlas[("Atlas")]
atlas --> search
weekly["Weekly catch-up<br>from code changes"] --> atlasRead before the task, contribute after
Two Claude Code skills live in the repo. The search skill runs QMD, a local hybrid search engine for markdown (keyword plus vector), over Atlas in a read-only agent and returns the relevant concepts and decisions. Our automated ticket workflow calls it before it plans a change, so the planning agents start from what the team already decided.
At the end of the task, the contribute skill reviews the session for what the code can’t show: why we chose B over A, what we tried and why it failed, a constraint that shaped the design. How a module works or how a bug was fixed stays out, since the code and git log already hold that.
It shows only the candidates that pass and asks which ones to capture. If nothing qualifies, it says so, because “an empty inbox is better than noise.” Each chosen insight becomes a note in the inbox, and the engineer reviews and commits it like any other change. A hook offers the same after anyone opens a PR.
It pays off in small ways. A bug report once said a feature was broken on one plan. A note in Atlas said that plan leaves the feature out on purpose, and the ticket closed as not a bug.
The curator drains the inbox
The curator takes one note at a time. A LangChain.js agent gets seven read-only tools (read a file, list a directory, git grep, log, show, blame, view a PR), pinned to one commit, with no shell and no writes. Its prompt opens with its stance: “Your first duty is not to believe the note.” It checks the note against the code and answers with a verdict (fold it in, ask, park or reject) plus the claims behind it, each citing a path, a line and a commit.
Code then does everything code can do. It validates the answer’s schema, checks that every target exists in the manifest, and checks that every cited line exists at that commit. A failed check gets one retry with the errors. Nothing lands without a person: approval is tied to the proposal’s hash, and “A changed proposal is not approved.” An approved decision becomes an ADR page with no further model call.
The weekly catch-up from code
The manifest records the commit it was built from, and once a week a GitHub Action moves it forward. Scripts read the git diff, predict which concepts and connections can change, rebuild the map, and compare. If something changed that no changed file explains, the run stops and leaves Atlas where it was. Spotting a new service or a new client call is pattern matching, so this step needs no model.
Every written page also records the commit of the files it cites, so after the move a check lists the pages whose code changed since they were written. Those pages go back to the model for a rewrite, with the same footnotes and the same refute check.
Tuning the curator with a harness
I started from my colleague’s curator prompt. Before changing a word of it, I built a lab: it runs a prompt version over a set of real inbox notes, and a separate LLM grades every output against a six-part rubric worth 12 points. I graded the same outputs myself, to see where the grader and I disagreed.
The first run averaged 10.8 out of 12, and not one proposed edit landed. My first guess was that the prompt was too cautious. It was wrong: the only edit the curator proposed didn’t apply to the file, and the grader had scored it 11 without trying it. The fault was in the harness.
That pattern kept coming back. The lab caught runs reading earlier runs’ results, a rubric that gave full marks for doing nothing, and a held-out set so easy that it only tested saying yes. The last lesson came from an overshoot: one prompt change flipped 7 of 10 held-out verdicts to reject, and the mean score barely moved. Since then I read the verdicts as well as the scores, and the harness and the prompt share a version number, because they changed together.
Fewer decisions for the model
Looking back, every part that worked moved a decision out of the model and into code: the manifest, the citation checks, the stop rule, the approval hash. Ten LLM decision points that each fail 10% of the time send more than half the runs sideways, even when nothing is broken. The curator now makes one judgment per note, and a person signs it.
