Offered By: IBMSkillsNetwork
Create an Adaptive Pick-Your-Path Game with LangGraph
Build an AI game agent to tell any story. Using LangGraph, OpenAI's GPT-5.4, and Pydantic for structured output, create an agent that interprets natural-language commands, renders scenes, transitions through a branching scene graph, and detects narrative endings — all without rigid menus or keyword matching. Learn the agentic AI patterns behind interactive fiction systems while building a stateful game loop you can adapt to any story you can imagine.
Continue readingGuided Project
Artificial Intelligence
At a Glance
Build an AI game agent to tell any story. Using LangGraph, OpenAI's GPT-5.4, and Pydantic for structured output, create an agent that interprets natural-language commands, renders scenes, transitions through a branching scene graph, and detects narrative endings — all without rigid menus or keyword matching. Learn the agentic AI patterns behind interactive fiction systems while building a stateful game loop you can adapt to any story you can imagine.
At a Glance
The old "press A, B, or C" model of choose-your-own-adventure games is restrictive, outdated, and boring. Today's most immersive interactive fiction lets players type whatever they want and uses LLMs to figure out what they actually meant. This guided project teaches you to build a pick-your-path game agent from scratch using LangGraph, GPT, and Pydantic. You won't just hard-code a story tree — you'll design a stateful workflow where specialized nodes handle scene rendering, intent classification, scene transitions, and ending detection, each passing structured data to the next through a shared state graph.
What You'll Learn
- Design stateful agent workflows with LangGraph: Understand how to define typed state schemas, build processing nodes, and wire them into directed graphs with conditional edges — the architecture pattern behind production AI agents.
- Use structured LLM outputs for reliable intent classification: Combine OpenAI's GPT models with Pydantic schemas to force the LLM into predictable, parseable output, so your agent can confidently route free-form player input to valid story actions.
- Build a branching story graph with dynamic routing: Design scenes, actions, and endings as a connected data structure, and use LangGraph's conditional edges to loop through gameplay until a terminal scene is reached.
Who Should Enroll
- Beginner to intermediate Python developers who have used LLM APIs for basic tasks and want hands-on experience building stateful, multi-step agent systems with real game logic.
- Software engineers and indie game developers curious about how AI can power interactive fiction, dialogue systems, or natural-language game interfaces without giving up authored narrative control.
- Aspiring AI agent builders who want to learn LangGraph's state management and graph orchestration through a fun, creative project before applying the same patterns to research agents, chatbots, or workflow automation.
Why Enroll
What You'll Need
Certificate
No Certificate Offered
Estimated Effort
60 Minutes
Level
Intermediate
Skills You Will Learn
Artificial Intelligence, LLM, Generative AI, NLP, Python
Language
English
Course Code
GPXX0Q2MEN
Released
May 25, 2026