A Knowledge Base is a tool that gives the reference data to Agent, which is critical capability for agent to generate more accurate and desired output. AI Agent Foundry offers 2 types of Knowledge Base, one is Database and the other is Text. Follow the instruction below to create a new Knowledge Base.
- Open Treasure Console.
- Navigate to AI Agent Foundry.
- Select Knowledge Base and then select Create knowledge base.

- Enter a Knowledge Base name specifying how it is used
- Select Database type, then select a database.

When creating a Database knowledge base, you can choose how query results are returned to the AI agent by selecting a Format type:
- Markdown-KV (Recommended)
- JSON (Legacy)

Markdown-KV is the recommended format for new knowledge bases. It returns query results in a human-readable format with headings and key-value pairs, making it easier for LLMs to understand. Since agent queries run with the user's own permissions (as of April 2026), access control is enforced at the permission level rather than through table filtering.
Key benefits:
- Format Type is designed to properly support Max rows and Timeout seconds settings
- Automatic truncation warnings appear when results exceed the Max rows limit, prompting the agent to refine queries with additional WHERE conditions
Configuration options:
- Max rows: Set the maximum number of rows returned (1-100, default: 50)
- Timeout seconds: Set the query timeout (10-300 seconds, default: 60)
JSON is the legacy format that will be deprecated in the future. Use this format only if you need to restrict the knowledge base to specific tables.
When to use JSON:
- Your database has many tables and you want to improve query performance
- Similar table or column names exist and you want to prevent agent confusion
- You need to limit the knowledge base to a specific set of tables (e.g., only
customersandorders). The Table configuration option is available to specify which tables to include.
Limitations:
- Max rows and Timeout seconds settings may be ignored in some cases
- No truncation warnings for the agent when results are cut off
Click Add table button to define the table information
Complete the form.
| Field | Description |
|---|---|
| Name | Enter a name for your knowledge base. |
| Type | Select Database. |
| TD Database Name | Enter the Treasure Data database where queries run. The database must exist in Plazma DB. |
| Table | Define the table that the knowledge base supports. |
| TD Query | Provide the Trino SQL that defines the table using the selected database.Exclude Columns: list every column you want to keep.Exclude Records: filter records with a WHERE clause. |
| Name | Enter the table name to reference. |
| + Add table | Select to add more tables to your knowledge base. |
- Select Save.
After you select Save , the data loading process starts. Before using the knowledge base, wait until it has a status of Success.
- Enter a Knowledge Base name specifying how it is used
- Select Text type, then complete the form

| Field | Description |
|---|---|
| Name | Enter a name for your knowledge base. |
| Type | Select Text. |
| Text-input | Enter up to 18,000 characters of reference text. |
Parent Segment Knowledge Base is automatically created when the "LLM enabled" switch is enabled on the Parent Segment Config. Currently, there is no way to create on the Custom LLM project.
Next Step
Check your Knowledge Base setup through query simulations.