Overview
Knowledge tools enable your AI persona to search uploaded documents and provide accurate, source-based answers using Retrieval-Augmented Generation (RAG). Instead of relying only on the LLM’s training data, your persona can access your organization’s specific documentation, policies, and knowledge base. This guide covers how to create and optimize knowledge tools for maximum accuracy and relevance.Prerequisites
Before creating knowledge tools, you need:- Knowledge folders created (see Knowledge Base Setup)
- Documents uploaded and in READY status
- Basic understanding of RAG concepts (see Knowledge Base Overview)
Creating a Knowledge Tool
- Stateful (Database-Saved)
Create reusable tools in the Anam Lab that can be attached to multiple personas.
1
Create the tool
Navigate to
/tools in the Anam Lab and create your knowledge tool:- Click Create Tool
- Select Knowledge Tool
-
Fill in the configuration:
- Name:
search_product_docs(snake_case) - Description: Clear description of when to use this tool
- Knowledge Folders: Select one or more folders
- Name:
- Click Create Tool
The tool is now saved with a unique ID and appears in your organization’s tool library.
2
Attach tool to persona
Navigate to
/build/{personaId} and attach the tool:- Scroll to the Tools section
- Click Add Tool
- Select
search_product_docsfrom the dropdown - Save the persona
The tool is now attached to this persona. When you create sessions with this persona, the tool will automatically be available.
3
Use in session
Create a session using the persona ID:
Stateful tools are ideal when you want to reuse the same tool across multiple personas or manage tools centrally.
How Knowledge Tools Work
When the AI needs information to answer a question, it uses a knowledge tool to search your documents.1
User asks a question
User: “How do I authenticate API requests?”
2
AI decides to search
The AI determines the question requires information from your documentation and automatically formulates a search query.
The AI is smart about searching. It looks for the meaning behind the user’s question, not just literal keywords.
3
System finds relevant content
The system searches the folders associated with the tool and retrieves the most relevant snippets from your documents.
4
AI generates a response
The AI uses the retrieved information to construct an accurate, conversational answer.“To authenticate API requests, you’ll need to include your API key in the Authorization header like this:
Authorization: Bearer YOUR_API_KEY. You can get an API key from your dashboard.”The user receives an answer grounded in your specific documentation.

