---
id: agent-evolution
lang: en
title: "Agent evolution: a shared idea with different execution layers"
prerequisites: [agents-and-search, semantic-versioning]
created: 2026-10-16
updated: 2026-10-16
source_lectures: [19]
status: documented-from-subtitles
---

# Agent evolution: a shared idea with different execution layers

## Objective and entry question

Understand why the course demonstrates several implementations and how to distinguish similar API names. Does adopting a new tool interface necessarily replace the underlying model/tool cycle?

<details><summary>Entry answer</summary>

No. Receiving a goal, choosing an action, observing its result, and continuing can remain the core idea while request representation and execution infrastructure change.

</details>

## Which problem does each layer address?

Lecture 019 describes a path from textual ReAct to structured tool calls, LangGraph-based execution, and `create_agent`. This table maps the conceptual narrative; projects need not pass through every generation.

| Layer | Main concern | Key question |
|---|---|---|
| Actions represented in text | Extract tool names and inputs | What if the format is not followed? |
| Structured tool requests | Make names and arguments explicit | Are values valid in type and meaning? |
| Controlled execution | State, routing, stopping, and continuation | What survives a failure? |
| Higher-level interface | Reduce coordination code for common patterns | What is ready-made and what needs configuration? |

Free text requires a parser to interpret actions; small format changes may break it. Clearer structure reduces this problem without eliminating invalid meanings or inappropriate operations. For example, `{"skill": ""}` is valid JSON but not usable input for our tool.

## Why might a while loop be insufficient?

A manual loop makes a short teaching example understandable. Longer tasks may need saved state, resuming after interruption, or branching execution. These concern execution infrastructure rather than prompt wording alone.

LangGraph supplies workflow execution infrastructure beneath LangChain agents. That does not mean every code fragment automatically has persistent state, recovery, or appropriate production configuration. Application configuration and testing still matter. [Agent guide](https://docs.langchain.com/oss/python/langchain/agents)

## Read API names with package paths and versions

The v1 migration guide compares `langgraph.prebuilt.create_react_agent` with `langchain.agents.create_agent`. Do not assume a simple rename or arbitrary import substitution: examine the input contract, settings, and behavior you rely on. [Official migration guide](https://docs.langchain.com/oss/python/migrate/langchain-v1)

For an older example, identify package, version, complete import path, and input/output shape. Identically named functions in different packages need not expose the same API. Python documentation spells `create_agent` with an underscore; the subtitles' “createAgent” is not copyable Python code.

## Why start at a higher level?

The instructor plans to teach current usage first, then return to earlier implementations to explain internals. An old API appearing later is not necessarily a teaching mistake. Identify whether a section explains historical mechanics or recommends a current implementation.

Our `tool_loop.py` likewise demonstrates mechanics rather than claiming to replace `create_agent`. No new real-model agent using that API was built or tested in this lesson; that work belongs to subsequent setup/tool sections.

## Independent practice

1. JSON is valid, but the model requests an unknown tool. Has structured output solved the problem?
2. Why does “built on LangGraph” not alone establish production readiness?
3. You find `create_react_agent` in an older tutorial. What do you record before replacing it?

<details><summary>Answer 1</summary>

Only the representation is clearer. Validate the tool name, input contract, and permitted action separately. Our simulator rejects unknown tools.

</details>

<details><summary>Answer 2</summary>

Infrastructure supplies capabilities. State persistence, failures, execution limits, evaluations, and application requirements still need actual design and verification.

</details>

<details><summary>Answer 3</summary>

Package and version, import path, input/output, and relied-on features. Then inspect migration guidance and relevant behavioral checks.

</details>

## Recall and continuation

Explain without the table why structured tool calls and workflow control address different problems. If you can give one data failure and one execution failure, continue to lecture 020, search-agent environment setup. Otherwise, revisit the simulator's unknown-tool and turn-limit paths.

Course basis: the complete lecture 019 subtitles. Table organization and examples are supplementary. Exact first-release dates for each API were not established from the subtitles; this is not a complete release chronology. Official sources checked on 2026-10-16; video not visually reviewed.
