Grounding an LLM in Wikipedia: we tested DeepSeek, Gemma 4 and gpt-oss on 45 questions

Updated 2026-11-27 · 8 min read

Wikipedia's own search makes AI models no better at rare facts. WikiVectors makes them nearly 3 times better.

What did we test?

45 questions in three groups of 15, each with a known right answer:

Each question was asked three ways, with the same model and the same short prompt ("answer in as few words as possible; if you are not sure, say I don't know"):

Models, all through OpenRouter: DeepSeek V4.1 Flash, Google Gemma 4 31B, and OpenAI's gpt-oss-20b and gpt-oss-120b. We ran it on 26 November 2026, then ran the WikiVectors column again on 27 November after we added a reranker to our search (more on that below). The code and every answer are below.

Which way found the most rare facts?

Right answers out of 15 rare-fact questions:

ModelAloneWikipedia searchWikiVectors
DeepSeek V4.1 Flash6312
Gemma 4 31B3412
gpt-oss-20b3412
gpt-oss-120b5412

Grounding with Wikipedia's own search did no better than no grounding at all on rare facts. The model was fine; the search was the problem. Look at what each one handed the model:

Rare-fact questionsWikipedia searchWikiVectors
Answer was in the text sent to the model5 of 1513 of 15
Search returned nothing at all4 of 150 of 15
Text sent to the model, average6,500 characters2,500 characters
Median time, search + answer1.5 s0.8 s

Why does Wikipedia's search miss them?

Wikipedia's search is a keyword search built for people typing a few words. Give it a whole question and it looks for pages with all of those words. Small pages rarely have them all. "With which logician did Francisco Dória prove that chaos theory is undecidable?" got zero results. "In which German town was computer scientist Kristian Kersting born?" returned a list of Nobel Prize nominees.

WikiVectors searches paragraphs by meaning, and it gives a page a boost when the question names it. Both questions got the right page first: Francisco Dória and Kristian Kersting.

You could rewrite each question into keywords first, with another model call. That adds time and cost, and the rewrite can drop the one rare name that mattered.

Does grounding stop made-up answers?

Mostly, yes. These are wrong answers on the 15 rare facts, not counting "I don't know":

ModelAloneWikipedia searchWikiVectors
DeepSeek V4.1 Flash000
Gemma 4 31B830
gpt-oss-20b620
gpt-oss-120b721

Real answers from that run, for the same questions:

QuestionAloneWikiVectors
Arnold F. Riedhammer is principal percussionist of which orchestra?Berlin Philharmonic (gpt-oss-120b)Munich Philharmonic
Tewa author Gregory Cajete is from which pueblo?Jemez Pueblo (gpt-oss-120b)Santa Clara Pueblo
The plant genus Leucocroton is endemic to which country?Madagascar (Gemma 4)Cuba
Who was the first Portuguese tennis player to reach the ATP top 100?João Cunha e Silva (gpt-oss-120b)Nuno Marques

DeepSeek alone made nothing up: it said "I don't know" 9 times. Grounded, it answered 12. So grounding helps careful models too: it turns "I don't know" into a right answer.

What about news from this year?

No model knew any of the 15 events from 2026. Every one said "I don't know" (gpt-oss-20b guessed wrong twice). Grounded:

ModelAloneWikipedia searchWikiVectors
DeepSeek V4.1 Flash01515
Gemma 4 31B01515
gpt-oss-20b01415
gpt-oss-120b01515

Here Wikipedia's search did well too: big news events have big pages that match any wording. Both got the answer to the model nearly every time, but WikiVectors sent 2,600 characters instead of 11,900, about 5 times fewer tokens. On common facts the models alone already knew 14 or 15 of 15, so grounding added little there.

In the first run on 26 November, WikiVectors missed 2 of these (the Tour de France and the UK Prime Minister): the right paragraph was in our top 40 but not our top 5. So we added a reranker, a second model that reads the best 40 paragraphs and puts the ones that answer the question first. With it, every model got all 15. More on models and this year's news in LLM knowledge cutoff: why your AI doesn't know 2026.

What does it cost?

Per 1,000 questions, model cost plus search cost:

AloneWikipedia searchWikiVectors
Model (Gemma 4 31B, rare facts)$0.01$0.21$0.08
Search$0$0$2.00

Wikipedia's API is free; we are not. You pay $2 per 1,000 searches after the first 1,000 each month, and save on tokens because the text is shorter. If your questions are mostly about big topics, Wikipedia's search may be enough. If they touch small pages, people, places or anything rare, it misses most of them.

How do I ground my own model?

One search, then put the paragraphs in the prompt. This is the code we ran, standard library only:

import json, os, urllib.request

def wikivectors_context(question):
    req = urllib.request.Request(
        "https://wikivectors.com/v1/search",
        json.dumps({"query": question, "limit": 5}).encode(),
        {"Authorization": "Bearer " + os.environ["WIKIVECTORS_KEY"],
         "Content-Type": "application/json"})
    results = json.load(urllib.request.urlopen(req))["results"]
    return "\n\n".join(
        f"Page: {r['title']} ({r.get('section') or 'intro'})\n{r['text']}" for r in results)

question = "Which region did Lloyd Quinan represent as an MSP from 1999 to 2003?"
messages = [
    {"role": "system", "content": "Answer the question in as few words as possible, using only "
        "the context. If the context does not contain the answer, answer: I don't know."},
    {"role": "user", "content": f"Context:\n{wikivectors_context(question)}\n\nQuestion: {question}"},
]
# send messages to any chat model: OpenRouter, OpenAI, a local model in LM Studio...

gpt-oss answered: West of Scotland region. Alone, it said Central Scotland.

Each result also carries url, permalink (the exact revision) and license, so your app can cite its source. Want the model step done for you? /v1/answer returns a short answer with its sources, or says it doesn't know. Using Claude, Cursor or another MCP client? Add our MCP server and the model searches on its own.

How fair is this test?

Run it yourself: the script, the 45 questions and every answer are in grounding-test.zip. Set OPENROUTER_API_KEY, WIKIVECTORS_KEY and MODEL, then run python3 grounding_test.py.

Wikipedia for your AI app, without the limits

WikiVectors searches all of English Wikipedia and returns short, cited paragraphs, fresh within the hour. 1,000 free searches a month, then $2 per 1,000.

Just your email, no card. We send your key right away.

More guides