Does Ask Prover need a vector database?

Ten questions, two ways of finding documents: the model searching files itself, or a vector database. Same answers, same cost, so Ask Prover runs without one.

Created on 19 September 2026 · ~7 min read

The question, and why it mattered

We compared two ways for Ask Prover to find the right pages before answering questions about railway signalling standards and Prover's tools. The choice mattered because one approach requires an additional service, additional maintenance and an additional bill for processing the documents.

Finding those pages is called retrieval — selecting a small number of documents from a large collection and putting them in front of the language model that produces the answer.

One approach uses a vector database. It reads every document in advance and stores each one as an embedding — a list of numbers that places the text on a map of meaning. This enables semantic search, which can match a question to documents with a similar meaning even when they share no words.

The other approach gives the model the same plain tools an engineer would use at a terminal: list a directory, search for a word, open a file and search again.

A vector database is a second service to run and a second thing to keep in step with the documents. The documents must also be read and summarised by a language model before anyone can ask a question. We wanted to know whether that work produced better answers or only added ceremony.

How we compared the two approaches

What semantic search found on its own

We first measured the vector database without the model. For each question, we checked where the correct file appeared within the first ten results. "Markdown only" applied a text-document filter afterwards to a longer result list because this version had no file-type filter. "Word search" used an ordinary keyword search with one hand-picked keyword per question.

Table 1. Retrieval alone. Rank of the first correct file within the top ten results; "miss" means it was not in the top ten.

Question Kind Semantic search Markdown only Word search hit
q01 concept 1 1 no
q02 concept 1 1 yes
q03 concept miss 8 yes
q04 concept miss 9 yes
q05 concept miss miss yes
q06 exact miss miss yes
q07 exact 3 3 yes
q08 exact 1 1 yes
q09 exact 5 5 yes
q10 exact 1 1 yes
Correct file in the top ten 5/10 7/10 9/10
Semantic search 5 of 10, semantic search with a Markdown-only filter 7 of 10, word search 9 of 10. Semantic search 5 / 10 Semantic search, text documents only 7 / 10 Word search 9 / 10
For each search method, the grey bar shows all ten questions and the blue bar shows how many placed the correct file in the top ten results.

Semantic search alone found the correct file in its top ten for half the questions. When a hit anywhere in the correct topic folder counted instead of requiring the exact file, it reached nine of ten. Speed was not the problem: semantic search answered in 0.13 to 0.67 seconds, while word search took under 0.05 seconds.

Three issues affected the results. Files were stored under their first heading rather than their filename, so searching for a filename found nothing. Three files sharing a source citation were also merged into one entry.

Forty-two files in formats this version could not parse were skipped silently. In addition, a vision model had captioned the 279 figures in dense English while the surrounding prose was Swedish. For the Swedish regulation questions, images therefore crowded the top of the ranking — seven of the top ten results for one question.

Results with the model included

We then ran both approaches with the model over the same ten questions. Cache-read tokens are text previously sent to the model and kept ready by the provider in a prompt cache, so they are billed at a small fraction of the normal rate. The file-search approach used many of them because the same file index was sent with every question.

Table 2. End-to-end results for ten questions. Both approaches used the same model, questions and documents.

Measure File search and index Vector database tools
Answers matching the known answer 9 yes, 1 no 9 yes, 1 partly
Correct file opened or seen 9/10 9/10
Model turns, ten questions 37 42
Input tokens 228 000 312 000
Cache-read tokens 963 000 33 000
Output tokens 19 000 21 000
Wall time 4 min 50 s 5 min 10 s
Cost at list prices $2.10 $2.10

Both approaches produced nine answers out of ten, at the same cost and about the same speed. The single difference concerned the common-cause-failure formula. File search stopped at a similar formula in a neighbouring file and never opened the correct one. The vector database returned the correct file at rank five and the model read it, but still led with the wrong formula. With ten questions, a one-question difference is noise.

What we decided

Ask Prover uses PostgreSQL full-text search, word-pattern search and paged reading for retrieval. It uses no embeddings, no vector database, no second service and no second token bill for loading the documents. The measurement gave us no retrieval-quality reason to add them.

This is a decision about the current version, not a verdict on the technology. A vector index is one database migration away. We will add it when an evaluation — a fixed set of questions used to test Ask Prover — shows questions that are missed and that only semantic search fixes.

Other reasons to use such a store remain valid but are different: per-user document spaces, extracting memory from past sessions, and parsing PDF and Word files that people upload. Those uses are worth testing again when we need them.

The ten questions became Ask Prover's standing evaluation, run against the documents the site actually serves.