CrewAI integration

CrewAI prompt compression

CrewAI orchestrates multiple AI agents that collaborate on tasks. Each agent call accumulates context, making CrewAI crews particularly expensive. SuperCompress compresses agent context before every LLM call.

By Arjun Shah - Creator of SuperCompress - Updated 2026-07-03

The CrewAI token problem

A CrewAI crew with 3 agents making 5 calls each per task, with 2,000 tokens per call, burns 30,000 tokens per task. At 100 tasks/day, that is 3M tokens — ~$7.50/day on GPT-4o. Compression cuts this to ~$2.60/day.

Integration with CrewAI

from crewai import Agent, Task, Crew
from supercompress import Compressor

comp = Compressor()

class CompressedAgent(Agent):
    def execute_task(self, task, context=None, tools=None):
        if context:
            result = comp.compress(context, task.description)
            context = result.compressed_text
        return super().execute_task(task, context, tools)

Frequently asked questions

Does compression affect agent collaboration?

No. Only irrelevant context is removed. The compressed context retains all information needed for agent cooperation.

Can I use it with CrewAI's hierarchical process?

Yes. Compression works at the individual agent level, regardless of the CrewAI process type.

Build with less context

Put compression in front of your next LLM call.

Use the hosted API or run SuperCompress locally. Keep the evidence, drop the token waste, and measure the savings before it reaches your model.

Get an API keyRead the guide