0Pricing
AI Agents with LangChain & Autonomous Workflows · درس

الموافقات بمشاركة الإنسان

أضف نقاط تحقق آمنة إلى مسارات العمل الذاتية، حيث يراجع الإنسان الإجراءات الخطرة أو يوافق عليها قبل متابعة الوكيل، لتحقيق توازن بين الأتمتة والتحكم.

الموافقات بمشاركة الإنسان درس مجاني في AI Agents with LangChain & Autonomous Workflows على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في AI Agents with LangChain & Autonomous Workflows، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة AI Agents with LangChain & Autonomous Workflows 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Why Pause for Humans

Full autonomy is risky for high-stakes actions: sending money, deleting records, emailing customers. A mistake can be costly and irreversible.

Human-in-the-loop (HITL) inserts an approval step so a person confirms before the agent acts.

Where to Add Checkpoints

You do not need approval everywhere — only at sensitive points:

  • Before destructive or irreversible operations
  • Before external side effects (payments, emails)
  • When the agent's confidence is low

Read-only steps can stay fully automatic.

The Interrupt Pattern

In LangGraph you mark nodes where the graph should pause. Execution stops, state is saved, and control returns to your application to await a decision.

graph = builder.compile(
    checkpointer=memory,
    interrupt_before=['execute_payment']
)

Persisting State to Resume

To pause and resume later, the workflow needs a checkpointer that saves state under a thread id. The human might approve minutes or hours later.

config = {'configurable': {'thread_id': 'order-42'}}
result = graph.invoke(initial_state, config)

Surfacing the Pending Action

When paused, inspect the saved state to show the human exactly what the agent wants to do — the tool, the arguments, and the reason.

state = graph.get_state(config)
print(state.next)
print(state.values['proposed_action'])

Approve and Continue

If the human approves, resume the graph by invoking again with the same thread id. It picks up right where it paused.

graph.invoke(None, config)  # resume

Reject or Edit

Approval is not the only outcome. A human can reject the action or edit the agent's proposed arguments before continuing — for example fixing a wrong recipient.

graph.update_state(
    config,
    {'proposed_action': edited_action}
)
graph.invoke(None, config)

Asynchronous Approvals

In production the human is not at a console. The pause sends a notification (Slack, email, a dashboard task); the resume happens when they click approve. The thread id ties the request to the right paused run.

Timeouts and Defaults

Decide what happens if no one responds. Options:

  • Auto-reject after a timeout (safe default)
  • Escalate to another approver
  • Hold indefinitely for critical actions

Auditability

Log every approval decision: who approved, when, and what was executed. This audit trail is essential for compliance and for debugging agent behavior later.

Balancing Automation

Too many approvals defeat the purpose of automation; too few add risk. Start cautious, then remove checkpoints as you gain confidence in the agent for specific action types.

Quick Check

Test your HITL knowledge.

Recap

You learned to add human oversight to autonomous workflows:

  • Insert approval checkpoints at risky steps only
  • Use interrupt_before plus a checkpointer to pause
  • Surface the proposed action, then approve, reject, or edit
  • Handle async approvals, timeouts, and audit logging

Human-in-the-loop makes autonomy safe for high-stakes work.

الأسئلة الشائعة

هل درس «الموافقات بمشاركة الإنسان» مجاني؟

نعم — نص درس «الموافقات بمشاركة الإنسان» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة AI Agents with LangChain & Autonomous Workflows، انتقل إلى CoddyKit PRO. تتضمن دورة AI Agents with LangChain & Autonomous Workflows 4 دروس في المجموع.

ماذا ستتعلم في «الموافقات بمشاركة الإنسان»؟

أضف نقاط تحقق آمنة إلى مسارات العمل الذاتية، حيث يراجع الإنسان الإجراءات الخطرة أو يوافق عليها قبل متابعة الوكيل، لتحقيق توازن بين الأتمتة والتحكم. تتمرن على AI Agents with LangChain & Autonomous Workflows مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ AI Agents with LangChain & Autonomous Workflows؟

لا تُشترط خبرة سابقة. AI Agents with LangChain & Autonomous Workflows على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «الموافقات بمشاركة الإنسان»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس AI Agents with LangChain & Autonomous Workflows هذا؟

نعم. كل درس في AI Agents with LangChain & Autonomous Workflows يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. تصميم مسارات العمل المعقدة
  2. التنفيذ غير المتزامن للوكلاء
  3. معالجة الأخطاء والمرونة
  4. الموافقات بمشاركة الإنسان
← العودة إلى AI Agents with LangChain & Autonomous Workflows