In-house generative search answers staff questions from your documents with citations, using RAG. How it works and how it differs from AI answer engines.
Bring the questionShow us where things get stuck and who it affects.
Test the opportunityWe look at the data, constraints and what a good result would look like.
Agree the first useful stepA clear scope, approach and cost before any build begins.
In-house generative search lets staff ask a question in plain English and get a short, cited answer drawn from your own policies, case notes, contracts and guidance, instead of sifting through a ranked list of links. Under the hood it's almost always retrieval-augmented generation (RAG): search your documents first, then have the model answer strictly from what came back.
It looks like Google's AI Overviews or AI Mode, or a chat assistant with web search, yet differs in one decisive respect: inside your own organisation, you control which sources count, who can see what, and what happens when the answer isn't there.
Key takeaways
In-house generative search answers questions from your documents with citations: RAG behind a search interface.
Unlike public answer engines, you decide which sources count, who can see what, and how the system says 'not found'.
Most failures start in the content and the index (old versions, lost permissions, bad chunking), not in the model.
Keep sources visible beside the answer, measure retrieval and answers separately, and design the 'no answer' path on purpose.
Public answer engines vs in-house search
Public answer engines and internal search share the same shape (a search box and a written reply) while making completely different promises. A public engine picks sources from the open web and ranks them by its own signals. An internal system answers from a corpus you curate, enforces your access rules, and leaves someone in your organisation accountable for every reply it prints.
AI answer engines vs in-house generative search
Public AI answer engine
In-house generative search
Sources
The public web, chosen and ranked by the provider
Your documents and systems, chosen by you
Permissions
Public content only
Filtered per user before the model sees anything
Freshness
Depends on the provider's crawl
Depends on your index refresh, which you control
When unsure
Usually still answers
Can be designed to say it found nothing and show the nearest documents
Accountability
The provider's terms
Your organisation, for every answer
Data handling
Questions go to the provider
Your choice of model provider, region and retention
If you're asking the opposite question (how to get your public pages cited in AI Overviews), that's web publishing rather than engineering. Google's line is that there are no special requirements for its AI features beyond being indexed and eligible for a snippet in Search, so the usual basics on clear, accurate, well-structured pages still apply.
How the pipeline works
Every working setup splits into two halves: getting content in, and answering a question.
Getting content in
Collect and parse. Pull files from wherever they live (SharePoint, Google Drive, a document management system, a case system) and extract text, tables and headings. Scanned PDFs need OCR; tables need their header rows kept attached to every cell.
Record what each document is. Title, owner, version, date, status (current or superseded) and, above all, who can see it. Capture permissions at ingestion, never later.
Chunk by structure. Split on sections and paragraphs, carrying the document and section title inside each chunk so it still makes sense out of context.
Index twice. Keep both a keyword index and embeddings for each chunk. Keyword search catches exact strings like form numbers and names; embeddings catch passages saying the same thing in different words (see why embeddings matter).
Answering a question
Search within the user's permissions. Run keyword and vector search together, filtered to files this person can see and, by default, to current versions.
Rerank. A reranking model scores the candidate passages against the actual question and keeps the sharpest handful.
Answer strictly from the passages. The model writes a short reply and cites the passage behind each claim. If the passages don't cover the question, it says so.
Show the sources. Put the cited passages and the wider result list right beside the answer so people can verify it and keep digging.
Most quality problems start in the top row: old versions, lost permissions and chunks that lost their context. The bottom row can only answer from what the top row put in the index.
That single pass covers most lookups. When a question spans several documents, needs a comparison or pulls a figure from another system, route those queries to an agent loop instead of slowing down every search; RAG vs agentic retrieval explains how to split the two.
When is a list of results better than an answer?
Not every search wants prose. Someone hunting for a specific file ("the 2026 procurement policy") wants the file. Someone browsing ("what do we have on damp and mould?") wants a list to scan. Someone asking a concrete question ("how long do we have to respond to a disrepair complaint?") wants the answer and the paragraph it came from.
Good in-house search serves all three on one screen: a short reply when the evidence supports one, the cited passages, and the ranked hits underneath. The retrieval has already happened, so showing the list costs next to nothing and stops the generated summary becoming a single point of failure.
Why it goes wrong
A tenant asks whether a repair scheme covers their home, and the assistant says yes, even though the scheme closed years ago. The model didn't do anything strange: the old policy document was still sitting in the index, unmarked, and matched the question closely. Most failures look like that. They start in the corpus and the index:
Superseded versions. Old and current policies sit side by side with nothing to tell them apart. Mark status at ingestion and filter on it.
Lost permissions. Files get indexed without their access rules, so search surfaces pages the asker shouldn't see.
Chunks stripped of context. A paragraph reading "this does not apply to leaseholders" is dangerous once the chunk loses which scheme "this" refers to.
No "not found" path. Push a model to always answer and it'll patch gaps from general training data, reading just as smoothly as the truth.
A stale index. The policy changed last week; the index refreshes monthly.
Measuring retrieval and answers separately
Test both halves apart, using real questions staff actually ask:
Retrieval: for each test question, did the passage that answers it land in the top five or ten hits? That's recall at k, and it's the number to fix first.
Answers: is every claim backed by the passage it cites, and did it miss anything? A model can grade this at scale once you've calibrated its marks against human reviewers.
The "not found" rate: include questions your corpus can't answer and check that the system declines instead of guessing.
Live use: which sources people click, which replies get flagged unhelpful, and which queries return nothing. That last list is your content backlog.
Our guide to evaluating AI systems goes deeper on test sets, model graders and release gates.
Build, buy or switch on?
Three sensible routes, mostly decided by where your documents live:
Switch on what you have. If almost everything sits in one workplace suite, its built-in assistant might be enough, using permissions you already maintain. Check how it handles superseded versions, which sources it reaches and where processing happens.
Buy an enterprise search product. Good off-the-shelf tools connect many sources and sync permissions for you. You move fast, trading away some control over ranking, prompts and evals.
Build. Worth the effort when content spans systems off-the-shelf tools don't reach, when answers need live figures from systems of record, or when you must control model provider, region and audit trail. Just go in knowing you'll own ingestion, evals and operations.
Common mistakes
Indexing everything. Drafts, duplicates and retired policies drag answer quality down. Curate first and mark what's live.
Hiding the sources. An answer with no visible citation asks staff to trust the model blind. Show the passages.
Shopping for a vector database first. Most teams can start on what they already run (pgvector on Postgres, or their existing search engine). Retrieval quality lives in parsing, chunking and ranking.
Testing with made-up questions. Real queries are shorter, vaguer and packed with local jargon. Pull them from the people who'll actually use the box.
In-house generative search checklist
Capture permissions, version and status for every document at ingestionWatchpointRetrofitting permissions leaves a window where search can leak documents
Chunk by structure and carry document and section titles with each chunkWatchpointContext-free chunks match the wrong questions
Combine keyword and vector search, then rerankWatchpointVectors alone miss exact terms like form numbers and names
Cite every claim and show the sources beside the answerWatchpointUnverifiable answers lose trust after the first mistake
Design and test the 'not found' responseWatchpointA system forced to answer every time will invent what it can't find
Refresh the index on a schedule matching how fast content changesWatchpointA stale index produces confident, out-of-date answers
What we'd do
Pick one well-defined collection staff search constantly (HR policy or a single service's guidance) and clean it before indexing: strip duplicates, mark current versions and capture permissions. Put hybrid search, a reranker, cited answers and a clear "not found" response in front of it, with ranked results visible underneath. Gather 50 to 100 real questions, measure retrieval and answers apart, and only then widen the corpus or add an agent path for questions a single search can't settle.
If your questions span documents and live operational systems, the Company Twin connects your existing AI tools under your own access rules. See how the Company Twin grounds answers →