Skip to main content
Learn how to use the Knowledge Plugin with practical examples that actually work.

How Knowledge Actually Works

The Knowledge Plugin allows agents to learn from documents in three ways:
  1. Auto-load from docs folder (recommended for most use cases)
  2. Upload via Web Interface (best for dynamic content)
  3. Hardcode small snippets (only for tiny bits of info like “hello world”)

Basic Character Examples

Example 1: Document-Based Support Bot

Create a support bot that learns from your documentation:
characters/support-bot.ts
Setup your support docs:
When you start the agent, it will automatically:
  1. Load all documents from the docs folder
  2. Process them into searchable chunks
  3. Use this knowledge to answer questions

Example 2: API Documentation Assistant

For technical documentation:
characters/api-assistant.ts
Organize your API docs:

Example 3: Simple Info Bot (Hello World Example)

For very basic, hardcoded information only:
characters/info-bot.json
Note: The knowledge array is only for tiny snippets. For real documents, use the docs folder!

Real-World Setup Guide

Step 1: Prepare Your Documents

Create a well-organized docs folder:

Step 2: Configure Auto-Loading

.env

Step 3: Start Your Agent

The agent will:
  • Automatically find and load all documents
  • Process PDFs, text files, markdown, etc.
  • Create searchable embeddings
  • Log progress: “Loaded 23 documents from docs folder on startup”

Using the Web Interface

Uploading Documents

  1. Start your agent: elizaos start
  2. Open browser: http://localhost:3000
  3. Select your agent
  4. Click the Knowledge tab
  5. Drag and drop files or click to upload
Best for:
  • Adding documents while the agent is running
  • Uploading user-specific content
  • Testing with different documents
  • Managing (view/delete) existing documents

What Happens When You Upload

When you upload a document via the web interface:
  1. The file is processed immediately
  2. It’s converted to searchable chunks
  3. The agent can use it right away
  4. You’ll see it listed in the Knowledge tab

How Agents Use Knowledge

When users ask questions, the agent automatically:

The Knowledge Provider

The knowledge plugin includes a provider that automatically injects relevant knowledge into the agent’s context:

Configuration Examples

Production Support Bot

.env

Development Setup

.env

Best Practices

DO: Use the Docs Folder

Recommended approach for most use cases:

DO: Use Web Upload for Dynamic Content

When to use the web interface:
  • User-uploaded content
  • Frequently changing documents
  • Testing different documents
  • One-off documents

DON’T: Hardcode Large Content

Avoid this:
Instead, use files:

Testing Your Setup

Quick Verification

  1. Check the logs when starting:
  2. Ask the agent about your documents:
  3. Use the Knowledge tab to see all loaded documents

Troubleshooting

No documents loading?
  • Check LOAD_DOCS_ON_STARTUP=true is set
  • Verify docs folder exists and has files
  • Check file permissions
Agent not finding information?
  • Ensure documents contain the information
  • Try more specific questions
  • Check the Knowledge tab to verify documents are loaded

Summary

  1. For production: Use the docs folder with auto-loading
  2. For dynamic content: Use the web interface
  3. For tiny snippets only: Use the knowledge array
  4. The agent automatically searches knowledge - no special commands needed

Quick Start

Get started in 5 minutes