Skip to content

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.

Knowledge Base Tool configuration

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 document

The RAG Process

  1. Query Understanding - Agent interprets the user's question
  2. Semantic Search - System finds relevant document chunks by meaning, not just keywords
  3. Context Injection - Retrieved content is added to the agent's context
  4. 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

  1. Navigate to Agent Configuration > Tools
  2. Find Knowledge Base section
  3. Select the knowledge base to connect
  4. Configure search parameters
  5. Save changes

Search Parameters

ParameterDescriptionDefault
Number of resultsHow many document chunks to retrieve5
Similarity thresholdMinimum relevance score (0-1)0.7
Include metadataReturn document titles and sourcesYes

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 QualityResult
Clear, well-written contentAccurate, helpful answers
Outdated informationIncorrect answers
Inconsistent formattingUnpredictable 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:

markdown
# 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:

markdown
## 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 base

4. Handle "Not Found" Gracefully

When the knowledge base doesn't have an answer:

markdown
## 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:

ScenarioTools Combined
Product info + pricingKnowledge Base + API (price lookup)
FAQ + current promotionsKnowledge Base + API (promotions service)
Policy + order statusKnowledge 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

  1. Launch with initial document set
  2. Monitor conversation quality
  3. Identify gaps and issues
  4. Update documents accordingly
  5. Re-index when documents change
  6. 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