Overview
Context is the information your agent knows - documentation, company data, product details, FAQs, etc.
Add context in your dashboard - upload docs, add data, configure settings.
What Is Context?
Context is everything your agent can reference:
Without context: Generic responses, doesn't know your business
With context: Specific answers based on your docs and data
Example:
No Context:
- User: "What's your return policy?"
- Agent: "I'm not sure about the specific return policy."
With Context (uploaded docs):
- User: "What's your return policy?"
- Agent: "Our return policy allows returns within 30 days with receipt..."
Types of Context
1. Knowledge Base
What: Your company's information
Examples: Docs, FAQs, policies, guides
Format: Upload files or add URLs
2. Conversation History
What: Past messages in the current session
Automatic: Agent remembers the conversation
Use: Follow-up questions, maintaining context
3. Custom Data
What: Dynamic info passed when creating sessions
Examples: User name, account type, order history
Use: Personalized responses
Adding Context
Upload Documents (Dashboard)
- Go to your agent
- Click Context tab
- Click Upload Document
- Choose file (PDF, TXT, MD, DOCX)
- Agent indexes and can search it
Supported formats:
- PDF documents
- Text files (.txt, .md)
- Word documents (.docx)
- Web pages (via URL)
Add URLs
- Go to Context tab
- Click Add URL
- Enter website URL
- Agent crawls and indexes content
Good for:
- Documentation sites
- Help centers
- Product pages
- Blog posts
Paste Text
- Go to Context tab
- Click Add Text
- Paste your content
- Give it a name
- Save
Good for:
- FAQs
- Policies
- Quick reference
- Short guides
How Context Works
When a user asks a question:
- Agent searches your uploaded context
- Finds relevant sections
- Uses that information in the response
Example:
Uploaded: Product documentation
User asks: "How do I reset my password?"
Agent searches: Finds password reset section
Agent responds: Using info from your docs
Context Settings
Search Relevance
What: How closely content must match to be used
Default: 70% relevance
Adjust: If agent finds too little/too much
Lower threshold: More results, less precise
Higher threshold: Fewer results, more precise
Maximum Context Window
What: How much text agent can process at once
Default: 8,000 tokens (~6,000 words)
Increase: For complex questions needing more info
Trade-off: More context = higher cost
History Length
What: How many past messages to remember
Default: Last 50 messages
Adjust: Based on conversation length
Longer history: Better continuity, higher cost
Shorter history: Lower cost, less memory
Session Context (Advanced)
What It Is
Dynamic information passed when creating a session with Core SDK:
const session = await chat.createSession({
agentId: 'agent-123',
namespace: 'user-456',
workspace: {
user: {
name: 'John',
plan: 'premium',
lastOrder: '#12345'
}
}
});The agent now knows: User's name, plan, and last order.
Why Use It
Personalization: "Hi John, I see you're on our premium plan..."
Context-aware: "Your last order #12345 shipped yesterday..."
Dynamic: Different info for each user
See Core SDK - Sessions for implementation.
Best Practices
Good Context Documents
Do:
- ✅ Upload official documentation
- ✅ Keep content updated
- ✅ Use clear, well-structured docs
- ✅ Include FAQs and common issues
Don't:
- ❌ Upload irrelevant content
- ❌ Use outdated information
- ❌ Include sensitive data
- ❌ Make docs too long/unstructured
Organize Context
Use categories:
- Product docs
- Support FAQs
- Company policies
- Technical guides
Name files clearly:
- ✅ "password-reset-guide.pdf"
- ❌ "doc1.pdf"
Update Regularly
- Remove outdated docs
- Add new information
- Update changed policies
- Keep content fresh
Context Limits
Per Agent
- Documents: 100 files
- Total size: 50 MB
- URLs: 50 websites
- Text entries: Unlimited
Need more? Contact support for enterprise limits.
Performance
More context = slower search:
- Small context (1-5 docs): Fast
- Medium context (5-20 docs): Normal
- Large context (20+ docs): Slower
Optimize: Only upload relevant docs.
Privacy & Security
What Happens to Your Data
- Uploaded docs: Stored securely, encrypted
- Indexed: For search, not shared
- User conversations: Separate, not mixed with context
- Access: Only your agents see your context
Sensitive Information
Don't upload:
- Customer personal data
- API keys or passwords
- Financial records
- Confidential internal docs
Do upload:
- Public documentation
- Product information
- Help center content
- General policies
Monitoring Context Usage
In Activity Tab
See how context is used:
- Which docs are referenced most
- Search success rate
- Common queries
- Missing information (failed searches)
Use this to:
- Add missing docs
- Remove unused content
- Improve search relevance
Troubleshooting
Agent Can't Find Information
Problem: Agent says "I don't have that information"
Solutions:
- Check if doc is uploaded
- Lower relevance threshold
- Add more related docs
- Improve doc structure
Agent Gives Wrong Information
Problem: Agent references wrong or outdated info
Solutions:
- Update the doc
- Remove old versions
- Check for conflicting information
- Restructure content
Slow Responses
Problem: Agent takes long to respond
Solutions:
- Reduce number of docs
- Lower context window
- Remove large/complex files
- Split big docs into smaller ones
Common Use Cases
Customer Support
Context: Help docs, FAQs, policies
Result: Agent answers support questions accurately
Product Assistant
Context: Product docs, user guides, API reference
Result: Agent helps users learn your product
Internal Helper
Context: Company wiki, procedures, tools docs
Result: Agent helps employees find information
Sales Assistant
Context: Product specs, pricing, comparisons
Result: Agent answers prospect questions
Next Steps
Add context to your agent:
- Go to agent dashboard
- Click Context tab
- Upload your first document
- Test by asking related questions
- Add more content as needed
Learn more:
- Creating Agents - Set up your agent
- Tools - Enable agent actions
- Workspace - Configure environments
- Activity - Monitor context usage