commonwealth ai

What are we building?

One Rust workspace, four projects, one person so far. svrn is a local assistant that checks its answers against your own sources before you see them. cmnwlth is an optional mesh — machines you trust, pooling knowledge and compute. Under both, a knowledge layer that does more than retrieval. Nothing leaves your network.

Why

Five random chunks and a bluff

After over a decade in software, I quit my job at a startup and wrote a novel. I love Russian literature, so I ended up writing something as long as Anna Karenina. I went as far away from software as possible, but when local AI got interesting, I wanted to play around. I also needed motivation for a fifth revision, so I did everything you were supposed to do: Ollama, OpenWebUI, a RAG pipeline, eight hours of chunking my own book. Then I nervously asked for a summary, the payoff for all the work, the culmination of all the AI hype. It picked five chunks that looked similar, bluffed, then the response cutoff in the middle of a sentence. I think there were some stray Chinese characters. Underwhelming. This project comes from that moment. It's why the knowledge layer builds RAPTOR trees — summaries of summaries, climbing from passages to themes — so "what is this book about" is answered from the shape of the whole, not whichever pieces happened to embed nearby.

Once upon a time, I built music applications for a tens of millions of daily users. That taught me a lot about the importance of the product layer. I couldn't find a satisfying product layer for open weights, one meant to be navigated by humans, so I built what felt right to me. So the stack is opinionated on purpose, and the opinions are the point — they're what lets a zoo of models, Qwen to Gemma to GLM, converge on one behavior. The bet is called the situated agent: don't ask a 27B model to be a genius from a cold start. Assemble what it should already know — who's asking, what the project is, what was decided, what's still open — before the first token, and verify the claims after the last one. Capacity goes to expression, not discovery. The benches exist to keep that bargain honest, model by model.

One question, end to end, at 8x: typed, retrieved from local corpora, streamed with a source tag on every claim — and when the evidence is mixed, it says partly verified instead of pretending.

The shape

Four projects, one-way dependencies

The graph points one way: the knowledge layer doesn't know the assistant exists, the assistant doesn't know the mesh exists, and the eval program gates all three. Each piece stands alone.

corpus-engine

The knowledge layer. Turns raw sources into ranked, cited, enriched search — a library with no ML runtime of its own.

svrn

The assistant. Desktop, CLI, and server on one runtime, with a grounding gate that holds every answer until its claims check out.

cmnwlth

The mesh (crate family commonwealth-*). Symmetric nodes, no master, pooled knowledge and pooled compute by invitation.

the gates

Benches and CI gates that measure honesty, competence, and architectural drift — and fail the build when they slip.

corpus-engine

A recipe is the unit of knowledge

Every corpus — Wikipedia, the Stanford Encyclopedia, US Code, your own email — enters through one pipeline: acquire, extract, filter, chunk, embed, index, declared in a TOML recipe. A bunch already ship in the catalog. I hope people will contribute many more. One directory per corpus.

Search is a funnel, not a lookup. IVF-PQ vector search and BM25 full-text — LanceDB and Tantivy — fuse in a single query; a cross-encoder reranks the overfetched pool; the atom graph can join the blend as a third signal, pulling canonical sources up. Rerank is purely additive by contract: if the model fails, order falls back to fusion. Every score lands in chunk metadata, so a bad ranking is inspectable, not a mystery.

Custody is per-recipe, enforced in separate code paths: query_sharing — may peers search it and get cited snippets; mesh_sharing — may the bytes replicate at all. The philosophy corpus ships queryable, never copied. Structure, not policy.

Enrichment

Not retrieval with extra steps — a typed, provenanced knowledge graph

RAG stops at "here are the passages that look similar." Enrichment keeps going: each document is lifted into typed atoms — eleven kinds, Entity through Claim, Position, Opposition — joined by fifteen edge types with real argumentative structure: what's evidence for what, what an author conceded, which positions oppose. RAPTOR trees summarize upward, so recall works at the level of themes — ask about the whole book, get the whole book.

Every edge carries its provenance. LLM-extracted edges get hedged downstream; deterministic ones don't. Memory trees are extractive only — structurally unable to fabricate — and abstractive summaries persist only after a verifier passes their claims. The trust model is the product.

It pays: on a Wikipedia probe, the atom graph (constructed from structured links) moved sources-found from 50 of 71 to 79 of 83.

svrn

The answer is held until it's checked

Desktop (Tauri 2 + Svelte), CLI, and server drive one Runtime. Simple retrieval on one side, a planner/executor DAG on the other, tools behind permissions.

  • The grounding gate is on by default. Every claim checked against the sealed corpus — verification may widen the evidence, never the scope. Failures get one rewrite fed corrective passages, narrated claim-by-claim to the UI. Still unsupported, it abstains.
  • The model never originates a number. A deterministic Rust audit value-matches every figure against what a tool actually emitted. Not a prompt — a backstop.
  • Retrieval is data. An ordered list of named steps, golden tests pinning the sequence. A reorder is a reviewed change, not drift.
  • Side effects fire once. A content-keyed ledger survives crash and replan; a step that died mid-flight halts and says so rather than guessing.
  • Memory in tiers: working memory recompressed each turn, long-term memories that decay, a summary tree for thematic recall.

Full disclosure: I used the system to build the system. The daemon doubles as a code-intelligence MCP server — a compiler-resolved call graph, 883,000 edges, the kind that catches trait dispatch grep will never see — and the agents that write this codebase query it instead of grepping. You can ask the codebase a plain-English question without naming a single symbol and get the trace back; the same resident daemon ghost-writes completions into VSCode. So the assistant helps build the assistant that indexes its own source to get better at building the assistant. I'm told recursion needs a base case. Working on it.

cmnwlth

Chunks travel. Corpora don't. And models outgrow single machines.

A mesh is founded with a join key and a per-node Ed25519 proof; membership converges by gossip; same code on every node, no master. Routing scores capability claims — an open CC0 protocol we call OICP — and the whole thing speaks the OpenAI API, so existing tools just work. Encrypted mode dials peers by public key over iroh QUIC, fail-closed, relays self-hostable.

The one to try: run a model bigger than any machine you own. Three 64 GB boxes hold what none could alone. The host seeds each worker its slice — no model file on disk — and after first load, kilobytes cross the wire per answer. The split goes by byte mass, not block count: MoE layers vary 62x, and counting blocks overflows the small box. A dry-run planner checks the fit per machine before anything loads. A worker drops, the host reloads on what's left; a flapper gets benched on a cooldown.

8.5 tok/s
122B model split across my two machines. Then split across two cloud containers. Reproducible on whatever you have lying around.

The gates

Measured, not asserted

The real asset isn't any subsystem — it's that correctness is measured adversarially, and the measurements gate the work. The chaos bench scores two red lines separately: competence when the answer exists, honesty when it doesn't — neither a hallucinator nor a blanket-abstainer can game it. A metamorphic bench asks whether a model reasons or pattern-matches, with a blind control and anytime-valid stopping. An agent-coding battery runs the tool loop end to end. One baseline-diffed CI run; regressions fail. This is what makes the model zoo swappable: the gates define the behavior, and any model that clears them inherits it.

The discipline points inward too. The docs gate fails the build on a dead path. Layer gates keep the graph one-way. Ratchets only tighten. Anything shipped dark carries a ledger row naming what would turn it on.

The honest fine print

What doesn't hold yet

Better from me than from your diligence. Tensor-split traffic is raw TCP — no encryption claim while it's in use; perimeter-only, opt-in. The internal mesh API trusts its perimeter in trusted-network mode; encrypted mode narrows that to loopback plus iroh. Tauri can't yet gate commands per-window, so desktop mesh apps aren't isolated from each other. The chaos honesty scores are mid-flight, not victory laps. And deep enrichment costs days on a big corpus — a structural pass lifts fifty thousand articles in under a minute, which is why the roadmap subtracts rather than adds. It's all in the threat model, in more detail than one page should carry.

Built by one person, engineered like a team will inherit it: one-way dependencies, machine-checked docs, gates that can actually fail. If you check claims against source — good. You're in the right place.

AGPLv3 · bring your own model · nothing leaves your network