Overview
Context management in Lindy gives you direct control over your agent’s memory and attention. Perfect for:- Prioritizing important information — anything you add to context gets favored in future decisions
- Managing token costs — clear context when it gets too large or expensive
- Focusing agent attention — remove distractions and highlight what matters
- Advanced memory control — combine with variables for sophisticated patterns
Add Context Action
- What it does: Explicitly adds important information to your agent’s working memory, ensuring it’s prioritized in all future decisions.

Inputs
- Contextt: The information you want to add to context
Outputs
- Context Reference: Can be referenced as an output in other actions
- Updated Context: The agent’s context is updated behind the scenes
Clear Task Context Action
- What it does: Removes all or selected context to reduce token usage and refocus your agent’s attention on what matters most.

Inputs
- Message: Instructions for what to preserve — like “preserve customer contacts or important information that will stay after the context is cleared”
Outputs
- Cleared Status: Confirmation of what was removed
- Remaining Context: What context (if any) was preserved
When to Use Context Actions
Add Context
Use when you need to prioritize information:- Customer details when a call or conversation starts
- Critical findings that should influence all future decisions
- Process state that other actions need to know about
- Error conditions that need to be tracked
Clear Context
Use to manage costs and focus:- When context gets large and expensive
- Switching between different workflow phases
- Processing multiple independent items
- Need to eliminate distractions
Best Practices
Advanced Context Management
Advanced Context Management
- Use variables to preserve essential data before clearing
- Clear context at natural workflow breakpoints
- Add context immediately after discovering critical information
- Monitor context size in complex workflows
- Use descriptive source labels for tracking
Token Cost Optimization
Token Cost Optimization
- Clear context when processing multiple similar items
- Add only truly essential information to context
- Use variables for temporary data that doesn’t need global access
- Monitor context accumulation in loops
- Clear context before major workflow transitions