Javier-Jimenez99's picture
Actualizar la secciรณn de autores en README.md para incluir enlaces a los perfiles de Hugging Face.
77de767

A newer version of the Gradio SDK is available: 5.46.0

Upgrade
metadata
title: LLM Game Master Agent
emoji: ๐Ÿง™๐Ÿผโ€โ™‚๏ธ
colorFrom: yellow
colorTo: indigo
sdk: gradio
sdk_version: 5.32.1
app_file: app.py
tags:
  - agent-demo-track
  - mcp-server-track

๐Ÿง™โ€โ™‚๏ธ LLM Game Master Agent ๐Ÿ‰

Made by: @Agamador @Javier-Jimenez99

๐ŸŽฅ Video Demo

<iframe width="560" height="315" src="https://www.youtube.com/embed/SlbW-kjekBg?si=r6x8GeVnKLipriZL" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Video Demo: https://www.youtube.com/watch?v=SlbW-kjekBg&ab_channel=AlejandroGarcรญaAmador

๐Ÿงฉ Complete Architecture Overview

Architecture Overview

๐Ÿ”— Useful Links:

๐ŸŒŸ Introduction

The LLM Game Master Agent is a sophisticated AI system designed as a Game Master (GM) for solo medieval fantasy role-playing sessions. This cutting-edge application showcases the power of LangGraph React architecture combined with Model Context Protocol (MCP) technology, creating an immersive and highly adaptive gaming experience unlike anything seen before.

Unlike conventional chatbots, this intelligent agent generates dynamic and personalized narratives where YOU become the protagonist in epic fantasy stories. The application leverages state-of-the-art language models to deliver a gaming experience comparable to traditional sessions with a human Game Master, but with the added benefits of AI-powered adaptability and endless creative possibilities.

๐Ÿง  LangGraph React: The System Core

The LLM Game Master Agent utilizes LangGraph as the central component of its architecture, implementing the React pattern for complex task management.

The implementation uses LangGraph's create_react_agent function to create a reactive agent that can maintain conversation state, reason over multiple steps, and make informed decisions based on the complete tools execution trace.

React Agent Diagram

๐Ÿ”Œ MCP Client: Integration with External Tools

The system implements a Model Context Protocol (MCP) client that connects to an external MCP server. This client-server architecture allows the agent to access specialized gaming tools without implementing them directly in the codebase.

The implementation uses MCP-specific adapters for LangChain that facilitate communication between the agent and the tools server.

This architecture separates the agent logic from the tool implementation, making the system more modular and easier to maintain. The agent can invoke tools as needed through the MCP connection, while focusing on its core narrative generation and decision-making capabilities.

๐Ÿค– Language Model Orchestration

The system uses LangChain to orchestrate language models, offering compatibility with:

  • Anthropic Claude: Claude 3 models via API
  • Ollama: Local deployment of models for self-hosted scenarios

This flexibility allows selecting the most suitable model based on performance requirements and availability.

๐Ÿ–ฅ๏ธ Gradio User Interface

The application features a complete web interface built with Gradio, offering two main views:

  1. Complete View with History: Shows the conversation along with detailed execution tracking including tools and agent messages.
  2. Original API: A simpler interface for API access.

The interface includes features for:

  • Tracking multiple sessions via tab IDs
  • Detailed visualization of tool calls and their results
  • Session management controls
  • API key configuration

The execution history provides complete transparency into the agent's decision-making process, showing each step of the interaction between the user, agent, and tools.

๐Ÿ”— Links & Resources