Agent Frameworks
Agent Frameworks
A hands-on tour of the best-known agent frameworks: OpenAI Agents SDK, LangGraph, CrewAI and Microsoft Agent Framework (the successor of AutoGen), and how to choose between them.
About the module
After building the agent from its basic components by hand, in this module you meet the frameworks that shorten this work in practice. We study four schools of design: a simple agent loop with handoffs in the OpenAI Agents SDK, an explicit state graph in LangGraph, a team of roles and tasks in CrewAI, and agents and workflows in Microsoft Agent Framework, which succeeded AutoGen and Semantic Kernel. For each framework we show the central idea, a documented snippet that matches the official documentation with a clear review date, and when it fits and when it does not. We close with a practical method for choosing a framework according to the project's requirements rather than popularity, with a reminder that these libraries change quickly, so always check the version and the documentation before building.
Learning objectives
- Distinguish the main design patterns behind agent frameworks: the loop, the state graph and the role-based team
- Read snippets of OpenAI Agents SDK, LangGraph, CrewAI and Microsoft Agent Framework and understand every line
- Identify what a framework adds on top of a hand-written agent loop: tracing, persistence, handoffs and guardrails
- Understand the current status of AutoGen and the teams' move to Microsoft Agent Framework
- Choose a suitable framework for a specific project and justify the choice with clear criteria
Prerequisites
- Completion of the fundamentals module and understanding of the agent loop
- The tools module and function calling
- The multi-agent module and the concepts of handoff and shared state
- Basic knowledge of Python and virtual environments (venv)
Skills gained
Lessons
- 1A map of agent-building frameworksThe Agent Frameworks LandscapeFrameworks cut down the repetitive code in building agents, but they differ in their central idea. In this lesson we see what any framework…
- 2OpenAI Agents SDK: the agent, the runner and the handoffOpenAI Agents SDK: Agents, Runner and HandoffsThe OpenAI Agents SDK offers a small number of concepts: an agent, a runner, a handoff and guardrails. In this lesson we read the documented…
- 3LangGraph: the agent as a state graphLangGraph: Agents as State GraphsLangGraph treats the agent as a graph: nodes that read and update a shared state, and edges that define the path. In this lesson we build a…
- 4CrewAI: agent teams, roles and tasksCrewAI: Crews, Roles and TasksCrewAI borrows the language of work teams: agents with roles and goals, tasks with expected outputs, and a process that sets the order of ex…
- 5From AutoGen to the Microsoft Agent FrameworkFrom AutoGen to Microsoft Agent FrameworkAutoGen became known for the idea of agents that converse to solve tasks, but it no longer receives new releases, and it has been officially…
- 6How do you choose the right agent framework?Choosing an Agent FrameworkThere is no absolutely best framework, only a framework better suited to a specific problem. In this lesson we turn the problem into require…
Module diagrams
Module terms
| Term | English | Definition |
|---|---|---|
| Agent framework | Agent Framework | A library that provides ready-made components for building and running agents |
| Tracing | Tracing | Recording every call to the model and the tools in an inspectable trace |
| Persistence | Persistence | Saving the state of a run so that it can be resumed later |
| Handoff | Handoff | Transferring the conversation from one agent to a specialized agent |
| State graph | State Graph | Representing the workflow as nodes and edges that share a single state |
| Runner | Runner | The object that manages the agent's execution loop until the final output |
| Final output | final_output | The output of the last agent that worked in the run |
| Function tool | function_tool | A decorator that turns a Python function into a tool the agent calls |
| Guardrail | Guardrail | A check on the inputs or outputs that stops execution on failure |
| Maximum number of cycles | max_turns | A cap on the number of loop cycles that raises MaxTurnsExceeded when exceeded |
| Node | Node | A function that reads the state and returns an update to it |
| Edge | Edge | A defined transition from one node to another |
| Messages state | MessagesState | A ready-made state with a messages key to which new messages are appended |
| Durable execution | Durable Execution | The ability to resume a run after an interruption from the last saved state |
| Compile | compile | Turning the builder into a runnable graph |
| Crew | Crew | A group of agents and tasks executed according to a specific process |
| Role | Role | A description of the agent's function within the team |
| Expected output | expected_output | A description of the shape of the task's result and its completion criteria |
| Sequential process | Sequential Process | Executing tasks in order, passing the results along |
| Hierarchical process | Hierarchical Process | A manager that distributes tasks and reviews the results |
| Conversable agent | Conversable Agent | An agent that sends and receives messages within a multi-agent conversation |
| Workflow | Workflow | A graph-based flow of steps and agents controlled by code |
| Termination condition | Termination Condition | A rule that stops the conversation when a specific goal is met |
| Chat client | Chat Client | An object that connects the agent to a particular language model provider |
| Successor framework | Successor Framework | A framework that replaces an earlier framework and continues its development |
| Requirements | Requirements | What the system must achieve, against which the choice is measured |
| Decision matrix | Decision Matrix | A table of criteria, weights and scores for comparing options |
| Exploratory prototype | Spike | A short experiment to test a technical hypothesis before committing |
| Version pinning | Version Pinning | Specifying the library's version number in the requirements file |
| Workflow vs agent | Workflow vs Agent | A fixed path set by code versus a path decided by the model |
Hands-on experiment
Representing the agent as a state graph Agent as a State Graph
To connect the simulator's diagram with the StateGraph concept in LangGraph: nodes that work on a shared state and edges that determine the path, including conditional edges.
- Open the Simulator (open ↗) and build a diagram: Start, then LLM with the task classify, then Decision, then two branches, then Output, then End
- Set Decision to the contains rule with a keyword as the value, and make one branch go to a Tool with the knowledge_search tool and the other to an LLM with the task answer
- Run with two different inputs and notice which branch was executed each time
- Export the diagram as JSON and read the structure of nodes and their edges
- Write on paper what corresponds to each node in LangGraph: add_node for each node and add_edge from START and to END
- Add a Human Approval node before Output and notice how it resembles the stopping point in human in the loop
What you will notice: You will notice that the path is determined by the state and the conditions, not by a fixed order, and that the exported JSON file is data that only describes the graph. This is the same thinking LangGraph requires, although the actual framework code needs the library to be installed.
Final task
Design a "support request triage agent" twice, on paper and then in the academy simulator (open ↗): once as a single-agent loop with a handoff to a specialised agent (in the style of the OpenAI Agents SDK), and once as a state graph with explicit nodes (in the style of LangGraph). Submit: (1) a diagram of each design, (2) a code snippet for each that matches the interface shapes given in the lessons, with the version number and the review date, (3) a weighted selection matrix of at least five criteria ending with a justified recommendation. Acceptance criteria: every node or agent has one clear responsibility, there is a maximum number of iterations and a human approval point before any action that changes customer data, and no framework is credited with an undocumented feature.
Completion criteria: the module counts as complete when you finish all its lessons and pass its quiz.
Official references
- OpenAI Agents SDK openai.github.io Reviewed on 2026-11-18
- LangGraph overview docs.langchain.com Reviewed on 2026-11-18
- CrewAI Agents docs.crewai.com Reviewed on 2026-11-18
- Microsoft Agent Framework overview learn.microsoft.com Reviewed on 2026-11-18
