From building ArcQuill, an AI Dungeon Master for solo and group play. Licence: this article is CC BY 4.0. The ArcQuill app and its code are not covered.
The problem
Many players want to play in a world that already exists: an anime, a light novel, a game, a film series. They want to meet its characters, at a point in its story they choose, and they expect the canon to be right and up to date.
LLMs are bad at this. A model knows the famous parts of a series and little of the rest, and it sounds equally sure about both. Where it does not know, it fills the gap: it invents a plausible father, gives a character a title from three volumes later, or predicts how a story goes on. It has never read anything released after its training, but it answers about those stories anyway. Fans notice every one of these.
I gave the DM two tools, a web search and a page reader, and measured what they changed. The numbers come from one model, DeepSeek V4.1 Flash, run through my own game code. The design, the rule text and the test method are the parts you can reuse.
Key findings
- With lookup, the DM got more facts right: 49% to 74% on known settings, 18% to 59% on stories newer than the model.
- When it stated a fact, it was right 86% of the time with lookup and 54% without. Without lookup on the newer stories, it stated more wrong facts than right ones.
- The model does not know when it needs to search. It searched when the player asked out of character, and mostly answered from memory inside the scene, even with a rule telling it to search there.
- Wiki pages describe the whole story at once. Lookup brought in facts from later in the story, and the DM saved them as true now.
- An empty search turned into a false denial: "that never happened" instead of "I don't know".
- It cost about 2 to 2.7 times as much per campaign, most of it during world building.
What it bought
I ran 48 campaigns: eight settings, each three times with lookup and three times without. Every game got the same messages and the same seven turns of play. Before reading any game, I wrote 32 to 36 facts per setting, each with a quote from the fan wiki, and marked every game on every fact.
| Settings | Facts right, without lookup | With lookup |
|---|---|---|
| Five known settings (Harry Potter, Star Wars, Tensura, Frieren, Bookworm) | 49% | 74% |
| Three settings newer than the model (One Piece Elbaph, Silksong, Jujutsu Kaisen Modulo) | 18% | 59% |
When the DM stated a fact, it was right 86% of the time with lookup and 54% without.
Asked with no tools, the model put its own knowledge cutoff at about mid-2024 and said it could not summarise the Elbaph arc of One Piece. On the three newer settings, without lookup, it did not say it did not know. It filled the gaps: 74 wrong facts against 57 right ones. With lookup: 191 right, 36 wrong.
Per setting:
| Setting | Without lookup | With lookup |
|---|---|---|
| Frieren, manga ch. 104 | 35% | 84% |
| Ascendance of a Bookworm, Part 5 | 49% | 75% |
| Star Wars, 3 ABY | 62% | 74% |
| Hollow Knight: Silksong, Act 2 | 25% | 72% |
| Harry Potter, August 1996 | 54% | 69% |
| Tensura, after anime season 3 | 47% | 68% |
| One Piece, ch. 1135 | 20% | 53% |
| Jujutsu Kaisen Modulo, ch. 13 | 7% | 52% |
Some answers from the games, without and with lookup:
| Question | Without lookup | With lookup |
|---|---|---|
| Who brought Prince Loki down? (One Piece) | "Loki walked down there himself." | "it took an Emperor to put him down and carry him home" |
| Who rules the Citadel? (Silksong) | "Who rules? The Choir rules. Same as before." | "Their mantle of rule was granted by the Weavers." |
| Who did Japan name as champion? (Modulo) | "It's the Zenin girl." | "Japan named Yuka Okkotsu as its champion, standing for all of Earth, and she accepted." |
| Who raised the Great Barrier? (Frieren) | "Great Barrier over the Golden Land was raised by Macht of El Dorado, its demon lord; it broke when Macht died" | "raised by Lernen and the first-class mages of the Continental Magic Association to seal Macht" |
| Who is High Priest? (Bookworm) | "the High Priest's seat stands vacant" | "The High Priest is Lord Hartmut now." |
The lookup answer is the canon one in every row.
Lookup also helps when the player gets canon wrong. In Modulo, the player said the envoy Dabura Karaba is a Rumelian. He speaks for the Rumelians, but he comes from the Deskunte tribe. All three games without lookup agreed. All three lookup games corrected it in the scene: "Karaba's not Rumelian. He's Deskunte". In Harry Potter, the player said Stan Shunpike was arrested last week. His arrest does not happen until mid-September. One lookup game answered in character: "Stan Shunpike, now, that's a different thing and it's wrong... Ask me again in three weeks."
How it works
Two tools, offered only when the game's lookup switch is on:
web_search(query, objective)returns the top five results with title, URL and the passages that match. The model writes an objective next to the query: what should rank first and which facts to pull.read_page(url, question?, offset?)reads a page. With a question, it returns only the passages that answer it. Without one, it returns the text in 12,000-character parts, plus the page's links on the same site.
The rules, added to the system prompt only when lookup is on. This is the exact text:
Web lookups, published settings only:
- Canon the world document lacks and you are unsure of: web_search, series plus subject. E.g. "Forgotten Realms Elminster Mystra relationship".
- A search finds pages; read_page answers. Read the best result before you answer.
- One fact: read_page with a question. E.g. question "Who are Elminster's children?"
- Events, order, who did what: read the wiki page and follow its links. E.g. a character page, then its History link.
- Never search what the world document holds or what this world invented. The document outranks the web.
- Save what the world now relies on to the document, so no later turn searches again.
- Per turn: 5 searches, 6 page reads.
The DM also gets this line during play:
- Canon a player raises in the scene, in character too: look it up before an NPC confirms or denies it, then answer in character. E.g. "Is it true the Lady of Pain never speaks?"
And this one during world building:
- Before saving a canon character the player named, search their kinship, rank and title. E.g. "Planescape Factol Skall title faction".
Every campaign in my tests named an exact point in its story during world building: a chapter, a volume, an act or a date, and which canon counts. The DM needs this to tell that a title earned later is not true yet.
Limits per turn: 5 searches, 6 page reads, 40 seconds, and 80,000 characters of web text. A search that would not fit the character budget is refused before it is sent, so the turn never pays for results it would throw away. A lookup that fails tells the model to continue without it. It never fails the turn.
Safety, because a web page is text written by someone else:
- The server never fetches a URL the model chose. A search provider, Exa, runs the searches and fetches the pages. The game server only talks to that one host, so a model-chosen URL can never reach an internal address.
- The reader only opens known URLs: one from this game's search results, a link listed on a page it read, or a URL a player typed. This stops one attack: a planted page telling the model to put game data into a URL it builds. It does not stop a planted page from feeding the model false text; the reference label and the world document's priority reduce that, and do not remove it.
- Web text arrives labelled as reference, not instructions, and the world document outranks it.
- The switch is off by default and tells players their searches go to an outside service.
What failed first
My first version ran in October on Tensura. It helped less than it should have, and the failures shaped the rules above.
- Snippets only. The DM searched, read the search passages, and never opened a page. It got the order of events wrong and described past events as still to come. The fix was the rule "a search finds pages; reading answers", plus "read the page and follow its links" for events. Lookup games now read 1 to 18 pages each, and page text is a large part of the cost.
- Small page parts. Each call sends the whole context again. Reading a long wiki page in small parts cost one call, and the full context, per part. I raised the part size to 12,000 characters.
- Writing canon from memory during world building. The world-building step wrote family ties and titles without searching, and the DM later repeated them as fact. A character's brother, a dragon's sister and a great-granddaughter were all wrong. The fix was the rule to search kinship, rank and title before saving a canon character.
- Searching the world's own inventions. One search went on a place the DM had made up. The fix was "never search what this world invented".
- A rule that did not work. I added "look up canon the player raises in the scene, in character too". In the November run, the DM still searched almost only on out-of-character questions. The rule alone did not change it.
Where it still fails
- No search during the scene. Most remaining errors come from turns where the DM answered from memory. Two games agreed with a player's false claim although their own world notes had the right answer. In Silksong, the games without lookup corrected both of the player's false claims in all three games. The lookup games corrected half of them, because they did not search there.
- Later facts saved as current. Wiki pages describe the whole series at once. Two Harry Potter lookup games said Ollivander is a prisoner at Malfoy Manor, which the books only reveal a book later. In Tensura, lookup games gave characters titles they earn several volumes later. A found fact needs a check against the campaign's starting point before it is saved.
- The wrong continuity. Star Wars has two canons. Asked who runs Cloud City, all three lookup games found a page from the old Legends continuity and gave that officer as canon. The answer is Captain Tanch, a minor comics character. No game found him.
- A search that finds nothing. In one Modulo game, the DM searched twice, found nothing, and told the player a real canon event was "her own invention". An empty search should lead to "I don't know", never to a denial.
What it costs
My own cost in US dollars, model calls plus search and page fees, averaged over the games. DeepSeek V4.1 Flash is a cheap model, so scale the model part to yours.
| Per campaign | Without lookup | With lookup |
|---|---|---|
| Known settings | $0.13 | $0.29 (2.1 times) |
| Newer settings | $0.11 | $0.30 (2.7 times) |
A campaign here is three world-building messages, an opening and seven turns. Search and page fees were about $0.10 per campaign, half to two thirds of the extra. The rest is longer model calls, because page text stays in the context for every later call in the turn.
Most of the extra comes during world building, where the DM checks the canon characters it saves: $0.17 against $0.07 on known settings. A turn of play cost 1.6 cents with lookup against 0.9 cents without.
The cost depends on your limits and on the rules. My October version read no pages, and it was less accurate. Change the rules, then measure the cost again.
How to measure it in your game
- Pick settings across the range, from very famous to obscure, including at least one released after your model's training. Ask the model with no tools what it knows about each; that shows which ones it does not know.
- Fix each campaign to an exact point in the story: a chapter, a volume, an act, a date. Name which canon counts. A fact true three volumes later is wrong at that point, and you want to count that separately.
- Write the facts first. 30 or more per setting, each with a quote from the wiki, before you read any game. About a third should be timeline traps.
- Script the turns. Ask what a fan would ask: who holds an office now, who is related to whom, what has happened and what has not yet. Include one out-of-character question, and one turn where the player states something false in the scene.
- Run the same script with lookup and without, at least three times each, through your production code.
- Mark every game on every fact: right, wrong, wrong for this point in the story, or never stated. Quote the game for each mark, and check the quotes by script.
- For each error, check whether the model searched at that turn. That one question tells you whether to fix the rules or the search.
Checklist
- The server never fetches a URL the model chose
- The reader only opens URLs from search results, page links or the player
- Web text is labelled as reference, and the world document outranks it
- Per-turn limits on searches, reads, time and characters
- A failed lookup continues the turn without it
- Each campaign is fixed to an exact point in the story
- The model reads pages, not only search passages
- Canon characters are checked before they are saved to the world
- What the world relies on is saved, so it is not searched again
- Lookup is off by default and never searches the world's own inventions
- Cost and accuracy are measured after every rule change
Limits
- One model, DeepSeek V4.1 Flash. A stronger model may know more and need less lookup.
- The scripted turns ask fan questions on almost every turn. Real play touches canon less often, so expect a smaller gain, and a smaller cost, in real games.
- Three games per side per setting. Single games vary, so read per-setting numbers as a direction, not exact values.
- AI graders did the marking, one per setting, from saved wiki pages. A script checked every quote word for word, and I checked samples by hand.
- The graders could see which games had lookup. The facts were fixed in advance and every mark needs a quote from the game, which limits that bias but does not remove it.
- Fan wikis describe characters as they are at the end of the story. The graders used timeline pages to judge what was true at each starting point.
- Seven scripted turns per game. Long play is untested.