If you don’t set corpus on the agent or in the request, the agent can use all knowledge your organization or teamspace can access. You don’t need to pass a list—just call converse and the agent has access to everything in scope.You can set corpus when you create or update an agent, or override it per request in the converse config.
To limit the agent to certain knowledge bases or pages, pass a corpus array. Each item is either a knowledge base or a page. This works in the agent config or in config on a converse call.
import osfrom datagrid_ai import Datagridclient = Datagrid(api_key=os.environ.get("DATAGRID_API_KEY"))# Use only these knowledge sources for this requestresponse = client.converse( prompt="Summarize our Q4 policy updates", config={ "corpus": [ {"type": "knowledge", "knowledge_id": "kn_abc123"}, {"type": "page", "page_id": "page_xyz789"} ] })
import Datagrid from 'datagrid-ai';const client = new Datagrid({ apiKey: process.env['DATAGRID_API_KEY']});// Use only these knowledge sources for this requestconst response = await client.converse({ prompt: 'Summarize our Q4 policy updates', config: { corpus: [ { type: 'knowledge', knowledge_id: 'kn_abc123' }, { type: 'page', page_id: 'page_xyz789' } ] }});
For situations that call for predictable behavior and to avoid exposing more knowledge than intended, set corpus explicitly instead of relying on the default. That way the agent only uses the knowledge you specify.
Assistant
Responses are generated using AI and may contain mistakes.