Docs

CrewAI

Wire Iqrar into a CrewAI Crew with a single attach() call — step and task callbacks instrument every agent step, tool call, and task completion.

CrewAI is the most-used Python framework for orchestrating multi-agent teams. Iqrar attaches to a Crew via the step_callback and task_callback hooks plus a transparent wrap around kickoff().

Install

pip install "iqrar-agent[crewai]"

Wire it in

from crewai import Agent, Crew, Task
from iqrar import Iqrar
from iqrar.adapters.crewai import attach

iqrar = Iqrar(
    org="acme",
    jurisdiction="EU",
    endpoint="https://api.your-deploy.workers.dev",
    agent_id="crewai-support-prod",
    name="CrewAI · support · production",
    capabilities=["consumer_chatbot"],
)

researcher = Agent(role="Researcher", goal="...", backstory="...")
task = Task(description="...", expected_output="...", agent=researcher)
crew = Crew(agents=[researcher], tasks=[task])

attach(crew, iqrar)
result = crew.kickoff()

What you get

  • agent.invocation.start / .end for crew.kickoff() itself.
  • agent.step for every CrewAI step (tool calls, agent thoughts, observations).
  • agent.task for each completed task with description, agent role, and output preview.
  • The standard agent.classified event with your tier, reasons, and applicable obligations.

Decisions and human review

For Tier 3+ agents (e.g. credit_decision, healthcare_recommendation), record decisions explicitly so the full input/output payload is retained per the active ruleset's required_logs:

from iqrar.types import DecisionRecord, HumanReviewRecord

iqrar.decision(DecisionRecord(
    decision_id=f"loan-{application.id}",
    input=application.to_dict(),
    output=result,
    rationale="score above threshold; income verified",
    affects_consumer=True,
))

iqrar.record_human_review(HumanReviewRecord(
    decision_id=f"loan-{application.id}",
    reviewer="compliance@acme.com",
    outcome="upheld",
))

Idempotency

attach() chains existing callbacks rather than replacing them, so calling it twice is safe and adding it after another instrumentation library is also safe.

See also

  • · ·
  • Full SDK reference: packages/agent-python/INTEGRATION.md
© 2026 Cortex Innovations (Pty) Ltd. Iqrar is a working name pending trademark clearance.Powered by Stratafy