Gareth B. Davies
All articles
Build itAI & RAG

How to build a knowledge base an AI can actually answer from

By Gareth B. Davies

A knowledge base that reads fine to a human can still make an AI hallucinate, because the two are searching it in completely different ways.

Most people building an AI agent's knowledge base start from the wrong assumption: that if the information is written down somewhere, the AI can find it. A human skimming a folder of PDFs uses context you never write down, like knowing the March pricing sheet supersedes January's, or that the FAQ document contradicts the onboarding email because the onboarding email is outdated. An AI doing retrieval doesn't have that judgment. It pulls the chunk that scores highest on similarity, not the chunk that's actually correct, and it will answer confidently from a stale document exactly as fast as it answers from a current one.

This is why the first real decision isn't which vector database to use, it's whether you need one at all. When the underlying data is structured, like inventory counts or booking slots, vector search is usually the wrong tool. If the question is "does this record exist" or "what is the status of this claim," that's a database query against Postgres or Airtable, not a semantic search.

Vector databases earn their keep on unstructured content: long PDFs, policy documents, freeform notes, things where the question and the answer might use completely different words. Reach for embeddings only when the data is genuinely unstructured, and reach for a structured store when it isn't. Blending the two without noticing which is which is where most of these projects start to wobble.

The chunking problem nobody budgets for

Even when unstructured search is the right call, the failures rarely show up in the retrieval logic. They show up in how the source material was cut apart before it ever reached the database. A pipeline tested on a short sample can look solid, then fall apart on long documents, where related passages end up in different chunks. Test at the scale the system is built for.

That gap between demo-scale and real-scale is the single most common reason a knowledge base looks finished and then fails in front of a client. It's worth naming directly.

A knowledge base that passes on your test document is not the same claim as a knowledge base that passes on your client's documents.

Run it against the ugliest, longest, most inconsistent file the client actually has before anyone calls it done.

Where the data actually lives matters more than the search layer

A second failure mode sits even earlier than chunking: how the source material gets into the system in the first place. Scraping someone else's website to keep reference data current turns the knowledge base into a maintenance job, because scraped sites break whenever a page is redesigned. Where possible, get the data from its owner directly. That reframes the problem from "keep up with someone else's website" to "give the source of truth an easy way to hand you clean data," which is a completely different, much more stable job.

The same instinct applies to metadata. Duplicate and missing records often trace back to identifiers not being captured consistently at ingestion. No amount of tuning the retrieval step fixes a problem that originated on the way in. If a record's source, date, or owner isn't captured cleanly when it enters the system, every query built on top of it inherits that ambiguity, and it surfaces later as a wrong answer that looks, on the surface, like a search bug.

Test the answers, not just the pipeline

Once a knowledge base is live, the real risk shifts from "does retrieval work" to "does anyone know when it stops working." Building the response pipeline is the easy part. Monitoring accuracy across every kind of question is harder, and the practical answer is blunt: sample live responses regularly and check them by hand. There's no shortcut around this. Retrieval systems degrade quietly, one wrong answer at a time, and nothing catches that except someone periodically reading the actual output next to the actual question.

Timezones make the same point from another angle: store timestamps without them and a record can show up under the wrong day. Nobody would call that an AI failure, but the AI answering from that record would confidently state the wrong day. The knowledge base is only as trustworthy as the pipeline feeding it, end to end.

The principle underneath all of this is the same one: an AI can't tell the difference between clean data and confident-sounding data, so that judgment has to be built into the system before the AI ever sees it, not patched in after it gives a wrong answer.

Airtablen8nSupabasePostgres

Want a partner working through this with you?

The AAA Accelerator is where AI agency builders get coached on exactly these calls, from first client to full pipeline.