> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fact0.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CrewAI

> Audit and trace CrewAI multi-agent workflows with one execution per crew run.

# CrewAI

<Note>
  A dedicated CrewAI helper is on the roadmap. The pattern below works today.
</Note>

## Pattern

One execution per crew run, one span per agent task.

```python theme={null}
import fact0
from crewai import Crew, Agent, Task

client = fact0.Client(api_key="f0_live_...")

with client.telemetry.execution(agent_id="research-crew") as ex:
    crew = Crew(agents=[...], tasks=[...])

    for task in crew.tasks:
        with ex.span(task.description, span_type="CUSTOM") as span:
            result = task.execute()
            span.complete(output={"result": result})

    crew.kickoff()
```

## Audit high-value actions

For tasks that mutate customer data, also log to the audit pipeline:

```python theme={null}
client.audit.log(
    actor={"id": "agent.researcher", "type": "agent"},
    action="report.publish",
    resource={"id": report_id, "type": "report"},
    outcome="success",
)
```

## Related

* [Concepts: executions](/concepts/executions)
* [Audit client](/sdk/python/audit)
