tracerazor-crewai
CrewAI callback adapter for TraceRazor.
Automatically captures every task execution and tool call from your CrewAI crew with zero manual instrumentation.
v0.2.0 — New Metrics:
- ✨ Semantic Continuity (CSD) — Detects when your crew's agents drift topic mid-workflow
- ✨ Adherence Scoring (IAR) — After optimizing, validates that fixes actually improved metrics
Install
pip install tracerazor-crewai
pip install tracerazor-crewai[crewai] # includes crewai
Requires the tracerazor binary:
cargo build --release
export TRACERAZOR_BIN=/path/to/TraceRazor/target/release/tracerazor
Usage
from tracerazor_crewai import TraceRazorCallback
from crewai import Agent, Task, Crew
callback = TraceRazorCallback(
agent_name="support-crew",
threshold=70,
)
crew = Crew(
agents=[...],
tasks=[...],
callbacks=[callback],
)
crew.kickoff()
# After the crew finishes:
report = callback.analyse()
print(report.markdown())
# CI/CD gate — raises AssertionError if TAS < threshold:
callback.assert_passes()
API
TraceRazorCallback(agent_name, framework, threshold, task_value_score, tracerazor_bin)
| param | default | description |
|---|---|---|
agent_name |
"crewai-crew" |
shown in all reports |
framework |
"crewai" |
framework label |
threshold |
70.0 |
minimum TAS for assert_passes() |
task_value_score |
1.0 |
answer quality (0–1) |
tracerazor_bin |
auto | path to binary; falls back to TRACERAZOR_BIN env var |
callback.analyse() → TraceRazorReport
Finalise and submit the trace. Returns the report.
callback.assert_passes()
Raise AssertionError if TAS < threshold.
callback.set_task_value_score(score: float)
Update quality score before calling analyse().
Captured events
| CrewAI event | TraceRazor step type |
|---|---|
on_task_start / on_task_end |
reasoning |
on_agent_action |
reasoning or tool_call |
on_tool_use_start / on_tool_use_end |
tool_call (success) |
on_tool_error |
tool_call (failure → TCA misfire) |
Multi-Agent Crews
For complex workflows with multiple crews, use a separate callback for each:
from tracerazor_crewai import TraceRazorCallback
# Crew 1: Triage & classification
triage_crew = Crew(agents=[triage_agent], tasks=[triage_task],
callbacks=[TraceRazorCallback(agent_name="triage-crew")])
triage_result = triage_crew.kickoff()
# Crew 2: Resolution execution
resolution_crew = Crew(agents=[resolution_agent], tasks=[resolution_task],
callbacks=[TraceRazorCallback(agent_name="resolution-crew")])
resolution_result = resolution_crew.kickoff()
# Each crew is audited independently
See Multi-Agent Guide for complete example with per-agent optimization.
Metadata
Release files for tracerazor-crewai 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tracerazor_crewai-1.0.0.tar.gz | 8.4 kB | Without provenance | Details for tracerazor_crewai-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tracerazor_crewai-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for tracerazor_crewai-1.0.0-py3-none-any.whl |
Total release size: 16.5 kB
Release files / tracerazor_crewai-1.0.0.tar.gz
| Download URL | tracerazor_crewai-1.0.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64f38ceb156b04ef2e61da64a7e2c16170cacbacd3b7d536bb65b604b295c739
|
|
BLAKE2b-256 checksum How to use checksums |
1eea70566cfebfb53783fc310360cac70910b5563382034f2f48ec9cb67400a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Release files / tracerazor_crewai-1.0.0-py3-none-any.whl
| Download URL | tracerazor_crewai-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf018a19e51aa7bb605e9f06936004ede7fb6f60c043939bf45fca6ab02df342
|
|
BLAKE2b-256 checksum How to use checksums |
a3fb7d9d657ae9b1db5e5538462b4a3cf073be756413d6e52c0253a14449f093
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Security for tracerazor-crewai 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.