Discuss Your Project

Case study · AI chatbot for your business documents

RAG Case Study: Turn Your Documents into an AI-Powered Chatbot

Your staff and customers keep asking questions that are already answered somewhere in your documents. We built DocChat, an AI assistant that reads a company’s own documents and answers those questions in plain language, in seconds. It answers only from your content, ties every answer to the pages it came from, and says so honestly when the answer is not there.

Last updated · Built by 28 Infotech

one-time cost to prepare a 600-page document
≈ $0.003
per answer with OpenAI; ≈ $0.0008 with Claude
< $0.004
off-topic questions answered in testing; it declined instead of guessing
0 of 22
of answers traced to a valid source in testing
100%

Costs are approximate list prices from November 2026 and depend on your documents and usage. See the cost notes.

01 · Problem

The Problem: Your Answers Are Buried in Documents Nobody Has Time to Read

Every business already has the answers somewhere: in policies, product guides, contracts, specifications and help pages. Finding them is the hard part. Staff dig through long PDFs or ask the one colleague who knows, customers wait in a support queue, and a generic AI chatbot is too risky because it makes answers up.

  • Hours lost searching

    A simple question turns into a long hunt through PDFs, shared drives and old emails, and the same questions come back every week.

  • Support teams stretched thin

    Customers ask the same things over and over, and each one waits in a queue for an answer that is already written down.

  • AI chatbots that make things up

    Off-the-shelf chatbots answer from general internet knowledge and fill the gaps with confident guesses. One wrong answer about a policy, price or procedure can cost more than no answer at all.

  • Answers nobody can check

    If you cannot see where an answer came from, someone has to check it by hand, and the time you saved is lost again.

  • Information goes out of date

    Documents change all the time. A tool that has to be updated by hand is out of date soon after launch.

  • Unclear running costs

    Many AI tools charge per seat or per page, and nobody can tell you what the bill will be once everyone starts using them.

How does a RAG chatbot solve this?

RAG (Retrieval-Augmented Generation) gives an AI assistant your documents to work from, like an expert who checks the reference before answering. When someone asks a question, the assistant first looks up the most relevant passages in your documents, then writes the answer from those passages only. If your documents do not cover the question, it says so instead of guessing.

Generic AI chatbot compared with a RAG chatbotTop: a question goes straight to an LLM, which answers from its training data and may guess. Bottom: the question first retrieves passages from the company's own documents, and the LLM answers only from those passages, with citations, or declines.Generic AI chatbotQuestionLLMtraining data onlyGuessno sourcesRAG chatbotQuestionRetrieveyour documentsLLMpassages onlyCited answeror honest replyEmbeddings and vector search find the passages that match the meaning of the question.
A generic AI chatbot answers from memory. A RAG chatbot looks up your documents first and answers from what it finds.

02 · Solution

Our Solution: An AI Assistant That Only Answers From Your Documents

We built DocChat around one promise: it never answers from general AI knowledge. Before any answer reaches a user, it passes three independent checks. If any check fails, the user gets an honest “I couldn’t find that” instead of a guess, so your customers and staff can trust what it says.

Three fail-closed grounding checksA question passes the similarity gate, then the independent AI judge, then citation validation before an answer is shown. Failing any check leads to the same fixed reply, never a general-knowledge answer.Question1 · Similarity gatecalibrated threshold2 · AI judgeis it answerable?3 · Citation checkevery source must be realFixed, honest replyno general-knowledge answer, everCited answerstreamed with its sourcesfailfailpass
Three independent checks protect every answer: if any one fails, the user gets an honest reply, never a guess.
  • Relevance check

    If your documents contain nothing close in meaning to the question, the assistant declines straight away, before any AI model is asked to write an answer.

  • Second-opinion review

    A separate AI review confirms that the passages found really answer the question. Only passages that pass are used.

  • Source check

    Every answer must point to the passages it came from. An answer that cannot be traced to your documents is withdrawn.

  • Always available

    It works with OpenAI, Anthropic Claude and Google Gemini and switches automatically if one has an outage, so your assistant stays online.

  • Updates itself

    Add a document to a folder and the assistant knows it. Change or remove one and the assistant follows. No technical staff needed.

03 · How it works

How It Works: From Your Documents to Trusted Answers

Behind the chat window, DocChat does two simple jobs: it learns your documents, then it answers questions from them. Here is what happens at each step, in plain terms. It is built as a self-contained module, so it can be added to your existing web application without a rebuild.

How the AI chatbot works, step by step

First, the assistant prepares your knowledge: it reads your documents, breaks them into short passages and files each one by what it means, automatically, whenever a file changes. Second, it answers questions: it finds the passages that best match the meaning of the question, runs its three safety checks, and writes an answer from those passages only. OpenAI, Claude or Gemini can do the writing; switching between them is a setting, not a rebuild.

How the DocChat RAG chatbot worksStep 1, prepare the knowledge: your documents are split into passages, turned into embeddings and stored in a vector database, automatically whenever a file changes. Step 2, answer each question: the question is matched with the closest passages in the vector database, three safety checks run, the AI model (OpenAI, Claude or Gemini) writes the answer from those passages, and the user gets a cited answer or an honest reply.1 · Prepare the knowledge (automatic)Your documentsPDF, Office, web pagessplit + embedVector databasepassages + embeddingsRuns on its own whenever a file is added, changed or removed.Every passage is stored with its embedding: its meaning, as numbers.2 · Answer each questionsearchQuestionasked in plain languageFind passagesclosest in meaning3 safety checksgate · judge · citationsAI writes answerOpenAI, Claude, GeminiCited answeror an honest reply
How it works: your documents are prepared once; every question is answered from them, behind three safety checks.

Preparing your documents

The assistant reads PDFs (including scanned paper documents), Word, PowerPoint and Excel files, web pages and more. Scanned pages are read with text recognition on your own server, and any text it cannot read with confidence is left out, so unreliable content never reaches an answer. Each document is processed once per version, which keeps the cost tiny: preparing a 600-page document costs about a third of a cent. If the process is interrupted, it picks up where it stopped.

Document ingestion and embedding pipelineFiles are discovered and fingerprinted, parsed once into a text cache with OCR for scanned pages, split into overlapping chunks, embedded in batches into 768-dimension vectors and published to the knowledge base.Discoverfingerprint each fileParse oncetext cache + OCRChunk≈ 1,600 chars, overlapEmbedbatched requestsPublishsearchable at once"Title + chunk text…" → [0.0123, −0.0456, … 768 numbers]Low-confidence OCR text is never indexed. Saved batches survive restarts.
Each document version is read once, split into short passages and stored so it can be searched by meaning.

Answering a question

People can ask follow-up questions naturally, such as “and what about weekends?”, and the assistant understands them in context. It searches your documents by meaning and by exact words together, picks the few best passages, runs the three checks and streams the answer back in seconds. If nothing passes, the user gets an honest reply instead. When the same question is asked again within six hours, the saved answer is reused at no cost.

What it costs to run

Preparing your documents is a one-off cost per document version and is close to free. More than 99% of the running cost is the AI model answering questions, so we measured it per question and let you choose the provider that fits your budget. All figures are approximate list prices checked on 24 Nov 2026.

Approximate cost per operation (USD)
OperationCost
Embed a 600-page document (once per version)≈ $0.0032
Embed one user question≈ $0.0000005
Answer one question with OpenAI gpt-4.1-mini≈ $0.0032
Answer one question with Anthropic Claude Haiku 5.5≈ $0.00084
Off-topic question declined at the gateembedding cost only
Same question again within 6 hours≈ $0 (cached)
Approximate monthly AI cost by traffic (USD)
TrafficQuestions / monthClaude Haiku 5.5OpenAI (default)
Light (100 / day)3,000≈ $2.70≈ $10
Medium (1,000 / day)30,000≈ $27≈ $100
Heavy (10,000 / day)300,000≈ $270≈ $1,000

Assumes 10% of questions declined; the answer cache, which only lowers these numbers, is not counted.

About these prices: every figure is an approximate estimate, not a quote. Real costs depend on context: the size and number of your documents, how long questions and answers are, how much text is sent to the model, your traffic, caching, and the model you choose. Token counts are estimated, so expect bills within roughly ±20% of these figures. AI providers also change their prices over time, and some increases are already announced, so we re-check the official price lists and give you an up-to-date estimate for your own project before you commit.

Technical deep diveIngestion settings, reliability, security and evaluation

Ingestion settings

Chunk size
≈ 1,600 characters (max 2,400)
Overlap
200 characters
Embedding model
OpenAI text-embedding-3-small, 768 dimensions
Alternative
Gemini embeddings, by configuration
Sample run
≈ 600 pages → ≈ 480 passages, ≈ 160K tokens
Formats
PDF (incl. scanned), Word, PowerPoint, Excel, HTML, Markdown, CSV, JSON, web pages

Reliability: a knowledge base that heals itself

  • Crash-safe indexing

    Finished batches are kept. After a restart nothing is embedded twice.

  • Quota and outage aware

    On rate limits, outages or an empty account the indexer pauses and retries on its own.

  • Zero-downtime rebuilds

    Changing the embedding model rebuilds the index in the background and swaps it in one step. Chat keeps working throughout.

  • Answer-time failover

    If a model times out or a provider is down, the next model or provider takes over.

Security and data privacy

  • API keys stay on the server. They are never sent to the browser or written to logs.
  • The answer model sees only approved passages. What a user claims in the chat is never treated as fact.
  • Web pages are fetched only from an allow-list, private networks are blocked, robots.txt is respected, and hidden page text, a common hiding place for injected instructions, is removed.
  • OCR runs on the server, so page images never go to a third party.
  • Chat history is not stored on the server. Every request is validated and rate-limited.

Quality and evaluation

We do not ship on impressions. We evaluated the real pipeline against a fixed set of 58 test questions, answerable, partly answerable and off-topic, and re-ran it when prompts, thresholds, models or chunking changed. Thresholds are calibrated for each embedding model: with thresholds carried over from another model, retrieval recall dropped to about 39%.

test cases passed
55 / 58
retrieval recall
≈ 91%
citation validity
100%
off-topic questions answered
0 of 22

04 · Product

The Product: DocChat, an AI Assistant for Your Documents

The result is an AI assistant that adds to your web application or internal portal as a chat window. Customers and staff ask in plain language and get a clear answer in seconds, based only on your documents.

Illustration of the DocChat widget: a covered question gets a grounded answer tied to its page (sources can be shown or hidden per deployment); an uncovered one gets an honest reply.
  • Grounded answers

    Answers come only from your documents, never from general model knowledge.

  • Answers you can trace

    Every answer is tied to the pages and sections it came from. Show them to users, or keep them for your team to review.

  • Honest replies

    Questions the documents do not cover get a polite, fixed reply, never a guess.

  • Any document, any folder

    PDFs (scanned too), Office files, HTML, Markdown, data files and listed web pages.

  • Always current

    Add, change or remove a file and the knowledge base updates itself.

  • Your choice of AI

    OpenAI, Claude or Gemini, switched by configuration, with automatic fallback.

AI models and providers

  • OpenAI GPT-4.1 mini
  • OpenAI GPT-4o mini
  • Anthropic Claude Haiku 5.5
  • Google Gemini Flash
  • Google Gemini Flash-Lite
  • OpenAI embeddings
  • Gemini embeddings

Results and Business Value

What this means for a business that puts its documents to work this way.

  • Answers people can trust

    Three independent checks mean the assistant is far more likely to say “not found” than to give a wrong answer. In testing it declined all 22 off-topic questions.

  • Questions answered in seconds

    Customers and staff get an answer straight away, at any time of day, instead of searching documents or waiting for a reply.

  • Fractions of a cent per answer

    A 600-page document is prepared for about a third of a cent, and each answer costs about $0.0008 with Claude Haiku or $0.0032 with the OpenAI default.

  • Nothing to maintain

    New and changed documents are picked up automatically, and the assistant recovers from provider outages on its own. No database subscription to pay for.

  • No vendor lock-in

    The AI provider, the search model and the storage can each be swapped as your needs change, without a rebuild.

The same approach powers custom AI solutions for customer support, internal knowledge bases, product documentation and compliance libraries. We bring the architecture, the evaluation discipline and the cost model. You bring the documents.

How We Deliver RAG Projects

  1. Discovery and document audit

    We review your formats, scanned content and the questions people really ask, and agree what the assistant must never answer.

  2. Architecture and cost model

    We choose providers, embeddings and storage for your scale, and estimate cost per question and per month before building.

  3. Build against an evaluation set

    We write test questions with you, off-topic ones included, and calibrate retrieval until the numbers hold.

  4. Launch, monitor, improve

    Automatic indexing keeps knowledge current. Every change to prompts or models is re-tested before release.

Who Can Benefit From a RAG Chatbot?

If your business has documents and people asking questions about them, a RAG chatbot can help. These are the most common ways companies use one, and the industries where it pays off fastest.

Common use cases

  • Customer support

    Answer customer questions instantly, day or night, from your help articles, product guides and policies, and pass only the tricky ones to your team.

  • Customer queries with your own information

    Give website visitors accurate answers about your products, delivery, returns and warranty terms, taken straight from your own information, not the internet.

  • Internal knowledge base

    Turn scattered policies, procedures and wiki pages into one assistant your whole team can ask.

  • Employee assistance

    Let staff ask about leave, benefits, expenses or IT setup in plain language, and free HR and IT from answering the same questions.

  • Document search

    Find the right clause, specification or figure across hundreds of documents by asking a question, not by guessing keywords.

  • Onboarding and training

    Help new hires get up to speed by asking about processes and products instead of reading everything first.

Industries that benefit most

  • Software and SaaS

    Product documentation, help centres and release notes for customer self-service and support teams.

  • Healthcare and life sciences

    Procedures, compliance policies and equipment guides for staff who need fast answers they can trace.

  • Legal and professional services

    Contracts, case files and internal guidance, searched by question with references back to the source.

  • Finance and insurance

    Policy terms, product rules and compliance documents for advisers, claims teams and customers.

  • Manufacturing and engineering

    Technical specifications, maintenance procedures and safety documents for field and factory teams.

  • Retail and e-commerce

    Product catalogues, return policies and shipping rules for customer service and online shoppers.

  • Education and training

    Course material, student guides and academic policies as an assistant for learners and staff.

  • Real estate and property

    Property details, lease terms and tenant FAQs for agents, owners and residents.

  • Hospitality and travel

    Reservation policies, service guides and local information for guests and front-desk staff.

  • Government and public sector

    Regulations, forms and public guidance that citizens and staff can search by simply asking.

Is a RAG chatbot right for your business?

  • Your team or customers ask the same questions again and again.
  • The answers already exist in documents, web pages or files.
  • A wrong answer would cost you money, trust or compliance.
  • Your information changes and must stay current.

If two or more of these sound familiar, a RAG chatbot is likely worth a closer look.

RAG Development FAQ

What is RAG development?

RAG development is building AI systems that retrieve relevant passages from your own data and use them to generate answers. It gives an AI chatbot current, verifiable knowledge without retraining the underlying model.

Why choose RAG instead of fine-tuning an LLM?

Fine-tuning changes how a model writes, not what it reliably knows, and it has to be repeated whenever documents change. RAG keeps knowledge in a searchable index that updates with your files and lets every answer cite its source.

Do I need a vector database for a RAG chatbot?

You need vector search: it is how a RAG chatbot finds passages by meaning rather than exact words. For a document library of up to tens of thousands of passages on one server, a lightweight embedded vector store is fast and adds no running cost. A dedicated vector database makes sense when your content, traffic or number of servers outgrows that.

How do you stop an AI chatbot from hallucinating?

We combine a calibrated similarity gate, an independent AI judge and citation validation. If any check fails, the assistant gives a fixed reply instead of an answer, and we verify this with a set of test questions, off-topic ones included, whenever prompts or models change.

How much does a RAG chatbot cost to run?

In this project, embedding a 600-page document cost about $0.003 once, and each answered question cost about $0.0008 with Claude Haiku and about $0.0032 with the OpenAI default. At 1,000 questions a day that is about $27 (Claude) to $100 (OpenAI) a month. These are approximate list prices and change over time.

Is our company data safe?

Your documents and their searchable index are stored on your own server. Text is sent to the AI provider you choose only to prepare documents and to write answers, scanned pages are read on your server, API keys never reach the browser, and chat history is not stored on the server.

Which AI models do you work with?

We are provider-neutral. This project runs on OpenAI, Anthropic Claude or Google Gemini with automatic fallback, using OpenAI or Gemini embeddings. We choose models for each project from measured accuracy and cost.

Project at a Glance: Technical Summary

For technical readers and IT teams: the key facts of this project on one card.

Services
RAG development · AI chatbot · Document ingestion and OCR · Evaluation
Deliverable
An AI chat widget with a self-updating knowledge base
AI providers
OpenAI · Anthropic Claude · Google Gemini
Knowledge base
Sample of ≈ 600 pages; PDF, Office, HTML, data files and web pages supported
Safety
3 fail-closed checks: similarity gate, AI judge, citation validation
Key result
0 of 22 off-topic questions answered · ≈ 91% retrieval recall

See RAG in Action

Ask the live demo a question, then try one its documents do not cover and watch it decline instead of guessing. Then imagine the same assistant working on your documents.