Session Message Buffer
Acontext will track the agent task and user feedback in the session, the following settings are used to decide how and when the tracking will be conducted.Number of previous message turns to include in the context when processing new incoming messages.Higher values provide more context for task maintaining but consume more tokens.
Maximum number of untracked message turns to keep in the session buffer.This controls the size of the messages we want to process at the same time, the larger the buffer,
the longer context we can use for once for task maintaining,
and the less total token costs.
Time-to-live in seconds for the session buffer.If the session buffer haven’t received any new messsages for the TTL seconds, it will start the process the current messages.
This parameter + the max turns parameters make sure the session buffer is not too large and the messages are not too old.
Agent Iteration Limits
Maximum number of iterations a task agent can perform before stopping. Prevents infinite loops in task execution.
Maximum number of iterations for Standard Operating Procedure (SOP) agents. Controls how many steps an SOP agent can take.
Maximum iterations for space construction agents. These agents typically need more iterations to build complex knowledge spaces.
.env Examples
Message Buffer Tuning
Buffer Size Impact
- Small buffers (8-16 turns):
- ✅ Lower update latency - Tasks and skills update faster
- ❌ Higher token cost - More frequent processing with less context sharing
- Large buffers (32+ turns):
- ✅ Lower token cost - Batch processing with shared context
- ❌ Higher update latency - Tasks and skills update less frequently
TTL Configuration Impact
- Short TTL (1-4 seconds):
- ✅ Near real-time task extraction and skill updates
- ❌ Higher costs due to frequent processing of smaller batches
- Long TTL (10+ seconds):
- ✅ Cost efficient batch processing
- ❌ Delayed updates for tasks and skills