Have you ever been deep in a productive conversation with your agent, only to hit a wall with a "Model context is full" error? This frustrating interruption happens when you've exceeded the AI model's capacity to process information — but understanding why it happens and how to prevent it can help you work more effectively with elvex.
What does "Model context is full" mean?
The "Model context is full" message appears when your conversation has exceeded the AI model's context window—the maximum amount of information it can process at once.
Think of context as the model's "working memory." Every message you send, every response it generates, and all the information from your agent's rules, datasources, and actions consume space in this context window. When that space fills up, the model can't accept any more information, and you'll need to take action before continuing.
This is similar to running out of RAM on your computer—the system simply can't hold any more active information and needs you to clear some space.
Why context limits exist
AI models have context limits for several technical and practical reasons:
Processing constraints: Larger contexts require exponentially more computational power and memory. A model processing 200,000 tokens uses significantly more resources than one processing 8,000 tokens.
Response quality: Models perform best when working with focused, relevant information. Extremely large contexts can sometimes lead to the model losing track of important details or struggling to prioritize what matters most.
Cost efficiency: Processing larger contexts costs more in terms of both time and money, which affects both response speed and operational costs.
What fills up the context
Several factors contribute to context usage in elvex:
Conversation history: Every message in your conversation—both your inputs and the agent's responses—takes up space. A long back-and-forth discussion can quickly consume thousands of tokens.
Agent configuration:
Rules and instructions you've written for your agent's behavior
Context field information
Connected datasources that get retrieved during the conversation
Enabled actions and their descriptions
Attachments: Files you've uploaded to the conversation, especially large documents, PDFs, or spreadsheets.
Integration data: Information pulled from connected tools and databases when your agent uses actions.
Long conversations with extensive back-and-forth, large datasources, or many attached files will fill the context faster than brief, focused interactions.
What to do when context is full
When you encounter this message, you have several options:
Start a new conversation
The simplest solution is to start a fresh conversation. This gives you a clean slate.
Pro tip: Before starting a new conversation, consider asking your agent to summarize key decisions or information you'll need to reference later. You can copy this summary to use in your next conversation.
Switch to a model with a larger context window
If you frequently hit context limits, consider using a model with a larger context window.
Go to your agent's settings and select a model with higher context capacity. For example:
Switching from a model with a 32,000-token limit to one with 128,000 or 200,000 tokens can dramatically extend your conversation length
Models like Claude Sonnet 4.6 (with 1M token beta access) or Gemini 2.0 Flash (1M tokens) can handle extremely long conversations or large document analysis
Different models have vastly different context limits. The context window available to you in elvex depends on which model you've selected for your agent and how you're accessing it. API access sometimes provides different limits than web interfaces.
Trade-offs to consider:
Larger context models may be slower to respond
They may cost more per message
For simple tasks, a smaller context window is often perfectly adequate
Optimize your agent configuration
Review your agent's setup to reduce unnecessary context usage:
Streamline your rules: Keep instructions concise and focused on behavior rather than facts. Long, detailed rules consume valuable context space that could be used for your actual conversation. See 10 recommendations for writing agent rules in elvex for best practices.
Use datasources efficiently: Only connect datasources that are essential for your agent's purpose. Remove any that aren't actively being used. Each connected datasource adds to your context consumption, especially when the agent retrieves information from them.
Disable unused actions: Turn off any actions your agent doesn't need. Each enabled action adds its description and parameters to the context, even if you never use it.
Be strategic about conversation length
For tasks requiring extended back-and-forth:
Break complex projects into multiple focused conversations: Instead of one marathon conversation covering multiple topics, create separate conversations for each distinct task or phase of your project.
Summarize key points before starting a new conversation: When you need to continue work across multiple conversations, ask your agent to create a summary of important decisions, data, or context. Copy this summary to reference in your next conversation.
Reference specific information explicitly: Rather than relying on the model to remember everything from earlier in a long conversation, explicitly re-state important details when they're relevant. This is especially important as conversations grow longer.
Use attachments strategically: Instead of pasting large amounts of text into messages, attach documents when possible. This can be more context-efficient, though large attachments still consume context.
How to prevent hitting context limits
Choose the right model for your task: If you know you'll be working with large documents or having extended conversations, start with a model that has a larger context window.
Keep agent configurations lean: Regularly audit your agent's rules, datasources, and actions. Remove anything that's not essential.
Start fresh when switching topics: Don't try to use one conversation for multiple unrelated tasks. Starting a new conversation for each distinct task keeps context usage manageable.
Monitor your conversation length: If you notice your conversation is getting very long, consider whether you're approaching a natural breaking point where you could summarize and start fresh.
