Knowledge Bases
Overview
A knowledge base is your own collection of documents, indexed so a model can retrieve and use them at request time through RAG. You manage knowledge bases from a dedicated screen — create, update, and delete them independently of any API proxy.
Supported Document Types
- Plain text (
.txt,.md) — paste directly or upload the file - PDF (
.pdf) — content is automatically extracted to text; if a single document fails to extract, the rest of the upload still succeeds - Excel (
.xlsx,.xls) — every sheet and row is processed individually, and each cell's value is turned into text together with the sheet and row it came from, so a single chunk stays meaningful on its own. A formula cell contributes the result value the workbook last computed and saved, never the formula text itself.
Three ceilings keep an oversized workbook from exhausting memory: at most 50 sheets, at most 20,000 rows per sheet, and at most 5,000,000 characters across the whole workbook. Reaching a ceiling doesn't stop indexing — everything read up to that point is indexed, with a visible note appended to the end of the text marking where it was cut; the document is not treated as an error, it's indexed with partial content. A password-protected Excel file cannot be indexed and is treated as an error.
How a Knowledge Base Is Built
From the AI Gateway menu, open RAG, switch to the Knowledge Bases tab and click Add Knowledge Base. Fill in the form:
| Field | Description | Required |
|---|---|---|
| Name | The name you pick when configuring RAG. | Yes |
| Description | A free-text note. | No |
| Vector Database | The vector database connection the embeddings are stored in. | Yes |
| Embedding Provider | The provider that generates the embeddings. Only providers that support embeddings are listed. | Yes |
| Embedding Model | The embedding model of that provider. | Yes |
| Collection Name | The collection that holds this knowledge base's vectors in the vector database. | Yes |
| Chunk Size | The length of each passage in characters, from 100 to 8192. | No (default 1000) |
| Chunk Overlap | The number of characters that consecutive passages share. | No (default 200) |
You can add documents on the same form; they are uploaded when you save.
Upload text, PDF, or Excel files. PDF and Excel content is automatically extracted to text; if a single document fails to extract, the rest of the upload still succeeds.
Each document is automatically split into smaller passages using the Chunk Size and Chunk Overlap values, rather than being searched as one large block of text.
Chunks are embedded and stored in your vector database, ready to be searched at request time. If the collection already exists with a different vector dimension than the embedding model produces, the document fails. See Vector Dimension Mismatch.
View, update, or delete documents and chunks from the knowledge base screen at any time. Each knowledge base shows a status: Active, Indexing or Error. On the knowledge base page, Reindex deletes its existing vectors and recreates them from its documents; while it runs, click Refresh for the latest progress. To start from an existing setup, use Duplicate in the row menu of the list.
Vector Dimension Mismatch
A collection keeps one vector dimension. If a document is embedded with a model that produces another dimension, indexing fails. The document row shows this message:
Vector dimension mismatch: the collection has dimension X, the embedding model produces Y. Use a collection with the model's dimension or a model with the collection's dimension.
X is the dimension of the existing collection. Y is the dimension that the embedding model produces. Apinizer does not delete or recreate the collection. Use a collection that has the dimension of the model, or select a model that produces the dimension of the collection. The message is shown in English on all screen languages. Apinizer checks the dimension for Qdrant, pgvector and Redis collections.
A Lighter Alternative to Fine-Tuning
Fine-tuning bakes knowledge into a model and requires retraining every time your data changes. A knowledge base lets you add, update, or remove information at any time — the next request simply retrieves the latest content, with no retraining or redeployment of the model itself.
Using a Knowledge Base
Once created, a knowledge base is attached to a RAG policy so incoming requests can retrieve from it — see Retrieval-Augmented Generation (RAG). A single request can also be scoped to one specific knowledge base rather than every knowledge base in a project.
Deleting a knowledge base is not blocked by any dependency check. The delete confirmation shows, best-effort, how many RAG policies currently reference the knowledge base's collection — but that count is informational only, not a gate: whether it loads or not (it silently shows nothing if the lookup fails), confirming Delete removes the knowledge base immediately.
Deletion also permanently purges the knowledge base's records from the vector database. If no other knowledge base shares its collection, the entire collection is removed; if one does, only this knowledge base's own records are removed and the shared collection is preserved.
If a deployed RAG policy still references the deleted knowledge base or its collection, that policy starts failing — and blocking — every subsequent request; see the fail-closed behavior on the Retrieval-Augmented Generation (RAG) page. Update or remove any RAG policy that depends on a knowledge base before deleting it.
Knowledge bases and their documents can also be managed through the APIops REST API; see API Reference: Knowledge Bases.