CrewAI
Trace crew lifecycle, agent steps, and task completions from CrewAI.
Installation
bash
pip install "axonpush[crewai]"Setup
python
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",
)Usage
Wire callbacks into Crew() and bracket execution:
python
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)Events Traced
| Event | When |
|---|---|
crew.start | Crew begins execution |
crew.end | Crew completes |
agent.step | An agent takes a step |
tool.*.start | Tool execution begins |
tool.*.end | Tool execution completes |
task.complete | A task finishes |