packages/docs/plugin-registry/documents.md
The native documents feature provides a Retrieval-Augmented Generation (RAG) system for Eliza agents. It enables agents to retrieve relevant information from a document corpus and inject it into the LLM context.
Built-in runtime feature — documents is part of the elizaOS core runtime and is enabled by default. It is not a standalone plugin in the plugin registry; it loads automatically as part of the core plugin set.
The documents feature manages the full RAG pipeline:
Character Knowledge is enabled automatically in Eliza. No installation is required.
| Format | Description |
|---|---|
.txt | Plain text |
.md | Markdown |
.pdf | PDF documents (via @elizaos/plugin-pdf) |
.json | JSON data |
.csv | Comma-separated values |
.html | HTML pages (stripped to text) |
Navigate to Agent → Knowledge and upload documents through the file picker.
curl -X POST http://localhost:31337/api/documents \
-H "Authorization: Bearer $ELIZA_API_KEY" \
-F "[email protected]" \
-F "agentId=your-agent-id"
Place documents in the documents directory specified in eliza.json:
{
"documents": {
"directory": "./documents",
"autoIngest": true
}
}
{
"name": "MyAgent",
"documents": [
"This agent specializes in TypeScript and Node.js development.",
"The project uses elizaOS core version 2.x.",
{ "path": "./docs/api-reference.md" }
]
}
Existing character files that still contain knowledge are imported into documents on load.
| Setting | Description | Default |
|---|---|---|
documents.topK | Number of chunks to retrieve per query | 5 |
documents.minScore | Minimum similarity score (0–1) | 0.7 |
documents.chunkSize | Characters per chunk | 1000 |
documents.chunkOverlap | Overlap between adjacent chunks | 200 |
{
"documents": {
"topK": 5,
"minScore": 0.7,
"chunkSize": 1000,
"chunkOverlap": 200
}
}
By default, document embeddings use the local embedding model provided by @elizaos/plugin-local-inference (Nomic Embed Text v1.5). Eliza caps the embedding dimension to 384 (set via EMBEDDING_DIMENSION at boot). This runs entirely on-device — no API key required.
To use a different embedding model, configure it in eliza.json:
{
"embedding": {
"model": "nomic-embed-text-v1.5.Q5_K_M.gguf",
"dimensions": 384
}
}
At inference time, the documents provider:
# Knowledge blockThe provider runs early so relevant document snippets are available when the LLM generates its response.
# Knowledge
[Retrieved chunk 1]
[Retrieved chunk 2]
[Retrieved chunk 3]
The native documents feature registers the following actions:
| Action | Description |
|---|---|
DOCUMENT | List, search, read, write, edit, delete, or import documents via sub-actions |
// From any plugin with access to the runtime:
const service = runtime.getService("documents");
const results = await service.searchDocuments(message, undefined, "hybrid");