AI Use Cases5 min read
How to Build an AI Chatbot Trained on Your Own Data
A business chatbot that answers from your documents is mostly a data and search project with a language model on top. The architecture, the build steps, the security risks and how to measure whether it actually works.

Contents
Most businesses that ask for 'a ChatGPT trained on our data' want something specific: an assistant that answers customer or staff questions accurately from their own help centre, policies, product data and documents, and says where each answer came from. That is very achievable. It is also mostly not about training a model. It is about organising knowledge, searching it well and putting guardrails around a language model.
How it works: retrieval-augmented generation
The standard architecture is retrieval-augmented generation (RAG), first described in a 2020 research paper by Lewis and colleagues (arXiv). When a question arrives, the system searches an index of your content, selects the most relevant passages and gives them to the model with instructions to answer from them. Our article on RAG vs fine-tuning explains why retrieval, not training, is the right default for factual knowledge.
| Component | What it does |
|---|---|
| Connectors | Pull content from help centres, drives, wikis, PDFs, databases and websites |
| Processing | Clean, split into meaningful chunks and attach metadata such as date, product and permissions |
| Index | Stores chunks for keyword and semantic (embedding) search |
| Retriever and re-ranker | Finds candidate passages and orders them by relevance |
| Language model | Writes the answer from the passages, with citations |
| Guardrails | Scope limits, refusal rules, injection defences, escalation to humans |
| Channels | Website widget, in-app chat, Slack or Teams, WhatsApp, email |
| Analytics and evaluation | Answer quality, unanswered questions, feedback and cost |
Step-by-step build
- 01Define the job. Who is it for, which questions should it answer, which should it refuse, and when should it hand over to a person?
- 02Collect real questions. Pull 50 to 200 from tickets, chats and emails, with good answers. This becomes your test set.
- 03Audit the content. Find gaps, duplicates and outdated pages. The bot can only be as good as its sources.
- 04Ingest and chunk. Split by headings, sections or Q&A pairs, keep tables intact and attach metadata.
- 05Set up hybrid search. Combine keyword search, which matches product codes and names exactly, with semantic search, then re-rank.
- 06Write the answer prompt. Answer only from the passages, cite them, keep the brand's tone and say 'I don't know' when the sources are silent.
- 07Add permissions. Filter documents by the user's access before retrieval, not after.
- 08Connect actions carefully. If the bot can create tickets or look up orders, give it narrow, logged tools with confirmation steps.
- 09Evaluate. Score correctness, citation accuracy, refusals and latency on the test set; fix the worst failures first.
- 10Launch small and improve. Start with one channel and audience, review conversations weekly and feed gaps back into the content.
Search quality decides answer quality
When answers are wrong, the cause is usually that the right passage was never found. Anthropic reported that adding a short context to each chunk before indexing, combining semantic and keyword search, and re-ranking reduced failed retrievals by up to 67% in its experiments (Anthropic, Contextual Retrieval). Sending a few highly relevant passages also works better than pasting in everything, because models make less use of information buried in the middle of long contexts (Liu et al., 2023).
Security: the risks specific to chatbots
Prompt injection, where text in a user message or a retrieved document tries to override the bot's instructions, is the first entry in the OWASP Top 10 for LLM Applications. Sensitive information disclosure and excessive agency, giving the model more power than it needs, are also on the list. Practical defences:
- Enforce access control in the retrieval layer; never trust the model to keep secrets it has been shown.
- Treat retrieved content and user input as untrusted data, and keep instructions separate from content.
- Give tools the minimum permissions, require confirmation for actions with consequences and log everything.
- Filter outputs for personal data and off-topic or unsafe responses.
- Red-team the bot with injection attempts before launch. See AI agent security.
Hosted model or private model?
Most chatbots use a hosted model through a business API, which offers strong quality and minimal operations. If your data cannot leave your environment, the same architecture works with an open-weight model on your own infrastructure. The trade-offs are covered in local LLM vs cloud LLM, and model choice in how to choose an LLM for your business.
What it costs to run
- Indexing. Embedding your content once, and re-embedding what changes.
- Per question. Model tokens for the question, the retrieved passages and the answer, plus search costs.
- Infrastructure. Index storage, application hosting and monitoring.
- People. Content upkeep, conversation review and improvements.
Prompt caching, shorter well-chosen contexts and routing simple questions to smaller models keep per-question costs low. For support use cases, compare the cost per resolved conversation with the cost of a human-handled ticket; our AI customer support playbook has the metrics.
Measure what matters
| Metric | Why it matters |
|---|---|
| Answer correctness on the test set | The core quality measure |
| Citation accuracy | Do the cited passages actually support the answer? |
| Correct refusals | Does it say 'I don't know' instead of guessing? |
| Resolution or deflection rate | Share of conversations resolved without a person |
| Escalation quality | Do hand-offs reach the right person with context? |
| User feedback and satisfaction | What users actually think |
| Cost and latency per answer | Whether it is sustainable at volume |
If you would like an assistant that answers from your own knowledge with citations and proper access control, our AI chatbot and RAG development team can scope a pilot with you, and the AI automation guide for business covers where chatbots fit in a wider automation plan.
Sources and further reading
Frequently asked questions
Can I train ChatGPT on my company's data?
You can build an assistant that answers from your data, but it is usually done with retrieval rather than training. The system searches your documents for each question and passes the relevant passages to a model such as GPT, Claude or Gemini, or to a private open-weight model. This keeps answers current and citable.
How long does it take to build a custom AI chatbot?
A focused pilot over a well-organised knowledge base can be built in a few weeks. Timelines grow with the number of sources, how messy they are, permission rules, channels and integrations such as creating tickets or looking up orders.
How do I stop the chatbot from making things up?
Ground it in retrieved passages, instruct it to answer only from them and to say when it does not know, show citations, restrict it to in-scope topics and escalate to a person on low confidence or sensitive subjects. Then measure hallucinations on a test set.
Is my data safe with an AI chatbot?
It can be, with the right design: business API terms that exclude training on your data, encryption, permission-aware retrieval, logging and, where needed, a private model hosted in your own environment. See our comparison of local and cloud LLMs.
Do I need to tell users they are talking to AI?
It is good practice, and transparency obligations for AI systems that interact with people apply in some jurisdictions, including under the EU AI Act. Make the bot identify itself and offer a route to a human.
Work with Navelo Software
- AI Chatbots & RAG DevelopmentCustomer and internal assistants grounded in your own data, with citations and permission-aware retrieval.
- AI Automation & WorkflowsProcess mapping and automation across your tools, combining rules, AI and human approvals.
- Private & Local LLM DeploymentOpen-weight models deployed on your servers or private cloud for data that must stay in-house.
Published by Navelo Software
An independent software and AI studio building AI systems, web platforms, mobile apps and SaaS for clients worldwide.


