Context Management
Long-running tasks can exceed a model context window. ChemAgent estimates context use, reserves capacity for new output, and compresses older material when configured limits are approached.
Context budget
- ✓Configured maximum
The deployment sets the maximum context tokens available to the agent.
- ✓Reserved capacity
Part of the window remains available for the next request and model output.
- ✓Structured estimation
Text, images, tool arguments, and tool results contribute differently to the estimate.
Compression workflow
- 1Detect pressure
Current turns and the system prompt approach the available budget.
- 2Preserve recent work
The most relevant recent turns remain in active context.
- 3Summarize older work
Discarded material is summarized and persisted to daily memory.
- 4Continue the session
The retained context receives the summary needed for continuity.
Limits
Important engineering facts, approvals, and source references should be stored explicitly in project documents or durable knowledge rather than relying on conversation compression alone.