What is a Knowledge Base?
A Knowledge Base is a document storage and retrieval system that allows your agents to access information from your files, documentation, and data during conversations. Instead of relying solely on pre-trained knowledge, agents can search and reference your specific company information. With a knowledge base, your agents can:- Answer specific questions - Provide accurate answers from your documentation
- Cite sources - Reference specific documents and sections
- Stay up-to-date - Access current information, not just training data
- Handle complex queries - Search across multiple documents
- Reduce hallucinations - Ground responses in actual data
Knowledge Base Architecture
Collections
Collections are organizational containers that group related files together. They work like folders, helping you organize your knowledge base by topic, department, or use case. Examples:- Product Documentation
- Company Policies
- FAQ Database
- Technical Support Guides
- Sales Playbooks
Files
Files are the documents you upload to your knowledge base. Supported formats include:- PDF documents
- Text files (.txt)
- Markdown files (.md)
- Word documents (.docx)
- HTML files
Many-to-Many Relationship
Files can belong to multiple collections, and collections can contain multiple files. This allows flexible organization:Setting Up Your Knowledge Base
Step 1: Create Collections
Organize your knowledge base with collections:Step 2: Upload Files
Upload files using a two-step process: 2a. Generate Presigned URL:Step 3: Add Files to Collections
Link uploaded files to collections:Step 4: Enable in Agent
Configure your agent to use the knowledge base:File Processing
Processing States
After upload, files go through processing:- PENDING - File uploaded, processing not started
- PROCESSING - File being indexed and embedded
- COMPLETED - File ready for search
- FAILED - Processing error occurred
Checking File Status
Monitor processing status:Processing Time
File processing time depends on:- File size
- File format
- Document complexity
- Current system load
- Small PDFs (< 10 pages): 10-30 seconds
- Medium PDFs (10-100 pages): 30-120 seconds
- Large PDFs (> 100 pages): 2-5 minutes
Using Knowledge Base in Conversations
Automatic Search
When enabled, agents automatically search the knowledge base when:- Customer asks a specific question
- Information isn’t in the agent’s training data
- Agent needs to verify details
- Customer requests documentation
Prompt Engineering for Knowledge Base
Guide your agent to use the knowledge base effectively:Managing Your Knowledge Base
Listing Collections
Listing Files
Removing Files from Collections
Deleting Files
Best Practices
Content Organization
- Use descriptive collection names - Make it easy to identify content
- Group related content - Keep similar documents together
- Avoid duplication - Use shared files across collections instead
- Regular maintenance - Remove outdated documents
- Version control - Include version numbers in file names
Document Preparation
- Clear structure - Use headings, sections, and lists
- Consistent formatting - Maintain uniform document styles
- Remove unnecessary content - Strip out navigation, headers, footers
- Include metadata - Add titles, dates, and version numbers
- Plain language - Write clearly and concisely
File Naming
Good file naming conventions help with organization and retrieval:Search Optimization
- Include key terms - Use terminology your customers use
- Add context - Provide background information in documents
- Answer questions directly - Structure content as Q&A when possible
- Cross-reference - Link related topics
- Update regularly - Keep information current
Agent Configuration
- Explicit instructions - Tell agents when to search knowledge base
- Cite sources - Require agents to reference documents
- Handle not found - Define what to do when information isn’t found
- Combine with tools - Use knowledge base alongside custom tools
- Test thoroughly - Verify agents find correct information
Common Use Cases
Technical Support
Answer product questions with accurate technical documentation
Policy Information
Provide current company policies, terms, and procedures
Product Catalog
Share detailed product specs, features, and comparisons
FAQ Automation
Answer common questions with consistent, accurate responses
Training Materials
Access training guides and educational content
Compliance
Reference regulatory requirements and compliance guidelines
Limitations & Considerations
File Limits
- Maximum file size: 50 MB per file
- Maximum files per organization: Varies by plan
- Supported formats: PDF, TXT, MD, DOCX, HTML
Search Performance
- Search time: Typically 1-3 seconds
- Relevance: Depends on query specificity and document quality
- Context window: Limited amount of text can be returned
Processing Constraints
- Large files take longer to process
- Complex formatting may affect extraction quality
- Scanned PDFs require OCR (slower processing)
Troubleshooting
File Won’t Upload
Check:- File size under limit
- Supported file format
- Valid file content
- Presigned URL not expired
File Stuck in PROCESSING
Wait: Most files process within 5 minutes If still stuck after 10 minutes:- Delete and re-upload the file
- Check file format and content
- Contact support with file ID
Agent Not Finding Information
Verify:- File status is COMPLETED
- useKnowledgeBase is true
- knowledge-search tool is enabled
- Agent prompt includes search instructions
- Add more specific keywords to documents
- Restructure content for clarity
- Upload additional relevant files
- Refine agent search instructions
Irrelevant Search Results
Solutions:- Improve document quality and structure
- Add more context to documents
- Use more specific file prompts
- Refine agent search queries in prompts