Skip to content
Nelson D’SouzaEmail me

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

Redrawn from the manual, the lint store and the council’s verdict format
A long room lined on the right with floor-to-ceiling walls of small index-card drawers; women in high-collared blouses sit at desks with typewriters and stacks of cards while others stand by the drawers
Its ancestor: Répertoire Bibliographique Universel, Brussels, c. 1900. Paul Otlet, Mundaneum, Public domain

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

One source into the wikiArchitecture diagram with 8 nodes, 8 connections. Each step is listed as text below.Web, X, YouTube,PDFs, arXivExtract and sanitiseIngest jobAgent with gatedtoolsWiki: markdown +SQLite FTS5Contradiction findingCouncil of up tothree providersSvelteKit app · CLI· MCP serverwrapped as untrustedlock, budget, manifesttyped edits, checkedagainst the taska contested pagewhen I send itrecommendationpeople and otheragents
  1. Web, X, YouTube, PDFs, arXiv to Extract and sanitise
  2. Extract and sanitise to Ingest job: “wrapped as untrusted”
  3. Ingest job to Agent with gated tools: “lock, budget, manifest”
  4. Agent with gated tools to Wiki: markdown + SQLite FTS5: “typed edits, checked against the task”
  5. Wiki: markdown + SQLite FTS5 to Contradiction finding: “a contested page”
  6. Contradiction finding to Council of up to three providers: “when I send it”
  7. Council of up to three providers to Contradiction finding: “recommendation”
  8. Wiki: markdown + SQLite FTS5 to SvelteKit app · CLI · MCP server: “people and other agents”
One source into the wiki Fetched content is wrapped as untrusted before the agent reads it. A contradiction leaves the page contested, and the council’s recommendation goes onto the dashboard finding, where the conflict stays open until I resolve it.

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

Built with

  • TypeScript
  • SvelteKit
  • SQLite
  • MCP
  • OpenAI
  • Anthropic
  • Gemini