LoreGraph turns a novel, play, screenplay or libretto into a queryable graph: characters, objects, events, concepts, and the typed relations between them. Every claim carries an evidence_span, a literal substring of the source. Click any relation and you land on the sentence it came from.
Most tools that pull a knowledge graph out of text extract triples and ask you to trust them. For fiction that is fatal. LoreGraph holds one rule instead: every extracted claim carries an evidence_span, a literal substring of the source, and the verification pass rejects any claim whose span is not a 95% literal match.
The engineering was researched against these projects. The corpus comes from public sources.
The engineering was researched against Splink, ComEM and GraphRAG: a literal-evidence gate, entity resolution that works across scripts, per-pass commits with idempotent re-runs, and a client that is not tied to one provider.
The extractor writes an evidence_span as it goes, and the verification pass drops anything under a 95% literal match.
The model is told to forget the Elizabeth Bennet or 孫悟空 it already knows, and to report what this book says.

A force-directed network of characters, objects, events and concepts. Hover an edge to see the source line.

The story's events in reading order. The graph carries story-time on every fact.
Passes 1 and 4 are deterministic. Passes 2, 3, 5, 6 and 8 call a model. Pass 7 is a gate, not a suggestion. Every pass commits on its own, so a failed run resumes with --from N and nothing is written twice.
Deterministic, chapter-aware splitting that reads English headings and 第N回 alike. Each chunk gets a position in global story time.

Typed mentions, entity resolution (lexical plus embedding-kNN blocking, then batched matching), coreference, five typed relations, and the facts they imply.

Chain-of-verification. A claim whose evidence span is not a literal match of the source is dropped here. The gate is 95%.

One Hybrid Note per entity: facts and inferences in separate columns, every inference labelled with a confidence, plus a subtype and an importance tier.

Pride and Prejudice, 西游记, Crime and Punishment, Faust, Les Misérables and eighty more, across eleven languages. Source text stays in its original script; nothing is transliterated.

data/books/ is git-ignored. Only derived data is published: the graph, short fair-use evidence spans, profile notes. Full reading text ships for public-domain works only; works still in copyright are processed locally.

uv sync, then alembic upgrade head against Postgres 16+ with pgvector, then loregraph ingest and loregraph extract. One OpenRouter key is enough. A mid-size novel runs in minutes rather than hours, and a per-book budget ceiling of $20 is enforced between passes.