It's a super-smart librarian for a made-up fantasy world β one who read every book, remembers exactly when each thing happened, and will only answer a question by pointing at the page it came from.
You're writing a D&D-style world. You've got hundreds of notes β who's whose kid, when a kingdom fell, who was king in year 340. An AI wants to answer questions about your world ("Did House Vyr rule the Crimson Throne in the Second Age?"). The problem: AI is a confident liar. It'll happily make up a king who never existed.
The Lore Engine sits between your notes and the AI. The AI asks the engine; the engine looks up the real answer with a real time-stamp and a real citation; the AI is not allowed to answer from its own imagination.
"Did Aldric found House Vyr?"
"Yes, Aldric founded House Vyr in 200 TA."
β¦he didn't. The AI guessed. You'll never know it guessed.
"Did Aldric found House Vyr?"
"No β House Vyr was founded by Theron in 200 TA (chronicles-vyr.md). Aldric was his son, born 280 TA."
Cited. Time-checked. True.
Every claim the engine returns is tagged with the document it came from. So the AI can say "according to the chronicles of House Vyr..." β or know to distrust a single shaky source.
Markdown files + YAML β character bios, timelines, family trees, maps. The raw truth of your world, written by you.
The open-source engine underneath. It reads your notes, chops them up, and files them away. We don't build storage β we borrow Cognee's.
A database that stores facts as a web (a "graph"). "Aldric βson ofβ Theron βruledβ House Vyr." Following the threads is what makes reasoning possible.
The AI model that reads your prose and pulls facts out of it ("Aldric was born in 280 TA" β a structured fact). Also the brain that answers when you ask a question.
The Lore Engine's own toolbox the AI can pick from: was_true_at, who_is, list_lineage... each does one little job, like a single drawer in a workbench.
A night-watchman that scans for impossible things: a guy at a battle 200 years before he was born, a kingdom in two places at once. It flags β it never deletes.
You ask a question. Here's the trip it takes:
People change. Kingdoms fall. "Who rules Valdorn?" has a different answer in year 100 vs year 500. A normal database would give you one answer and quietly be wrong for every other year.
Every fact in the Lore Engine has a time window β a "valid from" and "valid until." Asking "was this true at time T?" is the engine's signature move.
ELI5: every fact is like a job with a start date and an end date. "Who's the boss?" only makes sense if you also say when.
Two sources, same fact, different stories. Book A says Aldric's father is Theron. Book B says it's Maric. What now?
The engine does not pick a winner. It keeps both, marks them as disputed, and tells the AI: "sources disagree on this β here are both, you decide how to present it."
And every fact has a confidence score β two numbers, actually. One for "did we extract this right?" and one for "how much do we trust the book it came from?" A rumor scores low; an official chronicle scores high. The engine uses the lower of the two, so one weak link drags the whole fact down. Honest by default.
Two doors into the engine:
| Door | What goes in | Who does the work |
|---|---|---|
| π Structured YAML | Timelines, family trees, maps β neat typed files | Filed directly. Fast, exact, no AI needed. |
| π Prose markdown | Your story chapters, dialogue, descriptions | The AI reads it and pulls facts out ("Aldric, born 280 TA, son of Theron"). |
ELI5: the YAML door is you handing the librarian a neat index card. The prose door is you handing the librarian a novel and letting it write its own index cards. Both end up in the same web of facts.
Crucially: the AI never writes to the world. Only you do. The AI reads, asks, and answers β it does not get to change the canon. That's the world-builder's job, always.
Even good books contain mistakes. The Consistency Engine is a night-watchman that roams the web of facts and flags things that are impossible:
The golden rule: the engine flags, it never deletes. When you "retcon" (retroactively fix) a fact, the old version is kept and marked "superseded," not erased. So you can still ask "what was true before the retcon?" History is preserved, even when it changes.
A wiki is a pile of pages. The Lore Engine is a thinking model of your world β one an AI can actually interrogate, trust, and cite.