Skip to main content

Context Engineering

OmniCoreAgent has three context-control layers that work together: When agent loop context management is enabled and configured with a budget below your model’s real context window, OmniCoreAgent acts before the provider context limit is hit. The runtime checks context before the LLM call, not after an error.
This is why long tasks can keep moving without waiting for the provider to reject an oversized prompt.

Layer 1: Session Memory

Session memory decides what historical messages are loaded when a new agent.run() starts. This is the cross-request layer.
Use persistent memory backends such as Redis, MongoDB, or SQL database storage when session history must survive process restarts.

Layer 2: Agent Loop Context Management

Agent loop context management runs inside the ReAct loop. Before each model call, OmniCoreAgent asks the context manager whether the current messages crossed the configured threshold. If yes, it reduces the message list before the LLM request is sent.
With the config above, management triggers around 75,000 tokens. If the selected model has a larger context window, the harness reduces context before the model request reaches the provider limit.

What Is Preserved

Modes

Strategies


Layer 3: Tool Output Offloading

Tool offloading handles large individual tool responses. It keeps the agent from burning context on a full payload when a preview and a file reference are enough for the next reasoning step.
When a tool result crosses the configured threshold, OmniCoreAgent writes the full payload to the active workspace artifacts/ area. The observation sent to the model contains the preview and the artifact reference.
The artifact uses the same workspace backend as the rest of the agent: local, S3, or R2.

Built-In Artifact Tools

Artifact tools are available when offloading is enabled:

Full Context Configuration

Use all layers together for long-running research, coding, data, and operational agents:
Set context_management.value to a budget below your model’s real context window. OmniCoreAgent checks the budget before each model call and reduces the prompt when the threshold is crossed.