# How to build an AI chatbot for your website in 2026

*By Roberto Lazar, founder of Dock30 · Published 2026-06-19 · Updated 2026-07-25 · 6 min read*

What it takes to build a RAG chatbot that answers from your own content: architecture, build steps, realistic 2026 costs, and how to keep it accurate.

To build an AI chatbot that answers from your own content, use retrieval-augmented generation (RAG): index your site and docs into a vector store, retrieve the most relevant passages for each question, and have the model answer only from those passages, with citations. The retrieval step is what stops the bot from inventing answers. Plan on a few weeks for a narrow scope and two to three months for a full assistant. At US agency rates, a focused bot over a defined document set runs about **$5,000 to $50,000** to build, plus $300 to $2,000 a month to run.

A chatbot that improvises is a liability. One that answers from your real content, cites its sources, and admits when the answer is not in the index is an asset. We have built both kinds since 2021, the first kind only ever by accident, and this guide is about the second.

## Why a grounded chatbot instead of a generic one

Out of the box, an LLM only knows its training data. Ask it about your pricing, your refund policy, or last week's changelog and it will guess, fluently and with total confidence. That failure mode has burned enough companies that "our chatbot promised something we never offered" is now a familiar support ticket.

RAG fixes this by retrieving your actual content at answer time. The model never has to remember your facts; it reads them fresh on every question, from an index you control. Update the index and the bot is current the same minute. Show the retrieved passages as citations and users can check the bot's work themselves.

If you are weighing RAG against fine-tuning, we compared them properly in [RAG vs fine-tuning](/blog/rag-vs-fine-tuning). The short version: for a knowledge chatbot, RAG wins almost every time, because your content changes weekly and re-indexing is cheap while re-training is not.

## The architecture

A website RAG chatbot has five parts:

1. Ingestion: crawl your site, help center, and PDFs, then clean and chunk the text.
2. Embedding and storage: turn each chunk into a vector and write it to a vector database.
3. Retrieval: for each user question, fetch the most relevant chunks.
4. Generation: the LLM writes an answer using only those chunks, with citations.
5. Chat UI: a streaming widget on your site, with a path to a human when the bot is unsure.

Retrieval and the model call live on your backend, never in the browser. Your API key, your system prompt, and your access rules should not ship to the client, and rate limiting only works if you own the endpoint.

## The build, step by step

Gather your sources first. Marketing pages, help center articles, product docs, PDFs, good past support answers. Decide what the bot should not know, too. Internal documents leak through careless ingestion more often than you would expect.

Then chunk carefully. Split content into passages large enough to carry meaning but small enough to retrieve precisely, and respect document structure (headings, sections, tables) instead of cutting every N characters. Practitioner consensus is blunt on this point: **bad chunking is the top cause of bad answers**. When a client brings us a misbehaving bot, the fix is usually in the chunking, not the model.

The rest of the pipeline:

1. Embed and index. Run each chunk through an embedding model and store the vectors alongside the source URL and any access metadata.
2. Wire retrieval. On each message, embed the question, pull the top matches, and pass them to the model with the conversation so far.
3. Prompt for honesty. Instruct the model to answer only from the provided context and to say it does not know otherwise. This one instruction does more for accuracy than any model upgrade.
4. Add citations and handoff. Link each answer to its sources, and route to a human or a contact form when retrieval comes back thin.
5. Stream the reply. Token-by-token streaming makes a four-second answer feel instant.

## pgvector or Pinecone

If you already run Postgres, pgvector is the default choice below a few million vectors. It costs nothing extra, it lives next to your relational data so you can join chunks against users and permissions with plain SQL, and access control happens in the retrieval query itself (only fetch chunks this user may see). With an HNSW index, pgvector answers 1M-vector queries in 5 to 20ms at 95%+ recall, per [Encore's pgvector vs Pinecone comparison](https://encore.dev/articles/pgvector-vs-pinecone). At that speed retrieval is not your bottleneck; the embedding API call before it takes longer.

Pinecone earns its fee at roughly 10 million vectors and up, or when you want zero operations work. A website chatbot will almost never get there. Most sites embed into tens of thousands of chunks, not millions, so our advice on projects we scope is boring: start on the Postgres you already have.

## What it costs in 2026

| Scope | Typical build cost (US agency rates) |
|---|---|
| Focused bot over a defined document set | $5,000 to $50,000 |
| Mid-complexity assistant (median) | $75,000 to $120,000 |
| Multi-source production assistant | $75,000 to $200,000 |

Ranges per [Kellton's custom chatbot cost breakdown](https://www.kellton.com/kellton-tech-blog/custom-ai-chatbot-development-llm-rag). If you have read our [custom AI agent cost guide](/blog/custom-ai-agent-cost-2026) and wondered why its RAG knowledge agent lands at $80,000 to $180,000, the difference is scope: that figure describes a production system with integrations, priced at market rates. Same architecture, much bigger surface area than a chatbot over a fixed document set.

Our own numbers sit well below US rates because we build from Romania. Fixed-scope projects [start at EUR 350](/pricing/project), and you get the exact price and delivery date in writing before any work starts. A focused doc-grounded chatbot is squarely fixed-scope territory.

Running costs are the part people forget to budget. Expect **$300 to $2,000 a month** in API usage plus hosting for a typical deployment, per [Debut Infotech](https://www.debutinfotech.com/blog/ai-chatbot-development-cost). Two levers keep you near the low end:

- A cheap generation tier. Claude Haiku 4.5 runs $1 per million input tokens and $5 per million output, per [Anthropic's pricing](https://platform.claude.com/docs/en/pricing), and it is plenty for answering from retrieved context. Save the frontier models for tasks that need reasoning, not lookup.
- Prompt caching. A chatbot resends the same system prompt and instructions with every message. Cache reads bill at roughly 0.1x the base input price, which cuts repeated-context input cost by about 90% per [Anthropic's prompt caching docs](https://platform.claude.com/docs/en/build-with-claude/prompt-caching). For chat workloads this is the single biggest cost lever we know of, and turning it on is a few lines of code.

## How long it takes

A few weeks for a narrow scope, two to three months for a full assistant. Industry surveys put mid-complexity builds at [8 to 14 weeks](https://treeshainfotech.com/blog/ai-chatbot-development-cost-timeline-what-to-expect), per Treesha, and that matches what we see on our own projects. The narrow version is real: one document set, one language, no integrations, and you can be live in two or three weeks. The trap is scoping the narrow version while quietly expecting the full one, which is how chatbot projects end up months late everywhere.

## Keeping answers accurate over time

A chatbot is only as current as its index. Re-ingest on publish if your CMS supports webhooks, or on a nightly schedule if it does not. Then review real conversations, weekly at first. Wrong or thin answers almost always trace back to a document that is missing, outdated, or chunked badly, and fixing the content fixes the bot. The effort is small, an hour or two a week for most sites, but skipping it is how a good bot drifts into a bad one within a quarter.

We build grounded chatbots as part of our [AI and automation work](/services/ai-automation), and after shipping with 600+ founders and teams since 2021 we can usually tell in one conversation whether your case is a two-week bot, a two-month assistant, or a no-code tool you can set up yourself (in which case we will say so and save you the money). If you want that read on your project, book a [free 15-minute call](https://calendly.com/dock30/15min) or write to us through the [contact page](/contact).

## Frequently asked questions

**How do I make an AI chatbot answer from my own website content?**

Use retrieval-augmented generation (RAG). Index your pages and docs into a vector database, retrieve the most relevant passages for each question, and instruct the model to answer only from those passages with citations. The bot then responds from content you control instead of guessing from its training data.

**How much does it cost to build a custom AI chatbot in 2026?**

At US agency rates, a focused chatbot over a defined document set runs about $5,000 to $50,000, and multi-source production assistants run $75,000 to $200,000. Agencies in lower-cost regions charge far less; our fixed-scope projects start at EUR 350 with the price in writing first. Running costs typically add $300 to $2,000 a month in API usage plus hosting.

**How do I stop an AI chatbot from hallucinating?**

Ground it with RAG and prompt it to answer only from the retrieved context, saying it does not know when the answer is not there. Show citations so users can verify each answer, and add a human handoff for low-confidence cases. Most wrong answers that remain trace back to missing or badly chunked source content, not the model.

**Is pgvector good enough or do I need Pinecone?**

pgvector on your existing Postgres is the default choice below a few million vectors. With an HNSW index it answers 1M-vector queries in 5 to 20ms at 95%+ recall, and it gives you SQL joins and access-control filtering in the same query. Pinecone makes sense at 10M+ vectors or when you want zero operations work.

**How long does it take to build a RAG chatbot?**

A few weeks for a narrow scope: one document set, no integrations, a simple widget. A full assistant with multiple sources, analytics, and human handoff usually takes two to three months, in line with industry estimates of 8 to 14 weeks for mid-complexity builds.

---

Written by Roberto Lazar, founder of Dock30. Book a call: https://dock30.com/contact
