Building a Company Wiki Search That Actually Finds Answers
Keyword search fails on company wikis: it matches words, not meaning. Build hybrid semantic search with chunking, reranking and grounded answers.
By Galactic News Editorial · Published 2026-11-21T07:43:11+00:00 · Updated 2026-11-21T07:43:11+00:00
Building a Company Wiki Search That Actually Finds Answers
Every company has the same problem. The answer exists somewhere. It is in a wiki page, a ticket, a chat thread or a shared doc. Nobody can find it. People ask in chat instead. The same question gets answered five times a week. A company wiki search fixes this only if it finds the right passage, not just a page that mentions the keyword. Keyword search alone fails. It misses synonyms, buries the answer in long pages, and returns the policy document instead of the runbook. This guide builds a search that works: semantic retrieval, keyword search, reranking, and an answer grounded in the retrieved passages.
Why Keyword Search Fails on a Wiki
Keyword search matches words, not meaning. A query for "how do I expense a flight" will not match a page titled "travel reimbursement policy" unless the words overlap. A query for an error code will match every page that mentions the code, including the ones that never solve it. Long pages make it worse. A keyword hit on page 40 of a 60-page handbook tells the user nothing about where the answer sits.
Semantic search fixes the first problem. An embedding model turns each passage into a list of numbers that represents its meaning. The question is embedded the same way. The index returns the passages nearest to the question. A query about expensing a flight finds the reimbursement passage even when the words differ. But embeddings have their own blind spot. They can miss exact names and identifiers. An error code, a config key or a product name is a keyword problem, not a meaning problem. That is why a good wiki search runs both and merges the results.
The Architecture: Retrieve, Rerank, Answer
The standard design is retrieval-augmented generation, or RAG. It has three phases. Ingest splits documents into chunks, embeds them and stores them in a vector index. Retrieve finds the most relevant chunks for a question. Generate passes the retrieved chunks and the question to a language model, which answers from the chunks. The model answers from what it was handed, not from training data. That grounding is the whole point.
Start by checking whether an index is needed at all. Guidance from Anthropic suggests a knowledge base under about 200,000 tokens, roughly 500 pages, can simply be included in the prompt. A company's chat history alone will be far past that, so most teams do need an index. Small teams with a thin wiki can often get away with a simpler setup: a handful of curated pages passed to the model directly.
Build a Company Wiki Search in Six Steps
- Sync the sources. Connect each tool and choose what is in scope. Keep an identifier for every source document, its last-modified date and who can see it. You will need all three later, for freshness and for access control.
- Chunk the documents. Split each document into passages of 200 to 1,000 tokens. A common starting point is 512-token chunks with 50 tokens of overlap. Overlap of 10 to 20 percent reduces lost context at chunk boundaries. Structure-aware splitting works better for documents with headings. Atomic chunks work better for tables and code.
- Give each chunk its context. A chunk that says "we agreed to push it to Q4" is useless without knowing what "it" is. Write a short description of where each chunk sits in its document before embedding it. This contextual retrieval step improves recall more than most tuning.
- Embed and index. Embed each chunk with a model such as OpenAI text-embedding-3-small, which produces 1536-dimension vectors. Store the vectors in pgvector, Pinecone, Qdrant, Chroma or a similar store. Add a full-text index alongside for keyword search.
- Retrieve with hybrid search. Run vector search and keyword search in parallel. Merge the two ranked lists with reciprocal rank fusion, a simple method that combines ranks rather than raw scores. Then rerank the top 50 to 100 candidates with a cross-encoder such as Cohere Rerank or BGE Reranker, and keep the top 5 to 10.
- Generate with citations. Pass the winning chunks to the model with an instruction to answer only from them. Return the answer with a link to each source passage, so the user can verify it. If the chunks do not contain the answer, say so. A search that admits it does not know beats one that invents an answer.
Choosing the Store and the Embedding Model
Postgres with the pgvector extension is the default choice for teams that already run Postgres. It adds a vector column type and index support for similarity search. Enable the extension, create a table with a vector column, and add an HNSW index for fast nearest-neighbour search. A typical schema stores the content, a JSON metadata column, an embedding column of 1536 dimensions for text-embedding-3-small, and a tsvector column generated from the content for full-text search. Index the embedding with HNSW using cosine distance, and index the tsvector with GIN.
Managed vector databases such as Pinecone, Weaviate, Qdrant, Chroma and Milvus trade control for convenience. Pinecone suits teams that want managed infrastructure and fast time to production. Weaviate offers hybrid search out of the box and can be self-hosted. The choice matters less than the retrieval design. A good chunking strategy and a reranker improve results more than a different store.
Pick the embedding dimension once. Changing it later means re-indexing every document. OpenAI text-embedding-3-small uses 1536 dimensions and balances cost and quality. Text-embedding-3-large uses 3072 dimensions and costs more to store. Open models such as BGE-large and E5 suit teams that need to self-host.
How to Measure Whether It Works
A wiki search without measurement drifts. Build an evaluation set before tuning anything. Collect 50 real questions from chat history and support tickets. For each one, record the passage that answers it. Then measure recall: how often the correct passage appears in the top 10 retrieved chunks. Chunking choices change recall by up to 9 percent in published evaluations, so test chunk sizes against the set instead of guessing.
Track three numbers in production. Retrieval recall on the evaluation set. The share of questions the system answers from retrieved passages, against the share where it says it does not know. And user feedback on answers, even a simple thumbs up or down. Re-run the evaluation set after every change to chunking, the embedding model or the reranker. If recall falls, revert the change.
Access control deserves the same rigour as retrieval. A search that returns a salary document to the wrong employee is a security incident, not a search bug. Filter results by the asker's permissions before they reach the model, not after. Keep the source identifier, last-modified date and owner on every chunk, so stale or restricted passages can be excluded at query time.
Common Mistakes
The most common mistake is chunking badly. Chunks that are too large dilute the signal. Chunks that are too small lose context. Test both directions against the evaluation set. The second mistake is skipping the reranker. Vector search returns the nearest neighbours, not the most relevant passages. A reranker re-scores the top candidates for true relevance and usually improves precision more than any other single change. The third mistake is letting the model answer without retrieved evidence. Ground every answer in the chunks. If the chunks are silent, the answer should be too.
Freshness is the quiet failure. A wiki page updated yesterday and a chat thread from 2023 can both match a query. The search should prefer the current passage and show the date of every source. Re-chunk and re-embed a document when it changes. A stale index is worse than no index, because it answers with confidence from outdated text.
Bottom Line
A company wiki search that finds answers needs four pieces: clean chunks with context, an embedding index, keyword search merged by reciprocal rank fusion, and a reranker before the final answer. Postgres with pgvector covers the storage for most teams. The evaluation set matters more than the tooling. Build it from real questions, measure recall, and keep access control and freshness in the pipeline from day one. The result is a search people trust, which is the only kind they will use twice.