Back to course

Designing a State Machine for your Agent

Agentic AI Engineering (Build, don't just prompt)

What is State?

State is the 'memory' of the current execution. It might contain the user input, intermediate search results, and the final answer.

Implementing TypedDict

In Python, we use TypedDict to define the shape of our state. This ensures type safety throughout the graph.