The Weirwood Network
What it is
A book-grounded researcher for A Song of Ice and Fire. Ask it a question and it answers from a knowledge graph built from the source text, supplemented by the AWOIAF wiki — an incredible, lovingly built and maintained wikipedia for the universe; this graph would not be possible without it. Every answer comes back with citations down to chapter and line, and the interface shows every graph lookup that produced it — not a paraphrase of "the books say," but the actual lookups.
Theories are not integrated into the graph yet, and the answering voice will not allude to or infer any outcome after A Dance with Dragons — though it can infer freely from the text itself. Theory integration is the next stage, gated deliberately rather than left half-done.
The graph
Underneath the chat is a hand-built knowledge graph of the ASOIAF books: roughly 9,000 typed nodes across 21 types — characters (roughly 3,900 of them), locations (roughly 1,100), houses, titles, events, artifacts, factions, species, texts, foods, religions, materials, concepts, theories, customs, medical entries, languages, prophecies. They're joined by roughly 26,700 typed edges: CAUSES, TRIGGERS, MOTIVATES, ENABLES, and more.
Every node and edge carries a confidence tier. Tier 1 is a verbatim book line with a chapter:line citation, checked against the source text itself. Tier 2 is sourced from the wiki. Higher tiers are interpretive, and the graph doesn't blur the boundary — a Tier 1 claim and a Tier 4 claim never read the same way. More than 1,800 nodes carry curated quotes, some 6,500 in all, each extracted verbatim from the chapter it cites.
The graph didn't arrive at that shape by accident. Pass 1 was mechanical extraction over all 344 chapters across all five books; Pass 2 layered in the wiki. Since then the work has moved to "dip-driven" enrichment — targeted, arc-by-arc passes (Robert's Rebellion, the Red Wedding, Blackwater, and two dozen more) that wire events into real causal chains instead of leaving them as flat entity cards. That's why a causal question — why did Robert's Rebellion start? — comes back as an actual CAUSES/TRIGGERS/MOTIVATES chain, not a summary.
How it answers
Ask a question and an agent works the graph with nine typed tools: it resolves names and aliases, reads nodes, walks causal chains, finds the connection between two entities, surveys everything linked to a single node, traces family trees, searches the quote layer, and browses whole categories or curated themes (meals and feasts among them). Ask for a lineage — the Targaryen line from Aegon the Conqueror down to Daenerys — and it renders the whole family tree in one call. You can watch every tool call it makes alongside the answer. It does not guess.
A citation gate backs that up: every chapter cited in an answer is checked against what the tools actually returned that turn. A citation that can't be matched is marked unverified rather than let through quietly. The answering voice itself is a flat, factual researcher's register — it's there to report what the graph says, not to perform a character.
Building it
Two very different processes sit behind this, and it's worth keeping them apart. The graph itself was built offline, through Claude Code running a fleet of subagents across the extraction passes and the enrichment dips — many workers doing mechanical, checkable work against a fixed schema. What runs live, when someone asks a question, is nothing like that: it's a single agent working nine tools in a loop, one turn at a time, with the citation gate as a runtime check on what it's allowed to claim. Conflating the two would misdescribe both — a multi-agent build pipeline produced a graph that a single agent then queries.
Stack
The app is a static front end backed by Netlify Edge Functions (Deno/TypeScript) running a Claude tool-use loop. Production runs Opus 4.8, set through an environment variable that overrides the code's own default; local dev falls back to a cheaper model. The graph bundle, around 13 MB, is generated from the graph at build time and compiled directly into the edge function as JSON module imports, since Deno's edge runtime has no filesystem access at request time. The Anthropic API key lives server-side in the function — the browser never sees it — behind a daily spend cap.
Netlify Edge Functions were the right fit here: their 50ms compute limit is CPU-only and excludes time spent waiting on the Claude API, with a 40-second window to stream a response back. That's what a multi-tool agent turn needs. A standard Node Function's 10s/26s wall-clock budget would strangle the loop before it finished walking the graph.