Agent cost spikes usually come from accumulation. Each tool result, retrieved document, error log, and prior turn may be useful once, then it keeps riding along while the agent plans, retries, and delegates.

Put Adola between context assembly and the model call. Your system keeps the full trace for debugging, while the model receives a smaller request for the next step.

Run toolsAssemble contextCompressCall modelLog receipt

Where agent bills usually expand

The best compression target is context that helps preserve continuity but does not need to be passed verbatim every time.

  • Long tool traces copied into every step
  • Retrieved docs that overlap across calls
  • Verbose logs and stack traces
  • Planner notes after the plan has changed
  • Subagent handoffs with repeated background
  • Large memory files sent when only a few facts matter

Production-safe rollout

Treat compression as a measured hop in the request path. Start on one workflow, compare with the full-context baseline, and keep receipts beside model usage logs.

  • Keep instructions, policy, and current user intent outside the compressed block.
  • Compress the bulky trace or retrieved context before the next model call.
  • Store the raw trace internally so audits and debugging still have full evidence.
  • Track saved tokens and quality on real tasks before raising traffic.
const compressedContext = await adola.compress({
  query: nextAgentStep,
  input: toolTraceAndRetrievedContext,
  compression: {
    target_ratio: 0.35,
    preserve_order: true
  }
});

const result = await model.responses.create({
  model: "your-agent-model",
  input: compressedContext.output
});