OpenAgent

Add a Knowledge Base

Enable RAG so your assistant answers from your own documents.

Add a Knowledge Base

Transform a standard chat assistant into a Knowledge Assistant. By indexing your documents (PDFs, Markdown, etc.), your agent retrieves relevant passages at query time to provide grounded, accurate answers. This technique is known as RAG (Retrieval-Augmented Generation).

How RAG Works

Ingest — Documents are parsed and split into atomic chunks.
Embed — Each chunk is turned into a mathematical vector by an embedding provider.
Retrieve — At query time, the user's question is embedded and matched against the most similar chunks.
Generate — The retrieved chunks are injected into the LLM's context for a grounded response.

Steps to Enable RAG

Create an Embedding Provider

Go to Providers → Add Provider.

  • Category: Embedding
  • Type: e.g., OpenAI, Ollama, Jina, Cohere
  • Sub Type: text-embedding-3-small (Recommended for OpenAI)

Click Save. This provider handles the "translation" of your text into mathematical vectors.

Configure your Store

Edit your existing Store and link the embedding provider:

  • Embedding Provider: Select the provider you just created.
  • Knowledge Count: Set to 3 initially (adjust later based on accuracy).

Upload and Index Documents

Go to Files → Upload.

  1. Select your files (PDF, Docx, MD, etc.).
  2. Assign them to your Store.
  3. Click Upload.

Monitor the Status column. Once it says Finished, the content is indexed and ready for retrieval.

Verify in Chat

Open the Chat UI for your Store. Ask a question specifically about the uploaded content.

"Based on the uploaded manual, what is the procedure for X?"

Tuning for Accuracy

If the agent is missing information or giving vague answers, try these adjustments:

  • Increase Knowledge Count: Try raising it to 5 or 7 to give the model more context.
  • Adjust Split Strategy: If your files are highly structured (like FAQs), switch the Store's Split Provider to QA and re-upload.
  • Refine System Prompt: Tell the agent explicitly: "Always prioritize information from the knowledge base. If the answer is not in the documents, say you don't know."

Next Steps

On this page