# Creating a Knowledge Base 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. 1. Open TD Console. 2. Navigate to **AI Agent Foundry**. 3. Select **Knowledge Base** and then select **Create knowledge base**. ![](/assets/creating-an-ai-knowledge-base-2025-03-04.4d247864042e3ccc1a8e54da318cc7f77500db176ee71cc75ae1cf6b3981279f.91c26685.png) ## Create a Database Knowledge Base ### Enter Knowledge Base Details​ 1. Enter a Knowledge Base name specifying how it is used 2. Select Database type, then select a database. ![Database knowledge base configuration form](/assets/creating-a-knowledge-base-2025-06-13-11-30-28.1649163d16dbbc239f56459febdc3276d56d11663469e675a74893f24abdc4fc.91c26685.png) ### Enter Table Information 1. Click *Add table* button to define the table information 2. 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. | 1. Select **Save**. After you select **Save** , the data loading process starts. Before using the knowledge base, wait until it has a status of **Success**. ## Creating Text Knowledge Base ### Enter Knowledge Base Details​ 1. Enter a Knowledge Base name specifying how it is used 2. Select Text type, then complete the form ![Text knowledge base form](/assets/creating-a-knowledge-base-2025-06-13-11-37-11.285526b225e8d44ab56b1aacd3e7e0f4a47dc71196bdf0ed6b8d0465659525cc.91c26685.png) | Field | Description | | --- | --- | | Name | Enter a name for your knowledge base. | | Type | Select `Text`. | | Text-input | Enter up to 18,000 characters of reference text. | ## Creating Parent Segment Knowledge Base 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](/products/customer-data-platform/ai-agent-foundry/knowledgebase/querying-a-knowledge-base).