Skip to main content

Knowledge Base

The Knowledge Base lets you attach documents and web pages to an agent or project. When a user sends a message, Kopai searches these documents for relevant passages and includes them in the AI's context — a technique called Retrieval-Augmented Generation (RAG).

How it works

  1. You upload files or index URLs.
  2. Kopai splits the content into chunks and stores them in a vector database (Upstash).
  3. When the AI generates a response, it retrieves the top 5 most relevant chunks and includes them as context.

The AI will cite or reference these documents when they are relevant to the user's question.

Enabling the knowledge base

Open the Agent Builder → Capabilities tab. Toggle on Knowledge Base. The document management panel appears below.

:::note Save first The Knowledge Base panel only appears after you save your agent. If you see "Save your agent first to upload files", click Save in the header. :::

Uploading documents

Click Upload Files and select one or more files. Supported formats:

FormatFree planPro plan
PDF✅ (1 file, 2 MB max)
TXT / MD
Images (JPG, PNG, WEBP, GIF)

A spinner shows while the file uploads and indexes. Indexing may take a few seconds for large PDFs.

Indexing a URL

Paste a URL into the URL indexing field and click Index. Kopai fetches the page, extracts the text, and indexes it like a document.

:::note Pro plan feature URL indexing is available on Pro plans only. :::

Managing documents

Your indexed documents appear in a list. Each row shows the file name, size, and upload date (or the URL for indexed pages). Click the trash icon to delete a document.

Project knowledge base

Projects also have their own knowledge base. See Projects → for details.