A visitor asks a question at 11 pm on a Sunday. On most WordPress sites, they leave without an answer. A modern AI chatbot, on the other hand, responds within three seconds, using YOUR content, and qualifies the lead before passing it on to you. We’re no longer talking about a rigid decision tree, but an assistant powered by an LLM and fed by your pages, articles and FAQs. Here’s how to build it, step by step, with the actual costs.
The components of a WordPress AI chatbot
- The LLM, The language model (Claude AI, GPT-4 or Mistral) that understands and generates text
- The knowledge base, Your pages, articles, FAQs and documentation, indexed in a vector database
- The RAG (Retrieval-Augmented Generation), The system that searches for passages relevant to each question
- The chat interface, A widget integrated into your WordPress site, responsive and customised to match your brand guidelines
- The backend, an API that orchestrates the RAG + LLM (n8n, Make, or custom code)
Step 1: Choosing your LLM
Claude AI (Anthropic), Our top recommendation. Excellent in French, secure, accurate and honest about its limitations. API available from 3 $ per million tokens. Perfect for support and lead qualification chatbots.
GPT-4 (OpenAI), Highly creative, multi-modal, broad scope. Slightly more expensive. US servers – check GDPR compliance depending on your use.
Mistral Large, Open-source, hosting in the EU available. Excellent for French. Ideal if your data is sensitive and you want maximum GDPR compliance.
Step 2: Building the knowledge base
- Export your WordPress content (posts, pages, FAQs) using WordPress’s native XML export feature
- Clean up the content (remove HTML, normalise)
- Split into «chunks» of 500 to 1,000 tokens
- Generate embeddings (numeric vectors) via the OpenAI or Cohere API
- Store in a vector database (Pinecone, Chroma, or pgvector if self-hosted)
Step 3: Set up the RAG with n8n
- n8n workflow: Webhook (user question)
- Node: Generate the embedding for the question
- Node: Find the 5 nearest chunks in Pinecone
- Node: Construct the prompt using context + question
- Node: Send to Claude AI API
- Node: Return the response to the chat widget
The secret to a good chatbot isn’t the model; it’s the prompt system. It’s what prevents hallucinations and sets the tone. Here’s the structure we use:
You are the assistant at [Company]. Respond ONLY based on
the CONTEXT provided below. Rules:
- If the answer isn’t in the context, say so honestly
and suggest contacting the team. Never make things up.
- Respond in French, using a professional and concise tone (3 sentences max).
- End with a useful action: a link to the relevant page, or
an invitation to leave an email address so they can be contacted.
CONTEXT:
{relevant_chunks}
QUESTION: {user_question}
This approach of «responding solely based on context» is what distinguishes a reliable chatbot from a gimmick that invents non-existent prices and features.
Step 4: Embed the widget in WordPress
Option 1: Create a WordPress shortcode that loads a custom JavaScript widget (floating button, chat window, opening animation).
Option 2: Use Crisp, Intercom or Tidio as your chat interface, and integrate your RAG + LLM backend as a custom bot via their API.
Option 3: Use a turnkey solution such as Voiceflow or Botpress, which offer no-code interfaces and can be integrated with WordPress in 5 minutes.
Step 5: Test and calibrate
- Manually test over 100 typical questions from your visitors
- Check that the bot responds with «I don’t know» to topics outside its scope (no hallucinations)
- Adjust the system instructions (tone, limits, recommended CTAs)
- Set up human escalation for complex cases
How much does a WordPress AI chatbot cost?
The question of the budget comes up quickly. There are three options, and the API is the cheapest:
- LLM API : ~3 $ per million tokens processed by Claude. For a site with 1,000 conversations per month, you can usually expect 15 to 40 $ per month.
- Vector basis : free as a self-hosted solution (pgvector, Chroma), ~70 $ per month for a managed Pinecone instance with moderate traffic.
- Development and integration : that’s the actual cost, for once. A bespoke RAG chatbot, connected to your content and your CRM, usually costs a few thousand euros, depending on its complexity.
Expected results
- 80 %: frequently asked questions resolved without human intervention
- Average response time: 2–3 seconds (compared with 2–4 hours for a human)
- Available 24 hours a day, 7 days a week, 365 days a year
- +20 to +35 % qualified leads (the chatbot collects the information before passing it on)
A chatbot is often just the first building block. The RAG and n8n logic described here is the same as that used in AI agents that automate entire business processes, and it goes perfectly with the’E-commerce automation via Make and n8n. For an overview, see how AI is transforming the entire process of creating WordPress websites.
Building this system in-house takes time and requires expertise in large language models (LLMs). If you’d prefer a chatbot that’s up and running in a matter of weeks rather than months, this is exactly our AI chatbot service for websites.
Author
Walid SadfiWalid Sadfi is the founder of Evolurise, an agency specialising in bespoke WordPress development, AI integration and SEO. With eight years’ experience, he supports SMEs and large organisations in creating high-performance web platforms and automating their business processes using AI. On this blog, he shares practical, real-world insights on WordPress, WooCommerce, generative AI and technical SEO.