Docusaurus to WordPress: Three Ways to Build AI Chat
I built three different AI chat architectures. Each one solves a different problem.
The goal is not to find the best tech. The goal is to match the tech to your target user.
- The Static Index (Docusaurus + Vercel) This approach uses a JSON file inside a static site. A build step turns your markdown files into a single index. The search runs in memory using a serverless function.
• Best for: Documentation sites you own. • Pros: Zero extra infrastructure. It is fast and cheap. • Cons: It does not scale. It works for small amounts of text only.
- The Scalable Service (Neon + pgvector) This uses a Postgres database with vector support. It uses real semantic search to find data quickly.
• Best for: SaaS products with many users. • Pros: It handles massive amounts of data. It supports multi-user accounts and history. • Cons: It requires managed infrastructure and more operational work.
- The Drop-in Plugin (WordPress) This version puts the vectors directly into the WordPress database. It uses PHP to perform a brute-force search over the text chunks.
• Best for: Clients who want a simple WordPress plugin. • Pros: No extra setup. It works on any WordPress host. It stays within the site database. • Cons: It is slower for very large datasets.
Key Takeaways:
- Match architecture to deployment. A WordPress plugin that requires a separate database is not a useful plugin.
- Start small. A static JSON index proves your user experience works before you build complex databases.
- Brute-force search is fine for small sites. For a few thousand passages, it is fast enough. Do not use complex vector engines until you must.
- Keep your code flexible. Use an interface for your vector store. This allows you to switch from JSON to Postgres without rewriting your app.
- Security matters. Encrypt API keys at every layer. Use a bring-your-own-key model so you do not handle sensitive user data.
Source: https://dev.to/kaidanov/from-docusaurus-mai-to-a-wordpress-ai-chat-with-vectors-41ba