Agents

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)

  1. Go to your agent
  2. Click Context tab
  3. Click Upload Document
  4. Choose file (PDF, TXT, MD, DOCX)
  5. Agent indexes and can search it

Supported formats:

  • PDF documents
  • Text files (.txt, .md)
  • Word documents (.docx)
  • Web pages (via URL)

Add URLs

  1. Go to Context tab
  2. Click Add URL
  3. Enter website URL
  4. Agent crawls and indexes content

Good for:

  • Documentation sites
  • Help centers
  • Product pages
  • Blog posts

Paste Text

  1. Go to Context tab
  2. Click Add Text
  3. Paste your content
  4. Give it a name
  5. Save

Good for:

  • FAQs
  • Policies
  • Quick reference
  • Short guides

How Context Works

When a user asks a question:

  1. Agent searches your uploaded context
  2. Finds relevant sections
  3. 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:

  1. Check if doc is uploaded
  2. Lower relevance threshold
  3. Add more related docs
  4. Improve doc structure

Agent Gives Wrong Information

Problem: Agent references wrong or outdated info

Solutions:

  1. Update the doc
  2. Remove old versions
  3. Check for conflicting information
  4. Restructure content

Slow Responses

Problem: Agent takes long to respond

Solutions:

  1. Reduce number of docs
  2. Lower context window
  3. Remove large/complex files
  4. 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:

  1. Go to agent dashboard
  2. Click Context tab
  3. Upload your first document
  4. Test by asking related questions
  5. Add more content as needed

Learn more: