Skip to main content

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

A dedicated CrewAI helper is on the roadmap. The pattern below works today.

Pattern

One execution per crew run, one span per agent task.
import fact0
from crewai import Crew, Agent, Task

client = fact0.Client(api_key="alk_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:
client.audit.log(
    actor={"id": "agent.researcher", "type": "agent"},
    action="report.publish",
    resource={"id": report_id, "type": "report"},
    outcome="success",
)