Knowledge Base Tool
The Knowledge Base tool connects your agent to your document collections, enabling it to search and retrieve relevant information during conversations. This technique, known as RAG (Retrieval-Augmented Generation), grounds your agent's responses in your actual content rather than relying solely on its training data.

How It Works
User: "What's your return policy?"
↓
Agent searches: Knowledge base for "return policy"
↓
System retrieves: Relevant chunks from your documents
↓
Agent responds: Based on your actual policy documentThe RAG Process
- Query Understanding - Agent interprets the user's question
- Semantic Search - System finds relevant document chunks by meaning, not just keywords
- Context Injection - Retrieved content is added to the agent's context
- Grounded Response - Agent answers based on retrieved information
Why RAG Matters
Without RAG, an agent only knows what's in its training data (which has a cutoff date and doesn't include your company's information). With RAG, the agent can answer questions about your specific products, policies, and procedures.
Setting Up the Knowledge Base Tool
Prerequisites
Before configuring this tool, you need a Knowledge Base with indexed documents. See Knowledge Base for setup instructions.
Configuration
- Navigate to Agent Configuration > Tools
- Find Knowledge Base section
- Select the knowledge base to connect
- Configure search parameters
- Save changes
Search Parameters
| Parameter | Description | Default |
|---|---|---|
| Number of results | How many document chunks to retrieve | 5 |
| Similarity threshold | Minimum relevance score (0-1) | 0.7 |
| Include metadata | Return document titles and sources | Yes |
Tuning Results
- More results = More context but higher token usage
- Higher threshold = More precise but may miss relevant content
- Start with defaults and adjust based on answer quality
Best Practices
1. Quality In = Quality Out
The agent's answers are only as good as your indexed documents:
| Document Quality | Result |
|---|---|
| Clear, well-written content | Accurate, helpful answers |
| Outdated information | Incorrect answers |
| Inconsistent formatting | Unpredictable results |
| Missing topics | "I don't know" responses |
Keep Documents Updated
When policies or product information change, update your Knowledge Base immediately. The agent will continue citing old information until documents are updated.
2. Structure Documents Effectively
The system splits documents into chunks for retrieval. Help this process:
✅ Good structure:
# Return Policy
## Timeframe
You can return items within 30 days of purchase.
## Condition Requirements
Items must be unused and in original packaging.
## Refund Process
Refunds are processed within 5-7 business days.❌ Poor structure:
Our return policy allows returns within 30 days items
must be unused in original packaging refunds take 5-7 days
we also offer exchanges contact support for help...3. Guide Agent Behavior
Configure how your agent uses the Knowledge Base in its instructions:
## Using Knowledge Base
- Always search the knowledge base before saying you don't know something
- If the knowledge base doesn't have relevant information, say:
"I don't have specific information about that in my resources.
Would you like me to connect you with a team member?"
- Cite sources when helpful: "According to our return policy..."
- Don't make up information not found in the knowledge base4. Handle "Not Found" Gracefully
When the knowledge base doesn't have an answer:
## When Information Isn't Available
If you can't find relevant information:
1. Acknowledge honestly: "I don't have that specific information."
2. Offer alternatives: "I can help you with X, Y, or Z instead."
3. Provide escalation: "Would you like me to connect you with support?"
Never invent answers. It's better to say "I don't know" than to provide
incorrect information.5. Combine with Other Tools
Knowledge Base works well alongside other tools:
| Scenario | Tools Combined |
|---|---|
| Product info + pricing | Knowledge Base + API (price lookup) |
| FAQ + current promotions | Knowledge Base + API (promotions service) |
| Policy + order status | Knowledge Base + API (order system) |
Limitations
Retrieval Limitations
- Semantic vs. exact match - May not find content requiring exact keyword matches
- Chunk boundaries - Information split across chunks may lose context
- Embedding quality - Unusual terminology may not embed well
Response Limitations
- Hallucination risk - Agent might extrapolate beyond retrieved content
- Contradiction handling - May struggle with conflicting information
- Complex reasoning - Multi-step logical deductions may be unreliable
Mitigating Limitations
- Use clear, consistent terminology in documents
- Keep related information together
- Add explicit "do not hallucinate" instructions
- Test with real user questions
Monitoring and Improvement
Track Common Questions
Review conversation logs to identify:
- Questions with poor answers → Add better content
- Unanswered questions → Add missing topics
- Misunderstood questions → Improve terminology
Iterate on Documents
- Launch with initial document set
- Monitor conversation quality
- Identify gaps and issues
- Update documents accordingly
- Re-index when documents change
- Repeat the improvement cycle
Troubleshooting
Agent Ignores Knowledge Base
- Check if the tool is enabled
- Verify the knowledge base has indexed documents
- Review tool description—is it clear when to use it?
- Test with a direct question you know is in the documents
Irrelevant Results
- Lower the number of results
- Raise the similarity threshold
- Check document quality and structure
- Ensure search queries match document terminology
Outdated Answers
- Verify source documents are current
- Re-index after updating documents
- Check that old versions aren't still present
Missing Information
- Confirm the topic is in your documents
- Check chunk size—information may be split awkwardly
- Try rephrasing the test question
- Consider adding explicit coverage of the topic
Related Documentation
- Knowledge Base - Creating and managing knowledge bases
- Tools Overview - Understanding agent tools
- API Integration - Real-time data fetching
- Website Scraping - Import web content to knowledge base
