// ADVANCED FEATURES

Knowledge Base (RAG)

4 min read Updated July 23, 2026

A knowledge base gives your AI private reference material to answer from. This pattern is called retrieval-augmented generation (RAG): at run time the plugin finds the passages in your knowledge base that best match the request and adds them to the prompt, so the model answers from your content instead of guessing.

Use it to ground the AI Model node and the Chatbot node in your product docs, policies, past articles, or any text you upload.

How it works

  1. You add content to a knowledge base. The plugin splits it into overlapping chunks.
  2. Each chunk is turned into a numeric vector (an embedding) using OpenAI’s text-embedding-3-small model.
  3. The vectors are stored in your own Supabase project, which uses the pgvector extension.
  4. When a node has a knowledge base selected, the plugin embeds the incoming request, finds the closest chunks by similarity, and prepends them to the prompt as a labelled reference block.

Retrieval is opt-in and fail-open. If a node has no knowledge base selected, nothing changes. If the store cannot be reached, the run continues without the extra context rather than failing.

What you need

  • A Supabase project (the free tier is enough to start). Supabase holds the vectors, not your WordPress database.
  • An OpenAI API key, used to generate the embeddings. Add it under AI provider and API settings.
  • A LlamaParse API key only if you plan to upload PDF, DOC, DOCX, or RTF files. Plain-text files do not need it.

One-time setup

  1. Open Settings > Knowledge Base Management and stay on the Supabase (RAG) tab.
  2. Paste your Supabase project URL and API key, and optionally a table name (the default is wpaw_documents). Save.
  3. Copy the setup SQL shown on the page and run it once in the Supabase SQL editor. It enables pgvector, creates the table, and adds the match function the plugin queries.
  4. Click Test connection. A green result means WordPress can reach Supabase and the match function exists.

Create a knowledge base

On the same tab, create a knowledge base and give it a name (for example “Support docs” or “Company policies”). A knowledge base is a labelled collection. You can keep several and select the right one per node.

Add content

Open a knowledge base and add content in any of three ways. You can mix them freely.

  • Paste text. Drop in any text and an optional title. Good for FAQs, notes, or copied passages.
  • WordPress content. Pick posts, pages, or any custom post type and ingest them. The title, rendered content, and a link back to each item are stored with the chunks.
  • Upload files. Upload TXT, MD, or CSV (read directly), or PDF, DOC, DOCX, and RTF (converted to text through LlamaParse first). The extracted text runs through the same chunk-and-embed pipeline, tagged with the file name.

Each time you add content the plugin reports how many chunks were stored, so you can confirm it worked.

Use it in a workflow or chatbot

Open an AI Model node or a Chatbot node, turn on its knowledge base option, and select which knowledge base to use. From then on, each run retrieves the most relevant passages and answers from them. If the answer is not in the retrieved passages, the model is instructed to say so rather than invent one.

OpenAI managed vector stores

The same Knowledge Base Management area also has an OpenAI Vector Stores tab. This is a separate, OpenAI-hosted option that powers the AI Model node’s file-search tool. Files you upload there are processed and hosted by OpenAI. Use the Supabase knowledge base when you want your content stored in your own project; use OpenAI vector stores when you prefer OpenAI’s managed file search.

Good to know

  • Vectors live in your Supabase project. Deleting a knowledge base removes its rows from Supabase and its entry in WordPress.
  • Embedding uses your OpenAI key, so ingesting large libraries has a small, one-time embedding cost on your OpenAI account.
  • Very large uploads are chunked automatically, so long PDFs and posts are fine.
Was this helpful? Contact us