How to Build an AI Knowledge Base for Your Business

Almost every useful business AI project, whether a customer-facing chatbot, a staff assistant, a document assistant or an AI search box on a website, sits on the same foundation: a knowledge base the model can look things up in. Get this layer right and every assistant built on it answers accurately. Get it wrong and the smartest model available will confidently give customers last year's prices and staff the wrong leave policy.
This article is about that foundation. It explains what an AI knowledge base is, how retrieval-augmented generation (RAG) works in plain terms, which sources to include, how to prepare and chunk content, how to measure whether retrieval is working, how to keep it maintained, what changes in a Nigerian business, a labelled hypothetical example and indicative costs. The assistants that use the knowledge base, for customers, staff or documents, are covered in their own articles in this library.
What is an AI knowledge base?
An AI knowledge base is a collection of your organisation's content (policies, product information, price lists, procedures, FAQs, contracts, past correspondence) that has been converted into a form a language model can search by meaning and quote from. It differs from a traditional knowledge base or wiki, which people search by keyword and read themselves, in that it is designed to be read by the model on the user's behalf and to return the exact passages needed to answer a question.
The knowledge base is not the chatbot. It is the library behind the chatbot. One knowledge base can serve several assistants: a website chatbot that answers customer questions about delivery, a WhatsApp assistant for sales staff, and an internal assistant that explains HR procedures, each restricted to the sections it is allowed to see.
How retrieval-augmented generation works, in plain terms
Retrieval-augmented generation (RAG) is the technique that lets a language model answer from your documents. When a user asks a question, the system first searches the knowledge base for the passages most relevant to the question, then gives those passages to the model along with the question, and instructs the model to answer only from what it was given and to cite the source.
Step by step:
- Your documents are split into chunks (a paragraph, a clause, a product entry).
- Each chunk is converted into an embedding, a list of numbers that represents its meaning, and stored in a vector database with metadata (document name, section, date, audience).
- When a question arrives, it is also converted into an embedding, and the database returns the chunks whose meaning is closest. Many systems combine this with keyword search for exact terms such as product codes.
- The top chunks are placed in the model's prompt with the question.
- The model writes an answer grounded in those chunks and references them.
The practical consequence: the model never "learns" your documents. It reads the relevant pages each time. That is why updating the knowledge base updates the answers immediately, and why retrieval quality, not model size, decides accuracy.
Which knowledge should go in first?
Start with the knowledge that is asked about most often, changes least often, and already exists in written form. Use this framework to prioritise.
| Priority | Content type | Why |
|---|---|---|
| First | Product and service descriptions, prices, delivery and returns terms, opening hours, locations | High question volume, clear answers, direct commercial value |
| First | Standard operating procedures and HR policies | Staff ask repeatedly; answers must be consistent |
| Second | FAQs from WhatsApp and email history, cleaned and de-duplicated | Reflects real customer language |
| Second | Contracts, supplier agreements, compliance documents | Valuable but access must be restricted |
| Later | Meeting notes, chat logs, old proposals | Noisy, contradictory, often outdated |
A useful test: if two staff members would give different answers to a question today, that topic needs a single agreed document before it goes into the knowledge base. The AI cannot resolve a disagreement your organisation has not resolved.
Step-by-step: building the knowledge base
The core sequence is: define the questions, gather sources, clean and structure, chunk and embed, connect retrieval to the model, test with real questions, set access rules, then assign ownership. Each step in practice:
- Write 50 real questions. Collect them from WhatsApp chats, email, the reception desk and staff. These become your test set and tell you which sources matter.
- Gather the sources. Export policies, price lists, product sheets, SOPs and FAQs. Note the owner and last-updated date of each.
- Resolve contradictions. Where two documents disagree (old and new price lists, two versions of a leave policy), keep one. Archive the rest outside the knowledge base.
- Convert to clean text. Parse PDFs and Word files; OCR scans; turn tables into structured rows or clear sentences. Remove headers, footers and page numbers that add noise.
- Add metadata. Document title, section, effective date, audience (public, staff, management), and product or department tags. Metadata is what lets you restrict access and filter by date.
- Chunk sensibly. Split by natural units (a clause, a policy section, one product) rather than by fixed character counts. Keep each chunk self-contained: a chunk that says "the fee above applies" without the fee is useless.
- Embed and store. Use an embedding model and a vector database (managed cloud services or open-source options both work). Store the chunk text, embedding and metadata together.
- Connect retrieval to the model. Build the pipeline: question in, top chunks retrieved (with metadata filters for the user's access level), model answers with citations, "I don't have that information" when nothing relevant is found.
- Test against the 50 questions. For each, check whether the right passage was retrieved and whether the answer was correct and cited. Fix chunking and metadata where it failed.
- Assign an owner and a review cycle. Someone must be responsible for updating prices, policies and procedures in the knowledge base, with a monthly check at minimum.
Preparing content: cleaning and chunking
Content preparation is where most of the effort in an AI knowledge base goes, and it is the step most often skipped. The model answers from what it retrieves; if the retrieved chunk is ambiguous, out of date or cut in half, the answer will be too.
Cleaning checklist:
- One current version of each document; old versions archived elsewhere
- Dates and effective periods stated inside the document text, not only in the filename
- Prices in naira with the date they apply from; USD-priced items marked as such
- Abbreviations expanded at least once per document
- Tables converted to one row per entry or to clear sentences
- Contact details, addresses and hours in a single canonical document
- Sensitive personal data removed or restricted by metadata
Chunking guidance:
- Policies: one chunk per section or clause, with the policy title repeated at the top of each chunk.
- Product catalogues: one chunk per product including name, code, price, variants and delivery notes.
- FAQs: one chunk per question and answer.
- Long contracts: one chunk per clause, with the contract name and party names in metadata.
- Keep chunks roughly a few hundred words; long enough to be self-contained, short enough that several fit in the model's context together.
Combining semantic search with keyword search (often called hybrid retrieval) is worth the small extra effort in Nigerian businesses where product codes, branch names and reference numbers must match exactly.
Testing retrieval quality before anyone trusts it
Retrieval quality is measured by asking real questions and checking whether the right passages come back, before judging the model's final answer. This separation matters: if retrieval fails, no prompt engineering will fix the answer.
A simple evaluation routine:
- Build the test set: the 50 questions from step one, each with the document and section that contains the correct answer.
- Measure retrieval hit rate: for each question, is the correct chunk among the top three or five results? Track the percentage.
- Measure answer correctness: does the generated answer match the source, cite it, and avoid adding anything not in the source?
- Measure refusals: for ten questions the knowledge base cannot answer, does the assistant say so rather than inventing?
- Repeat after every content update and monthly regardless.
Common fixes when hit rate is low: chunks too long or too short, missing metadata filters, documents that use different words from customers (add a synonyms document: "waybill", "delivery note" and "dispatch slip" mean the same thing in your business), or the wrong embedding model for mixed-language content.
Keeping it current: ownership and maintenance
An AI knowledge base decays quickly without an owner. Prices change with the exchange rate, policies are revised, staff move, products are discontinued. Maintenance is a process, not a one-time build.
- Name an owner for each content area: finance owns prices and terms, HR owns policies, operations owns procedures.
- Set an update trigger: any change to a source document must be followed by re-ingestion, ideally automated from a shared drive folder.
- Log unanswered and corrected questions. These reveal gaps and outdated content; review them weekly for the first three months.
- Date-stamp everything and show "last updated" alongside answers where practical.
- Retire content deliberately. Remove discontinued products and superseded policies rather than leaving them to be retrieved by mistake.
- Review access rules when staff join or leave; the knowledge base's permissions should follow your organisation's roles.
What changes for Nigerian businesses
Building a knowledge base in Nigeria differs from the generic guide in four ways: much of the "knowledge" lives in WhatsApp chats rather than documents, prices change frequently with exchange rates, customer language mixes English with local phrasing, and personal data in the content falls under the NDPA 2023.
Knowledge trapped in WhatsApp. For many SMEs, the real product knowledge, negotiated terms and delivery arrangements exist only in chat histories and in a few people's heads. Part of the project is interviewing those people and writing the documents down, which is valuable regardless of AI.
Frequent price changes. With naira volatility, USD-linked prices can change monthly. Structure prices as a single dated document that is easy to re-ingest, and have the assistant state the effective date with every price it quotes.
Customer language. Nigerian customers ask "how much is delivery to Ajah?" and "is this one original?" in their own words. Seed the FAQ chunks with real customer phrasing from your chats, and add a synonyms document for local terms.
Data protection. Contracts, HR files and customer histories contain personal data. Use metadata to restrict who can retrieve what, keep sensitive material out of public-facing assistants entirely, choose providers with clear data-handling terms, and document your approach for NDPA 2023 accountability. Verify current NDPC requirements; this is not legal advice.
Costs and connectivity. Embedding and model usage are billed in USD; ingest once and re-embed only changed chunks. Host in the cloud so the knowledge base is available when office power is off.
Example (hypothetical): a private school group in Abuja
Example (hypothetical): A group of three private schools in Abuja fields hundreds of parent questions each term about fees, payment plans, uniforms, term dates, bus routes and admission requirements, plus staff questions about leave, procurement and safeguarding procedures. Answers vary depending on who picks up the phone.
The group builds a single AI knowledge base with three access levels: public (fees, dates, admissions, transport), staff (HR policies, procedures, safeguarding) and management (board papers, contracts). Sources are gathered from the bursar, the registrar and HR; contradictions between the fee schedule on the website and the one the bursar emails are resolved first. Content is chunked by policy section and by fee line, with effective dates in each chunk.
A public parent assistant on the website and WhatsApp uses the public level; an internal staff assistant uses the staff level. The registrar owns admissions content, the bursar owns fees, and re-ingestion runs automatically from a shared folder. Retrieval is tested against 60 real parent questions before launch, and the assistant is instructed to refer anything about individual pupils to a human. This is an illustrative scenario, not a Linestech client result.
How much does an AI knowledge base cost in Nigeria?
The cost of an AI knowledge base in Nigeria depends on the volume and messiness of source content, the number of access levels, whether ingestion is automated, and how many assistants will use it. The figures below are indicative 2026 ranges; actual quotes vary with scope, vendor and exchange rate.
| Scope | Indicative one-off cost | Typical contents |
|---|---|---|
| Small: under 100 clean documents, one access level, one assistant | ₦800,000–₦2,500,000 | Ingestion, chunking, vector store, retrieval pipeline, test set |
| Standard: several hundred documents, 2–3 access levels, automated re-ingestion, evaluation dashboard | ₦2,500,000–₦6,000,000 | Metadata design, hybrid search, admin tools, content clean-up support |
| Large: thousands of documents, integration with document management and business systems, multiple assistants | ₦6,000,000–₦15,000,000+ | Connectors, governance, audit, custom admin |
Recurring costs, mostly in USD:
- Embedding and model usage, driven by query volume and content churn.
- Vector database and hosting: a modest managed plan or a VPS at roughly ₦150,000–₦800,000 per year; more at scale.
- Content maintenance time, internal or as part of a retainer of ₦20,000–₦150,000 per month.
Content clean-up and documenting undocumented knowledge is often quoted separately and is frequently half the effort. Ask vendors to state how retrieval quality will be measured and what the acceptance test is. Compare two or three written quotations on identical scope.
Mistakes to avoid
- Ingesting everything. Old versions, drafts and chat exports create contradictions that retrieval surfaces at random. Curate first.
- Fixed-size chunking of policies and contracts. Cutting a clause in the middle produces chunks that cannot answer anything. Chunk by natural units.
- No test set. Without real questions and known correct passages, you cannot tell whether retrieval works or whether the model is guessing.
- Letting the model answer when nothing was retrieved. Instruct it to say it does not know and offer a human contact.
- One access level for everything. A public chatbot with HR policies in its knowledge base is a data breach waiting to happen.
- No owner. The most common failure: the knowledge base is accurate on launch day and wrong three months later.
- Choosing the model before the content. The model is the easiest part to swap; content and retrieval design are the investment.
Conclusion
An AI knowledge base is the foundation under every reliable business assistant. Its quality comes from curated, current, well-chunked content with clear access rules and a named owner, not from the model on top. Build it around the questions people actually ask, test retrieval against those questions before launch, restrict sensitive content by role, and set up a maintenance routine on day one. Indicatively, a focused knowledge base costs from around ₦800,000 in Nigeria plus USD-denominated usage, and the content clean-up it forces is valuable even before any AI uses it.
If you are planning a customer chatbot, staff assistant or document assistant and want the knowledge layer built properly first, Linestech can help you audit your sources, design the metadata and access levels, and set up retrieval testing so every assistant you build later answers from the same trustworthy base.
Frequently asked questions
Is an AI knowledge base the same as training a model on my data?
No. Training (fine-tuning) changes a model's weights and is expensive, slow to update and unsuitable for facts that change. A knowledge base leaves the model unchanged and gives it your documents to read at answer time, so updates take effect immediately and every answer can cite its source. For business facts, a knowledge base is almost always the right approach.
Do I need a vector database, or can I use my existing database?
You need vector search, but that does not necessarily mean a new product. Several mainstream databases now support vector columns and similarity search, and managed vector services are also available. For a small knowledge base, an extension to your existing database is often enough; dedicated services help at larger scale or when you need advanced filtering.
Can the knowledge base include my WhatsApp chat history?
Raw chat exports are noisy and full of personal data, so they should not be ingested as they are. The better approach is to mine them for recurring questions and agreed answers, write those up as clean FAQ entries, and ingest the FAQ. Personal details of customers should stay out of the knowledge base unless there is a clear, documented basis under the NDPA.
How many documents do I need before it is worth building?
Volume matters less than question frequency. A business with twenty well-written documents that answer the questions customers and staff ask every day gets more value than one with two thousand unread files. If you have a set of questions that are asked repeatedly and a written source for each, you have enough.
Will it work with Nigerian English and local terms?
Yes, provided the content includes the terms your customers and staff actually use. Add a short synonyms document mapping local phrasing and product nicknames to your official names, and seed FAQ chunks with real question wording from your chats. Test with the questions as people ask them, not as you would write them.
How is access to sensitive content controlled?
Through metadata: each chunk is tagged with an audience level (public, staff, management, specific departments), and the retrieval step filters by the user's role before anything reaches the model. The filter must be enforced in code, not in the prompt, because prompt instructions can be talked around.
How often must the knowledge base be updated?
Whenever a source changes, and reviewed monthly regardless. Prices, dates and policies are the usual culprits. Automating re-ingestion from a shared folder removes most of the manual work; the remaining job is deciding what is current, which needs a named owner.
Sources and further reading
Figures, platform rules and regulations change. These are the primary references behind this article and the places to check before you act on it.


