Using Knowledge Bases
This guide walks through the complete knowledge base workflow—from creation to agent integration.
Creating a Knowledge Base
Every KB starts with a name and optional description. Use the create method:
The response contains the KB ID you’ll use for all subsequent operations:
Retrieving KB Details
Single Knowledge Base
get() retrieves the full details of a specific KB:
Returns the full KB object:
All Knowledge Bases
list() returns every KB in your organization:
Linking a KB to an Agent
The connection happens at agent creation time. Pass kb_id to the new_agent helper:
The agent now has access to all content in that knowledge base during conversations.
Verifying the Link
get_agent_by_id() returns the agent with its globalKnowledgeBaseId field:
The response includes the linked KB ID:
Deleting a Knowledge Base
A knowledge base cannot be deleted while it’s connected to an agent. Delete or archive the agent first.
Use delete_agent() to archive the agent, then delete() to remove the KB:
SDK Reference
Tips
Can I link multiple KBs to one agent?
Currently, each agent supports one knowledge base via globalKnowledgeBaseId. For multiple knowledge sources, combine them into a single KB before linking.
What file types can I upload?
PDF files are fully supported. Text upload is available but may require backend deployment. Check with your administrator.
How do I update KB content?
Upload new documents to the same KB. The agent will automatically use the updated content in future conversations.
Why can't I delete my KB?
The error “This knowledge base is connected to an agent” means you must delete or archive the linked agent first. KBs with active connections cannot be removed.

