Personal knowledge compiler
Alfred
An agent that compiles what I read into a cross-linked wiki, so each new source improves the pages already there and a question starts from them.
what it does
New sources update existing pages
A source is compiled into cross-linked pages once, and questions read the pages.
Contradictions stay open on the page
Both sides stay cited until I resolve them; a council of models can advise.
The web is treated as hostile
Fetched content is untrusted, and every write is checked against the task given.
A web app, a CLI and an MCP server
One core behind all three, so other agents can query the wiki too.
two sources disagree
source Atrust tier raw_pdf
source Btrust tier raw_x
contradicts ↓
confidence: contested related: contradicts: [source-b]
contradictionPage has contested confidence — needs resolution
The council’s verdict, stored on the findingCouncil split (no consensus): openai: … | anthropic: … | gemini: …
both sides stay cited until I resolve it

The problem
Retrieval over raw documents starts from zero each time. It never notices that two sources disagree, and what it learns from one question is gone by the next. I wanted knowledge that accumulates: pages that get better as more sources arrive, with conflicts flagged rather than averaged away.
How it fits together
- Web, X, YouTube, PDFs, arXiv to Extract and sanitise
- Extract and sanitise to Ingest job: “wrapped as untrusted”
- Ingest job to Agent with gated tools: “lock, budget, manifest”
- Agent with gated tools to Wiki: markdown + SQLite FTS5: “typed edits, checked against the task”
- Wiki: markdown + SQLite FTS5 to Contradiction finding: “a contested page”
- Contradiction finding to Council of up to three providers: “when I send it”
- Council of up to three providers to Contradiction finding: “recommendation”
- Wiki: markdown + SQLite FTS5 to SvelteKit app · CLI · MCP server: “people and other agents”
What I built
Sources arrive from the web, X, YouTube, PDFs and arXiv, and go through a durable ingest pipeline: a lock row so two jobs cannot write the same page, async media jobs, a token budget, a manifest, and a completeness audit before a source counts as done. The agent then edits wiki pages through typed tools, which keeps every change reviewable.
Everything fetched from the web is treated as hostile. Content is sanitised and wrapped as untrusted, file paths are confined, and every write the agent attempts is checked against the task it was actually given, so an article cannot talk the agent into editing something else.
When a new source contradicts the wiki, the agent marks the page contested and writes both perspectives with their citations. A lint pass turns each contested page into a finding on the dashboard, and from there I can send it to a council of models from up to three providers: independent analysis, a round where each critiques the others, then final positions. Three providers cost more than one but are less likely to share a blind spot. The verdict is a confidence-scored recommendation, or each model’s position side by side when they split, and it is stored on the finding without touching the page, so the conflict stays open until I resolve it.
Pages are markdown backed by SQLite, with an FTS5 index, trust tiers on sources and optional semantic search. One core is exposed three ways: a SvelteKit app, a CLI and an MCP server, so other agents can query the wiki too.
The knowledge dashboard was slow because one load pulled 90 MB. Every lifecycle bundle carried hundreds of thousands of unread events, the map preview downloaded the whole graph to show three counts, and three panels each asked the server for the same health report. I dropped the unread field from the inbox, gave the preview a summary query, and made the panels share one health request, which now classifies each link target once.
Deploys are immutable releases. Each is built into a sealed directory, rehearsed against a copy of the live data, and preceded by a backup; one pinned Node version builds, tests and runs it, and a failed sign-in check after the switch rolls it back.
How it turned out
A working knowledge base, with several hundred pages compiled from my own reading and the places where my sources disagree marked contested on the page.
- 29.9 s → 1.0 s
- for the knowledge dashboard to have all its data after sign-in, median of five runs on production data.
Written about it
- Done means used: wiring agent-built code end to endHow I keep an agent-built system wired end to end: done means integrated and used, a scoreboard whose bar only rises, and a review of what really runs.11 min read
- Defend where data changes roleI review my agents for security where data changes role. Reviews found a NaN that became LIMIT NULL and a swapped path check. Boundary-specific checks held where tested—four layers for SQL, with other boundaries still needing attack suites.12 min read
- Gates that must be able to failA gate is only as good as its evidence. Five in my coding loop read a proxy, two of them one the loop wrote itself. Breaking the work on purpose shows which.15 min read
Built with
- TypeScript
- SvelteKit
- SQLite
- MCP
- OpenAI
- Anthropic
- Gemini