The company brain

2026-07-26 · #tools #agents

Every project accumulates knowledge that outlives any single conversation about it: why the schema has four mirrors, which model breaks under which flag, what the last redesign rejected and why. Melchizedek now files that knowledge as a bundle: sixty markdown documents whose links form a graph, built by scripts, written into prose by a model, tended by agents, and shipped in the public repo where you can read every page. Below are the format, the tending, and the pieces you need to keep a bundle of your own.

Start with one document and hold onto it, because everything below happens to it. The bundle’s schema page, /memory/schema.md, opens like this (abridged — the real file carries three more fields):

---
type: schema
title: Memory & telemetry schema
description: The canonical Supabase DDL: memory facts with pgvector search…
sources:
  - resource: db/memory_v2.sql
generated:
  by: process:wiki-build
  at: 2026-07-26
---

One rule makes the whole file legible to a stranger: type is the only key a document must carry. Everything else is optional structure a consumer may use and must never require. Below the frontmatter sits ordinary markdown, and its links are ordinary links written against the bundle root: [memory architecture](/memory/architecture.md). That is the entire data model. A directory of files like this one is a knowledge graph: documents are the nodes, links are the edges, and orphans and dead ends fall out as queries instead of requiring a database. The convention has a name, the Open Knowledge Format, which formalized the wiki pattern Karpathy sketched, and you have now seen all of it: markdown, frontmatter, links. Two filenames are reserved and machine-maintained: each directory’s index.md, a table of contents an agent can walk without opening everything, and one log.md recording every change, newest first.

Who wrote the page you are holding? The frontmatter answers precisely. generated.by: process:wiki-build names a script; a model that fills prose signs as melchizedek/gemini-3.6-flash; a human signs human:jimmy. A separate verified list records who checked the content, and one prefix decides the trust tier: a document verified by any human: actor is human-reviewed, anything else is at best machine-confirmed. This is the same provenance discipline the Lyceum applies to its own bylines, applied per document, and it makes an honest confession the default — most of the melchizedek bundle is machine-written and says so on every page.

Why trust a generated page at all? Because the schema page cannot drift from the schema. Its DDL section sits between markers that name their source, db/memory_v2.sql, and a build script rewrites everything between the markers from that file on every run. Prose lives outside the markers, and the build never touches it; a model wrote each page’s narrative once, into a marked slot, and rebuilds preserve it. Run the build twice and the second run reports nothing changed — the same idempotence you would demand of a database migration, demanded of documentation. The page How agents remember teaches the memory system this specimen describes; the specimen is that lesson’s load-bearing facts, pinned to their source.

the three verbs

A brain earns its keep when it is used, and the bundle serves agents three ways, each a plain tool call.

Dive answers “I have a task — what do I read?” Give it add a new provider adapter and it returns an ordered reading plan: the root index first, then the directory indexes that orient you, then the pages that matched, then the pages those link to, trimmed to a word budget and annotated with why each stop is on the path. No model is involved; the plan is computed from the graph, so it costs nothing and never varies. Our specimen shows up on memory-related dives precisely because other pages link it — in a tended graph, proximity is relevance.

Query puts a librarian agent on top of dive’s primitives: it maps, searches, reads, and answers with the bundle paths it drew on. Watch the real thing, in a live run compressed for length:

┌─ trace: asking the company brain (from a real run, compressed) ─ interactive

Garden is the verb that keeps the brain alive, and it works because writing is gated:

garden: one write, one gate
instruction
”record the decision we made today”
facts supplied by you
lint clean?
REJECTED
every error listed — fix and save again
saved
directory index refreshed · log.md appended
The save gate. The diagram hides the reading the gardener does before drafting, and the advisories a clean save still carries — warnings inform; only errors block.

The gate checks what a tired human skips: frontmatter that parses and carries its type, links that stay inside the bundle, no wikilink syntax, no public page linking into the private annex. Errors reject the draft with line numbers; the agent fixes and resubmits. On success the bookkeeping is automatic — the directory index regenerates, the log gains its entry, the author’s actor id lands in the provenance. Karpathy’s observation, which this whole design leans on: the tedious part of a knowledge base was never the reading or the thinking, it was the bookkeeping. Give the bookkeeping to code and the gardening that remains is only judgment.

what stays home

One subtree, /private/, never leaves the private repo. The rule is enforced where it is cheapest, at write time: the linter rejects any public page that links into /private/ or mentions a name from the private vocabulary, so every link in the published bundle resolves inside the bundle before the export ever runs. Grade the instrument honestly, though: that vocabulary is an enumerated list, so it catches the names someone thought to list and would wave through a secret nobody did. The export’s independent secret scan and a human reading the diff remain the layers behind it; the fence narrows the channel, it does not close it.

To keep a brain of your own, take the working parts. The bundle tooling ships in the public repo. npm run wiki:init scaffolds a fresh conformant bundle anywhere, npm run wiki:check is the health gate, and npm run mcp:wiki serves all ten tools over MCP, which means your coding agent can dive, query, and garden your bundle the same way (module 2.06 teaches the protocol itself). The resident staff is a three-agent syndicate: an orchestrator that only delegates, a seeker that only reads, an illuminator that writes through the gate. Download the syndicate YAML and run npm run syndicate:scriptorium against your own bundle. Read one generated page with its markers visible, then plant one page of your own through the gate. The gate will reject your first draft; that is the system working.