How to build a custom AI chatbot for any website in under a day

How to build a custom AI chatbot for any website in under a day — Informatics Hub
AI chatbot interface with conversation bubbles on screen
AI Engineering · Tech Guides

How to build a custom AI chatbot for any website in under a day

Informatics HubAugust 20268 min read

A chatbot that actually knows your product, answers your customers' real questions, and stays on topic without hallucinating random nonsense is no longer something only large companies can build. With the right approach, a single developer can have a working, genuinely useful chatbot live on any website in less than a day.

This is not about plugging in a generic widget. It is about building something that knows your specific content, handles your specific use case, and represents your brand properly.

The approach that actually works

The most reliable way to build a focused, accurate chatbot in 2026 is to combine a language model with RAG (Retrieval-Augmented Generation). Instead of trying to fine-tune a model or rely on a generic AI that makes things up, you give the model access to your actual content at query time.

The user asks a question. The system searches your documents or knowledge base for the most relevant information. That information is passed to the language model along with the question. The model answers based on what it found, not based on vague training data.

The secret to a chatbot that does not embarrass you in front of customers is grounding it in your actual content. A model answering from your documentation is far more accurate than one guessing from its training data.
Person chatting with AI assistant on laptop at desk

A well-built chatbot answers from your specific content rather than generating plausible-sounding guesses

What you need before you start

  • Your content in some readable format. PDF documents, a website, a Notion wiki, plain text files. Anything you can read, the system can read.
  • An OpenAI API key or a Claude API key. Both have free credits to start with.
  • Basic Python knowledge. You do not need to be an expert but you need to be comfortable running scripts.
  • About three to four hours of focused time.

Building it step by step

1
Prepare your content

Gather all the documents or pages your chatbot should know about. Convert everything to plain text or use a library like PyMuPDF for PDFs. The cleaner and more organized your source content, the better your chatbot performs.

2
Split content into chunks and create embeddings

Use LangChain or LlamaIndex to split your documents into chunks of around 500 words. Then convert each chunk into a vector embedding using an embedding model. Store these vectors in a local Chroma database or a hosted Pinecone index.

3
Build the retrieval and generation pipeline

When a user asks a question, convert it to a vector, find the three to five most similar chunks in your database, and pass those chunks to the language model as context. Instruct the model to answer only based on the provided context and to say it does not know if the answer is not there.

4
Wrap it in a simple API

Build a FastAPI endpoint that accepts a question and returns an answer. This is what your website will call. Ten to fifteen lines of Python is all it takes to have a working endpoint.

5
Add a chat interface to your website

Build a simple chat widget in HTML and JavaScript that sends questions to your API and displays the responses. If you want a ready-made UI, Chainlit and Streamlit both let you build a chat interface in minutes that you can embed or link to.

The system prompt that makes it behave

The single most important thing controlling your chatbot's behavior is the system prompt. A good one looks like this:

You are a helpful assistant for [Your Company Name].
Answer questions based only on the provided context.
If the answer is not in the context, say you do not have
that information and suggest the user contact support.
Keep answers concise and friendly. Never make things up.
No-code alternative

If you want a working chatbot without writing any code at all, Voiceflow and Botpress both let you build RAG-powered chatbots visually and embed them on any website. They handle the infrastructure and you just connect your content. The tradeoff is less customization and a monthly subscription. For a quick proof of concept or a simple use case, they are genuinely worth considering before committing to a custom build.

Key takeaways

  • RAG is the right architecture for a chatbot that answers accurately from your specific content
  • LangChain or LlamaIndex handle the chunking, embedding, and retrieval so you do not have to build it from scratch
  • The system prompt controls your chatbot's personality and boundaries more than anything else
  • A no-code tool like Voiceflow is a valid starting point if you want something live quickly

Comments