Skip to main content
AgentDbg’s CrewAI integration registers execution hooks that tap into CrewAI’s native before/after call lifecycle. Import the adapter once and every LLM invocation and tool execution from your crew or flow is automatically captured in the active AgentDbg run—including agent role, task description, and timing metadata.

What gets captured

The adapter hooks into four CrewAI execution points:
  • LLM calls (before_llm_call / after_llm_call) — records model name, prompt messages, response, and duration as an LLM_CALL event.
  • Tool calls (before_tool_call / after_tool_call) — records tool name, input arguments, result, and duration as a TOOL_CALL event.
Framework-specific context from each call is stored in meta.crewai.*:

Installation

Install AgentDbg with the CrewAI extra:
This installs crewai[tools] alongside AgentDbg. If you import the integration without crewai present, you get a clear ImportError with install instructions.

Setting up the adapter

1

Install the package

2

Import the integration module

Importing agentdbg.integrations.crewai registers the execution hooks automatically. Import it once, anywhere before your crew or flow runs:
3

Wrap your entrypoint with @trace

The adapter only records events while an active AgentDbg run is open. Wrap the function that calls crew.kickoff() or flow.kickoff():
4

Run your crew or flow

Call your traced function normally:
Then open the timeline:

Full example

Hook ordering caveat

CrewAI runs execution hooks in registration order. If another before_llm_call or before_tool_call hook registered before AgentDbg’s returns False and blocks execution, the AgentDbg hook may not run for that specific call—and that call will not appear in the trace.
If you register your own before-hooks on CrewAI, make sure they do not return False unless you intentionally want to block execution. Returning False from a before-hook prevents all subsequent hooks for that call from running.

What’s coming

The following adapter is planned and not yet available:
  • Agno — adapter for Agno-based agents.
The adapter requires an active AgentDbg run. Wrap your entrypoint with @trace or traced_run(...).