Knowledge Base
What is a Knowledge Base
A knowledge base refers to a database or knowledge graph that stores and organizes large amounts of structured or unstructured information. These knowledge bases contain various types of information, such as facts, concepts, relationships, rules, etc., enabling AI systems to understand the world, answer questions, make decisions, and perform other tasks.
Knowledge bases play an important role in AI. They can be specifically built for a particular domain or task, or they can be general knowledge bases. Examples of some knowledge bases include:
- Linguistic knowledge bases: Contain information such as vocabulary, grammatical rules, semantic relationships, etc., helping AI systems understand and generate natural language.
- Domain knowledge bases: Contain expert knowledge in specific domains, such as medical knowledge bases, financial knowledge bases, etc., used to support intelligent applications in related domains.
- Commonsense knowledge bases: Contain everyday commonsense information, assisting AI systems in making logical reasoning and decisions.
The establishment and maintenance of knowledge bases typically require substantial manual effort and professional expertise. However, once established, they can serve as critical resources for AI systems, providing Agents with rich background knowledge and information support, thereby enhancing the system's intelligence level and application capabilities.
How to Build a Knowledge Base
Enter AI+
- Go to Cloud Development AI+
- Agent Creation: Create an Agent Instance
Create a Knowledge Base
By creating a knowledge base and uploading collected relevant information, you can build a private knowledge base and connect it to the Agent. This provides the Agent with available information, thereby assisting it in making better inferences.
Go to the corresponding Agent configuration page and click Knowledge Base

Go to the knowledge base management page and click the add button.

Click New, and fill in the knowledge base name and description.

After saving, you can view the newly created knowledge base.

Upload Content
Once a knowledge base is created, you can populate it with knowledge by uploading files.
Currently supported file formats include:
- Text content written in markdown format, with the file extension being .md
- pdf files, with the file extension being .pdf
- docx files, with the file extension being .docx

After uploading files, you can view the files added to the knowledge base. Upon addition, files undergo a parsing and processing phase. The content within the files becomes searchable by the Agent only after this parsing and processing is complete.

Use in the Agent
const msg = "user question"
const knowledgeBase = ["Knowledge Base ID-1", "Knowledge Base ID-2"]
const result = await this.botContext.bot.tools.searchKnowledgeBase(
this.botContext.info.botId,
msg,
knowledgeBase
);
if (result?.code && result?.code?.length !== 0) {
throw new Error(`Failed to query knowledge base content: ${result?.message}`);
}
Test Knowledge Base Query Performance
Ask questions via conversation:

You can enable the DeepSeek R1 model to observe knowledge base information included in the reasoning chain output, proving the test results are correct. Proceed to create the Application Release according to the configured AgentUI application solution.
Manage Knowledge Base via API
Automated management of knowledge base documents can be achieved via API, supporting features such as creation, deletion, and batch operations.
Frequently Asked Questions
For questions related to the knowledge base, please refer to Frequently Asked Questions