Session 6 · Live Example

Watch a ReAct Agent Think

This is exactly what happens inside your Colab notebook. The agent receives a question, then reasons, acts, observes, and repeats until it has a great answer.

User Input
"Research the impact of AI on the job market. I need specific data, credible sources, and a balanced view."
0
Agent Steps
0
Tool Calls
0
Sources Checked
0
Facts Extracted
Thought Step 1
The user wants research on AI's impact on jobs. I need specific data with numbers, not opinions. Let me start by searching for recent, authoritative sources on AI and employment. I'll look for statistics from reputable organizations.
Action Step 2
Calling the search tool with a specific query targeting data and statistics:
web_search("AI impact on job market statistics 2025")
Observation Step 3
Got 4 results back. Let me see what we have:
9/10 Reuters — "AI Will Transform 40% of Jobs Worldwide, IMF Says"
9/10 McKinsey — "AI Could Automate 30% of Work Hours by 2030"
9/10 World Economic Forum — "85M Jobs Displaced, 97M Created"
7/10 LinkedIn Economic Graph — "AI Jobs Boom: Tech Salaries Hit Record"
Thought Step 4
Good results. I have data from IMF, McKinsey, WEF, and LinkedIn. But the user asked for a "balanced view" — McKinsey is a consulting firm that might lean pro-technology. I should verify source credibility before trusting the data. Let me check the two most impactful sources.
Action Step 5
Evaluating the credibility of my key sources:
evaluate_source("Reuters")
evaluate_source("McKinsey Global Institute")
Observation Step 6
Source credibility results:
9/10 Reuters — Wire Service — "Minimal bias. Highly trustworthy."
8/10 McKinsey — Consulting — "Pro-business perspective. May understate disruption risks."
Thought Step 7
Interesting — McKinsey scores 8/10 but with a noted "pro-technology perspective" that may understate disruption risks. This is exactly the kind of nuance the user needs for a "balanced view." Reuters and WEF are solid anchors. Now let me extract the hard numbers from these sources for the report.
Action Step 8
Extracting structured facts from the search results:
extract_key_facts("IMF estimates AI will affect 40% of global employment. In advanced economies, 60% of jobs exposed. McKinsey: 30% of work hours automatable by 2030. WEF: 85M displaced, 97M created, net +12M jobs...")
Observation Step 9
Key facts extracted and categorized:
40% Jobs affected globally (IMF)
60% Jobs exposed in advanced economies
85M Jobs displaced by 2025 (WEF)
97M New jobs created (WEF)
30% Work hours automatable by 2030
Thought Step 10
I now have 5 hard data points from 4 verified sources with credibility ratings. I noted McKinsey's pro-tech bias for balance. I have both the displacement story (85M jobs) and the creation story (97M jobs). The user asked for a balanced view — I can deliver that now. Time to synthesize.
Synthesized Report Final Output

Research Briefing: AI's Impact on the Job Market

Executive Summary

AI will significantly reshape global employment, but the narrative is transformation, not elimination. While 85 million jobs face displacement, approximately 97 million new roles will emerge — a net positive of 12 million jobs. However, the transition will be uneven and requires massive reskilling.

Key Findings

  • 40% of all jobs worldwide will be affected by AI (IMF, via Reuters, credibility: 9/10)
  • 60% of jobs in advanced economies are exposed — half will benefit, half face displacement risk
  • 30% of current work hours could be automated by 2030 (McKinsey, credibility: 8/10 — note: may understate disruption)
  • Net +12 million jobs projected: 97M created vs. 85M displaced (World Economic Forum)
  • Top growing roles: AI specialists, data analysts, digital transformation experts

Source Quality

3 of 4 sources rated 8+/10 credibility. Note: McKinsey's pro-business perspective may present an optimistic view of automation. Balanced against IMF and WEF data which include displacement risks.

Confidence Level

Low HIGH (82%) Max

Recommended Next Steps

  • Research industry-specific impacts (healthcare, finance, manufacturing)
  • Investigate reskilling programs and their effectiveness
  • Examine geographic differences (advanced vs. developing economies)
Same Question, Two Agents
What happens when you ask a naive agent vs. a ReAct agent the same question?

Naive Agent

1 step · 0 tools · No verification
  • × Answers from memory (no search)
  • × No source citations
  • × No credibility checks
  • × Vague: "AI will impact many jobs"
  • × May hallucinate statistics
  • × No structure or confidence level

ReAct Agent

11 steps · 5 tool calls · 4 sources verified
  • Searched for specific data
  • Cited Reuters, IMF, McKinsey, WEF
  • Checked source credibility (8-9/10)
  • Specific: "40% of jobs, +12M net"
  • Noted McKinsey's pro-tech bias
  • Structured report with confidence level

This is what you're about to build. Open the Colab notebook and you'll wire these exact same tools — web_search, evaluate_source, extract_key_facts — into a ReAct loop. By the end of class, your agent will produce reports like this one.