[{"data":1,"prerenderedAt":392},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fintegrations\u002Fcrewai":3},{"id":4,"title":5,"body":6,"description":383,"extension":384,"meta":385,"navigation":386,"path":388,"seo":389,"stem":390,"__hash__":391},"docs\u002Fdocs\u002Fintegrations\u002Fcrewai.md","CrewAI",{"type":7,"value":8,"toc":375},"minimark",[9,30,35,67,71,190,194,238,242,257,333,337,343,347,371],[10,11,12,13,17,18,21,22,25,26,29],"p",{},"CrewAI is the most-used Python framework for orchestrating multi-agent teams. Iqrar attaches to a ",[14,15,16],"code",{},"Crew"," via the ",[14,19,20],{},"step_callback"," and ",[14,23,24],{},"task_callback"," hooks plus a transparent wrap around ",[14,27,28],{},"kickoff()",".",[31,32,34],"h2",{"id":33},"install","Install",[36,37,42],"pre",{"className":38,"code":39,"language":40,"meta":41,"style":41},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pip install \"iqrar-agent[crewai]\"\n","bash","",[14,43,44],{"__ignoreMap":41},[45,46,49,53,57,61,64],"span",{"class":47,"line":48},"line",1,[45,50,52],{"class":51},"sBMFI","pip",[45,54,56],{"class":55},"sfazB"," install",[45,58,60],{"class":59},"sMK4o"," \"",[45,62,63],{"class":55},"iqrar-agent[crewai]",[45,65,66],{"class":59},"\"\n",[31,68,70],{"id":69},"wire-it-in","Wire it in",[36,72,76],{"className":73,"code":74,"language":75,"meta":41,"style":41},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from crewai import Agent, Crew, Task\nfrom iqrar import Iqrar\nfrom iqrar.adapters.crewai import attach\n\niqrar = Iqrar(\n    org=\"acme\",\n    jurisdiction=\"EU\",\n    endpoint=\"https:\u002F\u002Fapi.your-deploy.workers.dev\",\n    agent_id=\"crewai-support-prod\",\n    name=\"CrewAI · support · production\",\n    capabilities=[\"consumer_chatbot\"],\n)\n\nresearcher = Agent(role=\"Researcher\", goal=\"...\", backstory=\"...\")\ntask = Task(description=\"...\", expected_output=\"...\", agent=researcher)\ncrew = Crew(agents=[researcher], tasks=[task])\n\nattach(crew, iqrar)\nresult = crew.kickoff()\n","python",[14,77,78,83,89,95,102,108,114,120,126,132,138,144,150,155,161,167,173,178,184],{"__ignoreMap":41},[45,79,80],{"class":47,"line":48},[45,81,82],{},"from crewai import Agent, Crew, Task\n",[45,84,86],{"class":47,"line":85},2,[45,87,88],{},"from iqrar import Iqrar\n",[45,90,92],{"class":47,"line":91},3,[45,93,94],{},"from iqrar.adapters.crewai import attach\n",[45,96,98],{"class":47,"line":97},4,[45,99,101],{"emptyLinePlaceholder":100},true,"\n",[45,103,105],{"class":47,"line":104},5,[45,106,107],{},"iqrar = Iqrar(\n",[45,109,111],{"class":47,"line":110},6,[45,112,113],{},"    org=\"acme\",\n",[45,115,117],{"class":47,"line":116},7,[45,118,119],{},"    jurisdiction=\"EU\",\n",[45,121,123],{"class":47,"line":122},8,[45,124,125],{},"    endpoint=\"https:\u002F\u002Fapi.your-deploy.workers.dev\",\n",[45,127,129],{"class":47,"line":128},9,[45,130,131],{},"    agent_id=\"crewai-support-prod\",\n",[45,133,135],{"class":47,"line":134},10,[45,136,137],{},"    name=\"CrewAI · support · production\",\n",[45,139,141],{"class":47,"line":140},11,[45,142,143],{},"    capabilities=[\"consumer_chatbot\"],\n",[45,145,147],{"class":47,"line":146},12,[45,148,149],{},")\n",[45,151,153],{"class":47,"line":152},13,[45,154,101],{"emptyLinePlaceholder":100},[45,156,158],{"class":47,"line":157},14,[45,159,160],{},"researcher = Agent(role=\"Researcher\", goal=\"...\", backstory=\"...\")\n",[45,162,164],{"class":47,"line":163},15,[45,165,166],{},"task = Task(description=\"...\", expected_output=\"...\", agent=researcher)\n",[45,168,170],{"class":47,"line":169},16,[45,171,172],{},"crew = Crew(agents=[researcher], tasks=[task])\n",[45,174,176],{"class":47,"line":175},17,[45,177,101],{"emptyLinePlaceholder":100},[45,179,181],{"class":47,"line":180},18,[45,182,183],{},"attach(crew, iqrar)\n",[45,185,187],{"class":47,"line":186},19,[45,188,189],{},"result = crew.kickoff()\n",[31,191,193],{"id":192},"what-you-get","What you get",[195,196,197,215,223,231],"ul",{},[198,199,200,210,211,214],"li",{},[201,202,203,206,207],"strong",{},[14,204,205],{},"agent.invocation.start"," \u002F ",[14,208,209],{},".end"," for ",[14,212,213],{},"crew.kickoff()"," itself.",[198,216,217,222],{},[201,218,219],{},[14,220,221],{},"agent.step"," for every CrewAI step (tool calls, agent thoughts, observations).",[198,224,225,230],{},[201,226,227],{},[14,228,229],{},"agent.task"," for each completed task with description, agent role, and output preview.",[198,232,233,234,237],{},"The standard ",[14,235,236],{},"agent.classified"," event with your tier, reasons, and applicable obligations.",[31,239,241],{"id":240},"decisions-and-human-review","Decisions and human review",[10,243,244,245,248,249,252,253,256],{},"For Tier 3+ agents (e.g. ",[14,246,247],{},"credit_decision",", ",[14,250,251],{},"healthcare_recommendation","), record decisions explicitly so the full input\u002Foutput payload is retained per the active ruleset's ",[14,254,255],{},"required_logs",":",[36,258,260],{"className":73,"code":259,"language":75,"meta":41,"style":41},"from iqrar.types import DecisionRecord, HumanReviewRecord\n\niqrar.decision(DecisionRecord(\n    decision_id=f\"loan-{application.id}\",\n    input=application.to_dict(),\n    output=result,\n    rationale=\"score above threshold; income verified\",\n    affects_consumer=True,\n))\n\niqrar.record_human_review(HumanReviewRecord(\n    decision_id=f\"loan-{application.id}\",\n    reviewer=\"compliance@acme.com\",\n    outcome=\"upheld\",\n))\n",[14,261,262,267,271,276,281,286,291,296,301,306,310,315,319,324,329],{"__ignoreMap":41},[45,263,264],{"class":47,"line":48},[45,265,266],{},"from iqrar.types import DecisionRecord, HumanReviewRecord\n",[45,268,269],{"class":47,"line":85},[45,270,101],{"emptyLinePlaceholder":100},[45,272,273],{"class":47,"line":91},[45,274,275],{},"iqrar.decision(DecisionRecord(\n",[45,277,278],{"class":47,"line":97},[45,279,280],{},"    decision_id=f\"loan-{application.id}\",\n",[45,282,283],{"class":47,"line":104},[45,284,285],{},"    input=application.to_dict(),\n",[45,287,288],{"class":47,"line":110},[45,289,290],{},"    output=result,\n",[45,292,293],{"class":47,"line":116},[45,294,295],{},"    rationale=\"score above threshold; income verified\",\n",[45,297,298],{"class":47,"line":122},[45,299,300],{},"    affects_consumer=True,\n",[45,302,303],{"class":47,"line":128},[45,304,305],{},"))\n",[45,307,308],{"class":47,"line":134},[45,309,101],{"emptyLinePlaceholder":100},[45,311,312],{"class":47,"line":140},[45,313,314],{},"iqrar.record_human_review(HumanReviewRecord(\n",[45,316,317],{"class":47,"line":146},[45,318,280],{},[45,320,321],{"class":47,"line":152},[45,322,323],{},"    reviewer=\"compliance@acme.com\",\n",[45,325,326],{"class":47,"line":157},[45,327,328],{},"    outcome=\"upheld\",\n",[45,330,331],{"class":47,"line":163},[45,332,305],{},[31,334,336],{"id":335},"idempotency","Idempotency",[10,338,339,342],{},[14,340,341],{},"attach()"," chains existing callbacks rather than replacing them, so calling it twice is safe and adding it after another instrumentation library is also safe.",[31,344,346],{"id":345},"see-also","See also",[195,348,349,365],{},[198,350,351,356,357,356,361],{},[352,353,355],"a",{"href":354},"\u002Fdocs\u002Fintegrations","Integrations overview"," · ",[352,358,360],{"href":359},"\u002Fdocs\u002Fintegrations\u002Flangchain-python","LangChain (Python)",[352,362,364],{"href":363},"\u002Fdocs\u002Fintegrations\u002Fopenai-agents-python","OpenAI Agents SDK",[198,366,367,368],{},"Full SDK reference: ",[14,369,370],{},"packages\u002Fagent-python\u002FINTEGRATION.md",[372,373,374],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}",{"title":41,"searchDepth":85,"depth":85,"links":376},[377,378,379,380,381,382],{"id":33,"depth":85,"text":34},{"id":69,"depth":85,"text":70},{"id":192,"depth":85,"text":193},{"id":240,"depth":85,"text":241},{"id":335,"depth":85,"text":336},{"id":345,"depth":85,"text":346},"Wire Iqrar into a CrewAI Crew with a single attach() call — step and task callbacks instrument every agent step, tool call, and task completion.","md",{},{"title":5,"order":387},30,"\u002Fdocs\u002Fintegrations\u002Fcrewai",{"title":5,"description":383},"docs\u002Fintegrations\u002Fcrewai","URnekwNVUQQTFEInUkwp2OIHWqq7E-O_SsFyIFdYGc4",1778064965624]