Skip to main content
Omium provides automatic instrumentation for CrewAI. Once enabled, all your kickoff(), kickoff_async(), and kickoff_for_each() calls are traced without code changes.

Quick Start

import omium

# 1. Initialize Omium
omium.init(api_key="om_xxx")

# 2. Enable auto-instrumentation
omium.instrument_crewai()

# 3. Your existing CrewAI code works unchanged
from crewai import Crew, Agent, Task

researcher = Agent(
    role="Researcher",
    goal="Find the latest AI news",
    backstory="You are an expert researcher"
)

research_task = Task(
    description="Research the latest developments in AI agents",
    agent=researcher,
    expected_output="A summary of recent AI agent developments"
)

crew = Crew(
    agents=[researcher],
    tasks=[research_task]
)

# This execution is automatically traced!
result = crew.kickoff()
View the trace at app.omium.ai.

What Gets Captured

DataDescription
Execution IDUnique ID for each kickoff() call
Crew NameName of the crew (if set)
Agent CountNumber of agents in the crew
Task CountNumber of tasks in the crew
Agent RolesRole of each agent
Step EventsEach crew step/action
OutputFinal crew output
ErrorsAny exceptions thrown

Instrumentation Methods

instrument_crewai()

Enable auto-instrumentation. Call once at application startup.
import omium

omium.init(api_key="om_xxx")
omium.instrument_crewai()

# All subsequent CrewAI executions are traced

uninstrument_crewai()

Disable instrumentation (restores original methods).
import omium

omium.uninstrument_crewai()

Async Support

Works with both sync and async execution:
import asyncio
import omium

omium.init(api_key="om_xxx")
omium.instrument_crewai()

# Async kickoff - automatically traced
result = await crew.kickoff_async()

Batch Execution

kickoff_for_each() is also traced:
import omium

omium.init(api_key="om_xxx")
omium.instrument_crewai()

inputs = [
    {"topic": "AI Agents"},
    {"topic": "LLM Fine-tuning"},
    {"topic": "RAG Systems"}
]

# Batch execution - all traced as one batch
results = crew.kickoff_for_each(inputs)

Configuration Options

import omium
from omium import OmiumConfig

config = OmiumConfig(
    api_key="om_xxx",
    project="my-crewai-app",   # Optional: group executions by project
    auto_trace=True,            # Enable auto-tracing (default: True)
    auto_checkpoint=True,       # Enable auto-checkpointing (default: True)
)

omium.configure(config)
omium.instrument_crewai()

Example: Multi-Agent Crew

import omium
from crewai import Crew, Agent, Task, Process

omium.init(api_key="om_xxx")
omium.instrument_crewai()

# Define agents
researcher = Agent(
    role="Research Analyst",
    goal="Conduct thorough research on topics",
    backstory="Expert at finding and analyzing information"
)

writer = Agent(
    role="Content Writer",
    goal="Write clear, engaging content",
    backstory="Skilled writer who creates compelling narratives"
)

editor = Agent(
    role="Editor",
    goal="Ensure quality and accuracy",
    backstory="Meticulous editor with an eye for detail"
)

# Define tasks
research_task = Task(
    description="Research the topic: {topic}",
    agent=researcher,
    expected_output="Comprehensive research notes"
)

writing_task = Task(
    description="Write an article based on the research",
    agent=writer,
    expected_output="Draft article",
    context=[research_task]
)

editing_task = Task(
    description="Edit and polish the article",
    agent=editor,
    expected_output="Final polished article",
    context=[writing_task]
)

# Create crew
crew = Crew(
    agents=[researcher, writer, editor],
    tasks=[research_task, writing_task, editing_task],
    process=Process.sequential,
    verbose=True
)

# All agent interactions and task completions are traced
result = crew.kickoff(inputs={"topic": "AI Agents in Production"})

Troubleshooting

ImportError: CrewAI is not installed

pip install crewai

Traces not appearing

  1. Verify omium.init() was called before instrument_crewai()
  2. Check your API key is valid
  3. Ensure you have network access to api.omium.ai

Disable tracing temporarily

omium.uninstrument_crewai()

# Run without tracing
result = crew.kickoff()

# Re-enable
omium.instrument_crewai()

Next Steps