Skip to content

CrewAI

Trace crew lifecycle, agent steps, and task completions from CrewAI.

Terminal window
pip install "axonpush[crewai]"
import os
from axonpush import AxonPush
from axonpush.integrations.crewai import AxonPushCrewCallbacks
client = AxonPush(
api_key=os.environ["AXONPUSH_API_KEY"],
tenant_id=os.environ["AXONPUSH_TENANT_ID"],
base_url=os.environ.get("AXONPUSH_BASE_URL", "https://api.axonpush.xyz"),
)
callbacks = AxonPushCrewCallbacks(
client=client,
channel_id=1,
agent_id="crewai",
)

Wire callbacks into Crew() and bracket execution:

from crewai import Crew
callbacks.on_crew_start()
crew = Crew(
agents=[...],
tasks=[...],
step_callback=callbacks.on_step,
task_callback=callbacks.on_task_complete,
)
result = crew.kickoff()
callbacks.on_crew_end(result)
EventWhen
crew.startCrew begins execution
crew.endCrew completes
agent.stepAn agent takes a step
tool.*.startTool execution begins
tool.*.endTool execution completes
task.completeA task finishes