You have a folder on your desktop called 'Stuff'. Inside that, there are subfolders for 'Invoices 2023', 'Compliance', 'Old Quotes', and 'SOPs'. You know the answer to a client's question is in there somewhere. You know you wrote a policy about refundable deposits three months ago. But finding it means opening ten PDFs, scrolling through dense text, and hoping you didn't save it as 'Final_v2_REAL.pdf'. You've heard AI can fix this. You've heard you can 'talk to your data'. But when you look at the tools, you see enterprise pricing, complex dashboards, and promises that sound too good to be true. You want to know if you can build something simple yourself, without handing your client data over to a random startup in Silicon Valley. The short answer is yes. You can build a minimum viable knowledge base on your own laptop. It won't be perfect, but it will work.
Here is the working definition we use at Token by Token: AI is not magic. It is a very fast, very patient assistant who has read everything you gave them, but who sometimes makes things up if they don't know the answer.
— Token by Token
Your job is not to make the AI smarter. Your job is to give it the right book to read before it answers the question. This process is technically called Retrieval-Augmented Generation, or RAG. That sounds complex. It isn't. It just means 'Look it up, then answer'.
To understand how this works, imagine you are sitting an open-book exam. If I ask you a question about Australian tax law, and you rely only on your memory, you might get it wrong. You might confuse GST with PAYG. But if I give you the ATO guidebook and say 'Find the answer in here first, then write your response', your accuracy goes up.
Building a knowledge base is simply building that open-book exam environment for the AI. We are going to walk through exactly how to set that up using free, open-source tools. We will cover what documents you need, how to break them down, how to store them, and how to query them. We will also be very honest about where this breaks, because it will break.
1. Gathering your documents
The first mistake most people make is dumping everything into the AI. Do not do this. If you feed the AI your entire hard drive, it will choke. You need to curate.
For an Australian small business, the valuable data is usually specific. If you are a mortgage broker, you need lender policy updates, credit policy guides, and your own client onboarding checklists. You do not need your old marketing emails or personal photos. If you are a tradie, you need your safety manuals (SWMS), supplier price lists, and contract templates. If you are an accountant, you need tax rulings, client engagement letters, and internal process docs.
Start with text-based files. PDFs are okay, but scanned PDFs (images of text) are a nightmare. If your SOP is a scanned image from 2015, the AI cannot read it unless you run it through OCR (Optical Character Recognition) first. Word documents and plain text files are gold.
Collect about ten to twenty high-quality documents to start. Do not aim for perfection. Aim for 'useful'. Put them in a single folder on your computer. Name them clearly. 'Refund_Policy_2024.pdf' is better than 'Document1.pdf'. The AI doesn't care about the filename, but you will when you are debugging later.
2. Chunking the text
This is where the technical bit starts, but stay with me. Large Language Models (LLMs) have a limit on how much text they can read at once. This is called a context window. If you try to feed a 100-page manual into the AI all at once, it might forget the beginning by the time it reaches the end.
We need to break the documents into smaller pieces. This is called 'chunking'.
Think of it like reading a book. If I ask you 'What happens in chapter 4?', you don't need to recall every word of chapter 1. You just need chapter 4. But if I cut the book in half right through a sentence, you lose the meaning.
Good chunking breaks text by paragraphs or sections, keeping about 500 to 1000 words per chunk. Crucially, you want 'overlap'. If chunk one ends on page 5, and chunk two starts on page 6, you might miss the sentence that bridges them. So we overlap them by about 50 words. This ensures context isn't lost at the edges.
In a Python script, this is handled by libraries like 'langchain' or 'llama-index'. You don't need to write the logic from scratch. You tell the tool: 'Split by paragraph, 500 characters, 50 character overlap'. It does the rest.
3. Embeddings (the map)
This is the concept that confuses most people. Once you have your chunks of text, you cannot just store them in a folder and search for keywords. Keyword search is dumb. If you search for 'car', it won't find 'vehicle'.
We need to turn the text into numbers. Specifically, we turn each chunk into a list of numbers called a 'vector' or 'embedding'.
Here is the analogy: Imagine a giant 3D map. On this map, concepts that are similar are close together. The word 'king' is physically close to 'queen'. The word 'loan' is close to 'mortgage'. The phrase 'how do I claim GST' is close to 'BAS lodgement requirements'.
When we create an embedding, we are plotting your text chunk onto this map. We aren't storing the words anymore; we are storing the coordinates. When you ask a question, we turn your question into coordinates too. Then, we just measure the distance. Which chunk of your documents is closest to the question on the map? That is the relevant chunk.
You do not need to understand the math. You just need to use a model to do it. There are free embedding models available, like 'mxbai-embed-large' or 'nomic-embed-text'. They run locally on your machine.
4. The vector database
Now we have a bunch of coordinates. We need to store them somewhere we can search quickly. A standard Excel sheet won't work. We need a Vector Database.
For a simple setup, you don't need a enterprise server. You can use something like ChromaDB. It can run locally on your laptop. It stores the embeddings and the original text chunk together.
Think of ChromaDB as a filing cabinet where the files are organised by meaning, not by alphabet. When you put a document in, it calculates the coordinates and files it. When you ask a question, it calculates the question's coordinates and pulls the nearest files.
5. The script and the LLM
Now we connect the pieces. You will need Python installed on your computer. You will need a few libraries: 'ollama' (to run the AI model), 'chromadb' (to store the vectors), and 'langchain' (to glue it together).
You also need a local LLM. We recommend using Ollama. It is a free tool that lets you run models like Llama 3 or Mistral on your own hardware. This is crucial for privacy. Your data stays on your machine. It does not go to the cloud.
Here is the flow of the script you are building:
- Load the documents from your folder.
- Split them into chunks (as discussed in Step 2).
- Generate embeddings for each chunk and store them in ChromaDB.
- When you ask a question, generate an embedding for the question.
- Query ChromaDB for the top 3 closest chunks.
- Take those 3 chunks and paste them into a prompt for the LLM.
- The prompt says: 'Use the following context to answer the question. If the answer is not in the context, say you do not know.'
- The LLM generates the answer.
This is the core of RAG. You are forcing the AI to look at your data before it speaks.
What goes wrong (the reality check)
We need to pause here. If you build this tomorrow, it will not work perfectly. I want to be honest about the failure modes so you don't think you've done something wrong.
First, hallucinations. Even with RAG, the AI might lie. If the retrieved chunks are vague, the AI might try to be helpful and invent a policy that doesn't exist. This is why the system prompt must explicitly say: 'If you don't know, say you don't know.' Do not let it improvise on compliance rules or tax law. Second, the 'Lost in the Middle' problem. Research shows that when you give an AI too much context, it tends to ignore information buried in the middle of the text. If you retrieve ten document chunks to answer one question, the AI might only pay attention to the first two and the last two. Keep your retrieved context tight. Three to five relevant chunks are usually enough. If you need more, your chunks are probably too small or your question is too broad.
Third, outdated information. This is a major risk for mortgage brokers and accountants. Imagine you built this system in January using the 2023 lender policy guide. In March, the lender changes their servicing calculator rules. If you do not remove the old PDF and ingest the new one, the AI will confidently give you the old rules. It does not know what year it is unless you tell it. You need a process for updating your knowledge base. Treat it like a living manual, not a stone tablet.
Fourth, privacy and access. Running this locally on your laptop is secure because the data never leaves your machine. But what if you want your whole team to use it? If you put it on a shared server, you need to manage who can see what. A junior broker should not necessarily have access to the same compliance documents as a principal broker. Access control is hard to build from scratch. For now, keep it personal or strictly limited to trusted staff.
Finally, garbage in, garbage out. If your Standard Operating Procedures (SOPs) are written in confusing language, full of jargon and abbreviations only you understand, the AI will replicate that confusion. If your safety manual says 'Make sure the thing is safe', the AI cannot help you. You need clear, plain English documentation for this to work. This is often the hardest part for busy SMBs. You might find that building the AI forces you to finally write down your processes properly. That is a benefit, but it is also work.
What it actually takes
Let's talk numbers. You need to know if this is a weekend project or a six-month slog.
Time Commitment
If you are comfortable with code, you can build a basic prototype in one weekend (about 10 to 15 hours). This includes setting up Python, getting Ollama running, writing the script, and testing it with a few documents.
However, cleaning your data will take longer than coding. Expect to spend another 5 to 10 hours formatting your PDFs, fixing scanned documents, and organising your folders. If your documentation is messy, this could stretch to 20 hours.
Maintenance is ongoing. Every time you update a policy, you need to re-run the ingestion script. This takes five minutes, but only if you remember to do it.
Hardware Costs
You do not need a supercomputer, but you cannot run this on a ten-year-old laptop.
For local models (which we recommend for privacy), you need RAM. System RAM is used to load the model.
- 8GB RAM: You can run small models (like Llama 3 8B). It will be slow if you are doing other tasks.
- 16GB RAM: This is the sweet spot. You can run decent models comfortably.
- 32GB+ RAM: Ideal if you want to process larger documents quickly.
If you have a Mac with an M1, M2, or M3 chip, you are in luck. These handle AI tasks very well. If you are on Windows, you ideally want a PC with an NVIDIA graphics card (GPU). If you don't have these, you might need to use a cloud API instead, which costs money per query and sends data off-site.
Software Costs
The tools mentioned here (Ollama, ChromaDB, LangChain, Python) are all open-source and free. There are no subscription fees for the software itself.
However, if you choose not to run locally and use an API like OpenAI or Anthropic, you will pay per token (word). For a small business knowledge base, this might cost $20 to $50 per month depending on usage. For local runs, the cost is electricity and hardware depreciation.
Skills Required
You need basic technical literacy. You should be comfortable using a command line (Terminal or Command Prompt), installing software from GitHub, and editing text files. If the phrase 'pip install' makes you nervous, you might need to partner with someone tech-savvy or wait for no-code tools to mature.
There are emerging no-code platforms that do this, but they often charge monthly fees and host your data on their servers. For Australian businesses concerned about data sovereignty, the local Python route is currently the most control you can have.
The verdict
Should you build this?
If you are a sole trader or a small team (under 10 people) with sensitive data, and you have some technical comfort, yes. It is a great way to learn how AI actually works without spending money. It will save you time searching for documents, and it might even highlight gaps in your documentation.
If you are a larger business, or if you need this for critical client-facing advice immediately, wait. The technology is moving fast. Dedicated enterprise tools are emerging that handle the security and access control better than a homemade script.
For now, treat this as an experiment. Build it for yourself first. Use it to answer your own questions about your business. If it saves you an hour a week, it has paid for itself. If it frustrates you, you haven't lost much money, only time.
AI is a tool, not a strategy. A knowledge base is useful, but only if your knowledge is worth knowing. Start by cleaning up your files. Then, let the machine help you read them.
At Token by Token, we believe in practical adoption. We don't care about the hype. We care about whether it saves you time on a Tuesday afternoon when you're flat out.
If you want to keep up with practical AI guides for Australian businesses, join our newsletter. We break down the tools every week, no fluff.
Want to keep learning?
If you want to keep up with practical AI guides for Australian businesses, join our newsletter. We break down the tools every week, no fluff.