Overview
Message history (also called context window) is the number of recent messages sent to your AI backend with each request:Context Window Size
Choose how many messages to include:Small (5 messages)
Best for:- Simple Q&A bots
- Transactional interactions
- Faster processing
- Less API overhead
- Limited context
- May forget earlier conversation
Medium (10 messages - default)
Best for:- General-purpose bots
- Customer support
- Balanced applications
- Good context retention
- Handles most conversations well
- May lose very early context
Large (20+ messages)
Best for:- Complex conversations
- Technical support
- Detailed interactions
- Excellent context retention
- Coherent long conversations
- Better understanding
- Slower processing
Configuration
Changes apply to new messages immediately. Existing conversations keep their current context.
How It Works
Message Retrieval
When a user sends a message:- Identify Conversation: Use message detection to find conversation
- Fetch History: Retrieve last N messages from database
- Format Messages: Convert to AI backend format
- Send Request: Include history in integration request
- Generate Response: AI uses full context
- Save Response: Add bot response to history
Message Format
Messages are formatted as an array:Message Pruning
When conversations exceed context window:Sliding Window
Oldest messages are dropped:System Messages
System messages (if configured) are always included:Best Practices
Start Small, Increase if Needed
Begin with default (10 messages):- Check if context is lost
- Increase if bot seems forgetful
Consider Use Case
Support Bots: Medium to large (10-20)- Need full problem context
- Multiple back-and-forth exchanges
- Simple questions and answers
- No long conversations
- Build relationship over conversation
- Remember user preferences
Troubleshooting
Bot Forgets Earlier Context
Symptoms:- Repeats questions
- Loses conversation thread
- Contradicts earlier responses
- Increase context window
- Check message detection is working
- Verify conversation grouping is correct
Next Steps
Should Respond
Configure when bot responds
View Conversations
See conversation history