Knowledge
.
What is Contents DB?
Contents DB is a table in your database that keeps track of what content you’ve added to your Knowledge base. While your vector database stores the actual content for search, this table tracks what you’ve added, when you added it, and its processing status.- Vector Database: Stores embeddings and chunks for semantic search
- Contents Database: Tracks content metadata, status, and when coupled with AgentOS Knowledge, provides management of your knowledge via API.
Why Use ContentsDB?
Content Visibility and Control
Without ContentsDB, managing your knowledge and vectors is difficult - you can search it, but you can’t manage individual pieces of content or alter all the vectors created from a single piece of content. With ContentsDB, you gain full visibility:- See all content that has been added
- Track processing status of each item
- View metadata and file information
- Monitor access patterns and usage
Powerful Management Capabilities
- Edit names, descriptions and metadata for existing content
- Delete specific content and automatically clean up associated vectors
- Update content without rebuilding the entire knowledge base
- Batch operations for managing multiple content items
- Status tracking to monitor processing success/failure
Required for AgentOS
If you’re using AgentOS, ContentsDB is mandatory for the Knowledge page functionality. The AgentOS web interface relies on ContentsDB to display and manage your knowledge content.Setting Up ContentsDB
Choose Your Database
Agno supports multiple database backends for ContentsDB:- PostgreSQL - Recommended for production
- SQLite - Great for development and single-user applications
- MySQL - Enterprise-ready relational database
- MongoDB - Document-based NoSQL option
- Redis - In-memory option for high performance
- In-Memory - Temporary storage for testing
- Cloud Options - DynamoDB, Firestore, GCS
Basic Setup Example
Alternative Database Examples
Core Functionality
Contents DB Schema
If you have a Contents DB configured for your Knowledge, the content metadata will be stored in a contents table in your database. The schema for the contents table is as follows:Field | Type | Description |
---|---|---|
id | str | The unique identifier for the content. |
name | str | The name of the content. |
description | str | The description of the content. |
metadata | dict | The metadata for the content. |
type | str | The type of the content. |
size | int | The size of the content. Applicable only to files. |
linked_to | str | The ID of the content that this content is linked to. |
access_count | int | The number of times this content has been accessed. |
status | str | The status of the content. |
status_message | str | The message associated with the status of the content. |
created_at | int | The timestamp when the content was created. |
updated_at | int | The timestamp when the content was last updated. |
external_id | str | The external ID of the content. Used when external vector stores are used, like LightRAG. |
Content Metadata Tracking
Content Retrieval and Management
Management Features
Content Deletion with Vector Cleanup
Delete content and automatically clean up associated vectors: This automatically:- Removes the content metadata from ContentsDB
- Deletes associated vectors from the vector database
- Maintains consistency between both databases
Filtering and Search
ContentsDB enables powerful filtering capabilities:AgentOS Integration
Required Setup for AgentOS
When using AgentOS, ContentsDB is mandatory for the Knowledge management interface:AgentOS Features Enabled by ContentsDB
With ContentsDB, the AgentOS Knowledge page provides:- Content Browser: View all uploaded content with metadata
- Upload Interface: Add new content through the web UI
- Status Monitoring: Real-time processing status updates
- Metadata Editor: Update content metadata through forms
- Content Management: Delete or modify content entries
- Search and Filtering: Find content by metadata attributes
- Bulk Operations: Manage multiple content items at once