A WordPress RAG chatbot answers questions about your own posts, pages, and products by retrieving the most relevant passages from your content and passing them to a language model as context. Running that pipeline entirely with local models keeps both your content and your users’ questions on your own hardware. A documented all-local stack exists: export WordPress content to Markdown with wpexportjson, index it in a Markdown document database (mddbd), generate embeddings and answers with Ollama, and chat through Open WebUI [1]. This article explains how that pipeline works, what hardware it needs, the steps to build it, and where local setups tend to break.
What a WordPress RAG chatbot actually does
Retrieval-Augmented Generation (RAG) does not teach a model your website. It separates the problem into two phases that run at different times.
Indexing happens ahead of time. Your published content is pulled from WordPress, cleaned, split into chunks, converted into vector embeddings, and stored alongside the original text. Answering happens per question. The visitor’s question is embedded with the same embedding model, the store returns the closest chunks, and those chunks are inserted into the prompt the language model sees. The model then writes an answer grounded in the retrieved text rather than in its training data alone.
This differs from fine-tuning, which changes a model’s weights and is expensive to repeat. With RAG, updating the chatbot means re-running the index, not retraining anything. It also means the model never “knows” your site in a durable sense — it only reads what retrieval hands it, which is why retrieval quality dominates answer quality.
Two documented ways to build it
The reference implementations available differ mainly in where embeddings, vectors, and generation run.
| Aspect | All-local stack (MDDB guide) | n8n workflow template |
|---|---|---|
| Content source | WordPress REST API, exported to Markdown | WordPress REST API, published posts |
| Embeddings | Ollama, local | OpenAI text-embedding, 1536 dimensions |
| Vector storage | mddbd document database | Qdrant Cloud, or MongoDB Atlas |
| Chat interface | Open WebUI | WordPress plugin chat widget |
| Data leaves your machine | No | Yes |
| Reported setup time | Not stated in the guide | 15–25 min (Qdrant path); 1–2 h (MongoDB path) |
The all-local stack described in the MDDB guide keeps every component on a single machine. WordPress supplies the content; wpexportjson exports it to Markdown through the WordPress REST API; mddbd stores the documents and their vector embeddings; Ollama runs both the embedding model and the LLM; and Open WebUI provides the chat interface [1]. Nothing is sent to a third party.
The n8n workflow template takes a hybrid approach. It retrieves published posts through the WordPress REST API, extracts titles, URLs, post IDs, and slugs, splits the text into chunks of 1200 characters with 150 characters of overlap, generates embeddings with OpenAI’s text-embedding model, and stores the vectors in Qdrant Cloud — or, in the advanced path, MongoDB Atlas [2]. It ships a WordPress plugin with a customizable chat widget and reports setup times of roughly 15–25 minutes for the automated Qdrant path and 1–2 hours for the manual MongoDB path [2]. That route is faster to stand up, but content and queries leave your infrastructure.
Hardware and prerequisites for the local path
The MDDB guide publishes explicit requirements, which are the most useful starting point for planning.
| Resource | Minimum | Recommended |
|---|---|---|
| RAM | 16 GB | 32 GB |
| CPU | 4 cores | 8+ cores |
| GPU | None (CPU mode) | NVIDIA 8 GB+ VRAM (RTX 3060 or better) |
| Disk | 20 GB free | 50 GB SSD |
| OS | Linux / macOS / WSL2 | Linux (Ubuntu 22.04+) |
The guide is candid about the GPU tradeoff: Ollama works on CPU but is roughly ten times slower, producing responses in 10–30 seconds instead of 1–3 seconds on a supported NVIDIA GPU [1]. For CPU-only machines it recommends smaller generation models — llama3.2:3b rather than llama3.2:8b — and notes that the embedding model nomic-embed-text is lightweight and runs well on CPU [1].
On the WordPress side you need REST API access and credentials that can read published content. On the machine running the stack you need Docker and Docker Compose, because the guide ships the document database as a container.
Building the all-local stack, step by step
1. Export WordPress content to Markdown
Run wpexportjson against your site’s REST API to produce a Markdown export of your posts and pages. Check the output before importing: missing posts here become missing answers later, and it is easier to spot them in a folder of files than in a chat response.
2. Start the document database
The guide’s Compose file defines an mddb service built from ghcr.io/tradik/mddbd:latest, exposing port 11023 for the HTTP API and 11024 for gRPC [1]. Start it and confirm the API responds before moving on, so that a later failure can be attributed to the import rather than to the container.
3. Start Ollama and pull models
Ollama serves both the embedding model and the chat model. Pull an embedding model such as nomic-embed-text and a generation model sized to your hardware — llama3.2:3b on CPU-only machines, something larger if you have GPU headroom [1].
4. Import content and generate vectors
Import the Markdown export into the database and let it generate vectors through Ollama. This is the step that makes retrieval possible. If it fails silently, the chatbot will still produce fluent answers — it will simply produce them without your content, which is the most confusing failure mode in the whole pipeline.
5. Connect Open WebUI
Point Open WebUI at Ollama and at the document database so that a question triggers a search, returns documents, and passes them to the model as context [1].
6. Verify end to end
Ask a question whose answer appears verbatim in one specific post and confirm the response reflects that post rather than a generic answer. Then ask something your site does not cover and confirm the model admits it does not know. Both checks matter: the first catches broken retrieval, the second catches a model that is ignoring its context.
Chunking decisions that shape answer quality
The n8n template’s 1200-character chunks with 150-character overlap are a reasonable starting point and illustrate the tradeoff [2]. Chunks that are too large dilute the embedding and consume context window; chunks that are too small lose the surrounding sentence and produce fragments that are hard to ground an answer in. The overlap exists so a sentence split across a boundary still appears intact in at least one chunk.
A practical rule: if answers reference the correct post but the wrong paragraph, adjust chunk size before changing models. Retrieval problems look like model problems but rarely are.
Common failure points and how to diagnose them
- Responses take 10–30 seconds. This is expected on CPU-only hardware; the guide estimates a roughly tenfold slowdown versus GPU [1]. Reduce model size, or add a supported GPU if latency matters.
- Out-of-memory errors when loading a model. Model weights are not the only memory cost — context length and runtime overhead add to the total. Reduce model size or context length rather than only checking the file size.
- The bot answers but ignores your content. Usually the import or vector-generation step did not complete. Re-run it and confirm the database actually holds vectors.
- New posts are not reflected. RAG does not update itself. Re-export and re-index after publishing.
- The export fails. Check REST API credentials, user permissions, and whether the site or a security plugin blocks API access.
Work through these in order, from the cheapest check to the most involved. Confirming that the database holds vectors rules out half the possible causes before you touch model settings.
Tradeoffs: local versus hybrid
Local models trade capability for control. A 3-billion-parameter model running on CPU will be less fluent and less reliable than a frontier cloud model, and the gap is widest on multi-step or ambiguous questions. In exchange, content never leaves the machine, there are no per-token API fees, and the stack keeps working if a provider changes pricing or availability.
Licensing deserves separate attention. “Open weights,” “open source,” and “free for commercial use” are three different things. A model that is free to download is not automatically free to deploy in a commercial setting, so check the license of every model you ship.
The hybrid path is the mirror image: faster setup and stronger models, at the cost of sending content and queries to third parties and paying per use.
Deciding which path to take
Choose the all-local stack when content sensitivity, offline operation, or predictable cost matters more than peak answer quality, and when you meet the stated minimum hardware. Choose the hybrid n8n path when you want a working widget quickly, your content is already public, and cloud dependencies are acceptable.
Either way, budget time for re-indexing and for testing retrieval against real questions. That work, more than the choice of model, usually determines whether the chatbot is genuinely useful.
If you build either stack, consider sharing your hardware, model, chunk settings, and the questions that failed with the Ai-Forum community so others can compare configurations.
FAQ
Can I run a WordPress RAG chatbot without a GPU?
Yes. The MDDB guide lists GPU as optional and states that Ollama works in CPU-only mode. Expect roughly ten times slower generation — 10 to 30 seconds per response instead of 1 to 3 seconds — and use a smaller model such as llama3.2:3b. The embedding model nomic-embed-text is described as lightweight and suitable for CPU.
Does the chatbot update automatically when I publish a new post?
No. RAG retrieves from an index that was built earlier. After publishing, you need to re-export the content and re-run the indexing and vector-generation steps so the new material is available to retrieval.
Is the n8n workflow template fully local?
No. It uses OpenAI's text-embedding model for embeddings and stores vectors in Qdrant Cloud or MongoDB Atlas, so content and queries go to third-party services. The MDDB stack is the documented all-local alternative.
How much RAM do I need for the local stack?
The guide states a minimum of 16 GB and recommends 32 GB. Note that model weights are only part of memory use — context length and runtime overhead add to it, so a model that fits on disk may still not fit comfortably in memory.