Lesson 3.4~15 min

Decision-Making and Reasoning

Module 3: Designing and Architecting AI Agents

Decision-Making and Reasoning

How agents think through problems and choose actions.

Chain-of-Thought Reasoning

Breaking complex problems into sequential reasoning steps:

Question: "Should I recommend Product A or B for this customer?"

Thought 1: Customer needs high performance (mentioned in requirements)

Thought 2: Product A has better benchmarks but costs 2x more

Thought 3: Customer's budget is limited (mentioned earlier)

Thought 4: Product B offers best value within their budget

Conclusion: Recommend Product B with explanation of tradeoffs

Tree-of-Thought Reasoning

Exploring multiple reasoning paths simultaneously:

  • Generate multiple possible approaches
  • Evaluate each path's likelihood of success
  • Select the most promising path
  • Backtrack if a path fails

Confidence Scoring

Agents should know when they're uncertain:

def decide_with_confidence(query, context):

response = llm.generate(query, context)

confidence = evaluate_confidence(response, context)

if confidence > 0.8:

return response

elif confidence > 0.5:

return f"I'm not fully certain, but: {response}"

else:

return "I'm not confident enough to answer. Let me escalate this."

Human-in-the-Loop Patterns

When to involve humans:

  • Approval gates: Agent proposes action, human approves
  • Escalation: Agent recognizes it can't handle the task
  • Feedback loops: Human corrects agent, agent learns
  • Oversight: Human monitors agent actions in real-time

Key Takeaways

  • Chain-of-thought improves reasoning on complex problems
  • Tree-of-thought explores multiple solutions in parallel
  • Confidence scoring prevents agents from acting on uncertain information
  • Human-in-the-loop ensures safety for high-stakes decisions

Test Your Knowledge

5 randomized questions from a pool of 10. Pass with 60% to unlock the next lesson.