Prerequisites
Before setting up Knowledge management in AgentOS, ensure you have:- PostgreSQL database running and accessible - used for this example
- Required dependencies installed:
uv pip install agno - OpenAI API key configured (for embeddings)
- Basic understanding of Knowledge concepts
Example
This example demonstrates how to attach multiple Knowledge bases to AgentOS and populate them with content from different sources.agentos_knowledge.py
Screenshots
The screenshots below show how you can access and manage your different Knowledge bases through the AgentOS interface:

Knowledge ID
Each Knowledge instance registered with AgentOS gets a deterministicknowledge_id. This ID is generated from the combination of the instance’s name, database ID, and table name. The same inputs always produce the same ID, so it is stable across restarts.
Use knowledge_id in API calls to target a specific Knowledge instance:
Finding your Knowledge ID
The/knowledge/config endpoint returns all registered Knowledge instances with their IDs:
Backward compatibility
If you have a single Knowledge instance, you can omitknowledge_id from API calls. For multiple instances, you can also use the db_id query parameter, but knowledge_id is preferred as it uniquely identifies the instance even when multiple instances share the same database.
Best Practices
- Separate Knowledge by Domain: Create separate Knowledge bases for different topics (e.g., technical docs, FAQs, policies)
- Consistent Naming: Use descriptive names for your Knowledge bases that reflect their content
- Regular Updates: Keep your Knowledge bases current by regularly adding new content and removing outdated information
- Monitor Performance: Use different table names for vector storage to avoid conflicts
- Content Organization: Use the
nameparameter when adding content to make it easily identifiable - Use metadata for filtering and searching: Add metadata to your content to make it easier to find and filter
Troubleshooting
Knowledge base not appearing in AgentOS interface
Knowledge base not appearing in AgentOS interface
Ensure your knowledge base is properly added to the
knowledge parameter when creating your AgentOS instance.
Also make sure to attach a contents_db to your Knowledge instance.Database connection errors
Database connection errors
Verify your PostgreSQL connection string and ensure the database is running and accessible.
Content not being found in searches
Content not being found in searches
Check that your content has been properly embedded by verifying entries in your vector database table.