Use Knowledge Base in an Agent
Sema4.ai Studio makes it easy to integrate Knowledge Base-powered logic into agents. After publishing your KB action package, the next step is to bring it into Studio and use the named queries inside a runbook.
Overview
The Knowledge Base appears as a data source once you've published your action package. Studio provisions and connects the KB when you add the package to an agent.
- You can call KB queries from within your runbook
- You can save responses and use them in downstream steps
- All results are grounded in your content and metadata
Step-by-step guide
Add KB action package to your agent
- Open your agent in Studio
- Click Add Action Package
- Select your Knowledge Base package
- Review and Click Add Actions
Configure Knowledge Base
You can configure the Knowledge Base settings, such as the model used for embeddings and metadata mappings if not already provisoned in the same Data Server.

Use a KB query in your runbook
To use your Knowledge Base in a runbook, add a step that calls a KB query action.
For example, you can pass a user's question to search your KB for relevant answers. Adjust parameters like relevance_threshold
to filter out less relevant results, and top_k
to limit the number of returned chunks. The query action returns the most relevant content from your Knowledge Base, which you can use directly or pass to subsequent steps in your runbook.
Test your Agent
Run your agent and test the KB query in the runbook. You should see results grounded in your Knowledge Base content.
Publish to Control Room
After successfully testing your agent, publish it to Control Room. This step makes your agent available for your team to deploy, allowing users to interact with it and benefit from Knowledge Base-powered, accurate, and context-aware responses.