Bevetés utáni jelentés · 01
Cortex: a knowledge base that has to show its sources
A nightly LLM pipeline that reads AI-engineering news, judges it against my projects, and keeps a database of dated, sourced claims that my coding agents read before they make a decision.
Ez a jelentés egyelőre csak angolul olvasható.
- Szerep
- Sole engineer — design, pipeline, security, operations
- Időszak
- 2026. október – napjainkig
- Állapot
- Éles üzemben · Nyílt forráskód
- Technológiák
- TypeScript · Node.js 26 · SQLite · Claude (Sonnet · Opus) · Python · systemd
- Forrás
- Galicz555/cortex
Situation
I build with AI coding agents every day, and the ground under them moves every week: model releases, breaking SDK changes, security advisories, new prices. An agent answers from training data that is months old, and it states a stale fact with the same confidence as a current one. Before a decision in one of my projects, the agent needed current, checked knowledge, not a web search it has no way to weigh.
Mission
Build a knowledge base the agent reads before it decides. Every claim is dated, sourced and weighed by trust, and the base keeps itself current without me reading it. Two constraints: it runs unattended every night, and the model inside it must never be able to act on what it reads.
Execution
- Collection. One adapter per kind of source: newsletters, papers, lab blogs, changelogs, video transcripts, and the release notes of every dependency in my projects’ manifests. A cheap fetch comes first; transcription and page extraction run only for entries that pass.
- Triage. Sonnet judges each new entry against short profiles of my projects and names the entry’s origin, so corroboration counts independent origins, not repeated mentions.
- Synthesis without authorship. Opus does not write notes. It returns operations — add, corroborate, supersede — and code checks each one: the sources it cites must be this run’s findings, a claim can only be superseded by evidence at least as trusted, and nothing is deleted. Notes are rendered from the database.
- Containment. The model runs with no tools. Web text enters the prompt inside tagged blocks declared as data, the model answers in JSON, and my code writes every file. Any name the model produces passes a slug check before it can reach a path.
- Crash safety. An entry is marked seen only after it has a verdict, and a topic leaves the queue only after its note is written. A crash mid-run loses nothing.
- A feedback loop. Agents working in my projects write short field reports when something behaved differently than expected, and the pipeline treats them as its most trusted source.
What broke
- The kernel killed a nightly run (16 October 2026). After a backlog of several days, the transcription child process kept growing until the out-of-memory killer stopped the whole run. The fix was to transcribe in ten-minute pieces so memory stays flat, with a test that the model only ever receives bounded pieces. The service also got a hard memory cap, so a future regression fails one run instead of the machine.
- Older evidence could overrule newer (fixed 12 November 2026). A claim could be superseded by an older talk or post of equal trust. Now a new claim is dated no later than its newest source, and a claim can only be superseded by one stated on or after it.
- Going public surfaced what a private repository hides. The security review before the public release (16 October 2026) added an address guard against server-side request forgery in page fetching, escaping for data inside prompts, and date validation. It also removed traces of client work. The public repository is a fresh snapshot built by an export script with an allowlist and a scan, never the private history.
Lessons
- Let the model propose and the code decide. Every guarantee in Cortex lives in code that checks the model’s output, not in the prompt.
- Trust needs a direction in time, not only a level. Equal trust is not enough to overrule a claim; the newer statement has to win.
- Cap the memory of anything that runs unattended. A cap turns a machine-wide outage into one failed run that shows up in the morning.
- A public release is its own artifact. Build it, scan it, review it; never push the history it came from.