This multi-agent AI text adventure game—inspired by Zork and affectionately called Agents & Arbiters—demonstrates how to implement a multi-agent system with multi-channel state using LangGraph.js. Built on Azure using Static Web Apps, Azure Functions, Azure Managed Redis, and Azure OpenAI, this demo showcases Redis' ability to store workflow state and manage short-term conversation context using Agent Memory Server.
- Demo Objectives
- Setup
- Running the Demo
- Slide Decks
- Architecture
- Known Issues
- Resources
- Maintainers
- License
- Show how to build a multi-agent system with multi-channel state using LangGraph.js.
- Demonstrate the usage of Azure Managed Redis's JSON and search capabilities to store and query persistent state for AI workflows.
- Highlight Redis Agent Memory Server as a tool to manage short-term memory for AI workflows.
For Local Development:
- Node.js v22+
- Docker for local Redis, AMS, and LiteLLM
- OpenAI API Key
For Azure Deployment:
- Azure subscription
- Azure CLI
- Azure Developer CLI
Local Configuration:
Copy .env.example to .env and fill in your OpenAI API key.
cp .env.example .envIf you use Node Version Manager run:
nvm useInstall Node.js dependencies for the top level orchestration project:
npm installInstall Node.js dependencies for the web and api projects:
npm run install:allAzure Configuration:
No configuration necessary.
Running Locally:
In one terminal window start the Docker services for Redis, Agent Memory Server, and LiteLLM:
docker compose upIn another terminal window, start the development servers:
npm run devThis will compile and start the application. Now, just navigate to http://localhost:4280 in your browser and start playing the game.
Running on Azure:
azd upNavigate to the URL provided by the azd up command in your browser and start playing the game.
When you launch the game you will be presented with options for a New Game, Load Game, and Load World Template.
If it is your first time running the game you will need to load a world template before you can play. There are some AI-generated templates to choose from in the templates directory in this repository. Click Load World Template and choose one that sounds interesting to you.
Once the template is loaded you can start a new game. Click New Game and give your game a name or keep the randomly generated one. Ask the game 'Where am I?' and it'll tell you. From there, just start typing commands to explore the world.
You can also load a saved game by clicking Load Game and selecting a game from the list. Games are saved automatically as you play. No need to save manually.
You can view the game log by clicking Log in the top right of the game screen. This will show you the underlying workflow and all the LLM calls. Click Terminal to go back to the game.
When you're done playing, just close the window. If you're running locally, your game data will be preserved in Redis. If you're running on Azure, your game data is stored in Azure Managed Redis and will be preserved unless you delete the resources.
Running Locally:
Just hit Ctrl+C in the terminal windows where you ran npm run dev and docker compose up respectively.
Running on Azure:
azd down --purgeNote that this will delete all resources, including the Redis database. All data will be lost.
📁 Multi-Agent AI Text Adventure Game Slides
Covers goals, the agent workflow and architecture, and key Redis features. Suitable for formal presentations.
📁 Agents & Arbiters Slides
Covers the game design, an introduction to LangGraph.js, patterns of multi-agent workflows, multi-channel annotations, and how Redis fits in. Suitable for usage at a developer conference.
The Svelte 5 + Tailwind CSS frontend is hosted on Azure Static Web Apps and sends user requests to a collection of Azure Functions written in TypeScript. These functions use Redis to store game state, Agent Memory Server to manage conversation context, and Azure OpenAI as the LLM provider. The agent workflow itself is implemented using LangGraph.js.
The agent workflow shows the router handling the initial user command and routing to the appropriate agents based on the command. The arbiter then reviews the agent responses and makes a final decision on how to proceed. Finally, the committer applies the changes to the game state and the narrator generates the final response.
The custom annotation is a key feature of LangGraph.js that allows you to define the structure of the state and how it flows between nodes in the graph. In this example, the custom annotation defines the structure of the game state and how it is updated by each node in the graph.
- Redis Agent Memory Server is only integrated with the narrator agent. This means that conversation history is not available to other agents in the workflow who might need them. Not a bug, but a limitation of the current implementation. A better approach would be to load the conversation from Agent Memory Server at the start of the workflow and then store it in the custom annotation.
- There are only a few entity agents implemented—location, fixture, and exit. The game engine is designed to support many more and adding items and NPCs would be a good next step and would drive how to implement player inventory and combat.
- Azure Managed Redis
- LangGraph.js
- LangGraph's Multi-Agent Collaboration Documentation.
- Redis Agent Memory Server
- Redis' JSON Documentation
Maintainers:
- Guy Royse — guyroyse
This project is licensed under the MIT License.


