A sophisticated multi-agent system built with LangGraph that demonstrates advanced Generative UI capabilities. The system intelligently routes between multiple specialized handlers including weather queries, task planning, and video editing workflows, responding with both conversational text and rich, interactive UI components.
๐ค๏ธ Real Weather Data - Integrates with WeatherAPI for live weather information with intelligent city detection
๐ AI-Powered Task Planning - Uses OpenAI to generate detailed step-by-step plans from user requests
๐ฌ Video Editing Workflows - Specialized dual-column task management for video editing projects
๐จ Advanced Generative UI - Backend dynamically commands frontend to render specialized components
โจ Rich Interactive Components - Modern TypeScript React components with animations and progress tracking
๐ง Intelligent Multi-Agent Routing - LLM-powered routing between weather, todo, and video editing handlers
๐ Multi-language Support - Automatic language detection with responses in English, Chinese, and Japanese
๐๏ธ Modular Architecture - Component-based handlers with extensible registry system
๐ Hot Reload Development - Real-time updates during development with LangGraph Studio
๐งช Comprehensive Testing - Unit and integration tests with CI/CD workflows
- User Input: "What's the weather in London?"
- Intelligent Routing: LLM analyzes request and routes to weather handler
- City Detection: OpenAI-powered extraction of city from natural language
- Live Data Fetch: Integrates with WeatherAPI for real-time weather information
- Dual Response:
- Conversational AI message: "Here's the current weather for London"
- UI Component: Renders animated weather card with live data
- Rich Display: Interactive weather card with temperature, conditions, humidity, and wind speed
- User Input: "Help me plan a birthday party"
- Intelligent Routing: LLM identifies task planning intent and routes to todo handler
- AI Task Generation: OpenAI generates detailed, actionable task breakdown
- Dual Response:
- Conversational AI message: "I've created a task plan for: Birthday Party Planning"
- UI Component: Renders interactive todo list with checkboxes
- Rich Display: Animated todo card with progress tracking and completion badges
- User Input: "Help me edit a promotional video"
- Intelligent Routing: LLM identifies video editing intent and routes to video editing handler
- Workflow Generation: AI creates specialized subtraction and addition task lists
- Dual Response:
- Conversational AI message: "I've created a video editing plan with removal and addition tasks"
- UI Component: Renders dual-column interface with separate task categories
- Rich Display: Professional diff-like interface with separate progress tracking for each task type
- "What's the weather in London?"
- "Current temperature in Tokyo"
- "Weather forecast for New York"
- "Is it raining in San Francisco?"
- "Create a checklist for moving to a new apartment"
- "Help me organize my work schedule"
- "Plan steps for learning a new programming language"
- "What tasks do I need for hosting a dinner party?"
- "Help me edit a promotional video"
- "Video editing workflow for social media content"
- "Steps to create a product demo video"
- "Edit a wedding video with music and transitions"
- English: "What's the weather like?"
- Chinese: "ไปๅคฉๅคฉๆฐๆไนๆ ท๏ผ"
- Japanese: "ไปๆฅใฎๅคฉๆฐใฏใฉใใงใใ๏ผ"
- Install dependencies, along with the LangGraph CLI, which will be used to run the server.
cd path/to/your/app
pip install -e . "langgraph-cli[inmem]"- Create a
.envfile and configure your API keys.
cp .env.example .envRequired API Keys: Add your API keys to enable full functionality:
# .env
OPENAI_API_KEY=your_openai_api_key_here
WEATHER_API_KEY=your_weatherapi_key_here
Optional: If you want to enable LangSmith tracing, add your LangSmith API key:
# .env
LANGSMITH_API_KEY=lsv2...
API Key Requirements:
- OpenAI API Key: Required for intelligent routing, task planning, and video editing workflows
- WeatherAPI Key: Required for real-time weather data (get free key at weatherapi.com)
- Without these keys, handlers will fall back to basic templates with mock data
- Start the LangGraph Server.
langgraph dev- Open
https://agentchat.vercel.app/in Chrome, and connect to local server.
For more information on getting started with LangGraph Server, see here.
langgraph.json- Configuration hub connecting backend graph to frontend UIsrc/agent/graph.py- Multi-agent graph with intelligent routing and component handlingsrc/agent/handlers/- Modular component handlers (weather, todo, video_editing)src/agent/components/- TypeScript React UI components with animationssrc/agent/utils/- Language detection and response formatting utilitiestests/- Comprehensive unit and integration test suites
User Query โ Language Detection โ LLM Routing โ Handler Processing โ Dual Response
โ โ โ โ โ
"help edit Auto-detect Route to Generate AI Message +
video" language VideoHandler tasks UI Component
โ โ
Subtraction/ VideoEditingComponent
Addition Tasks (Dual-column layout)
- Modular Handlers: Each component type has its own specialized handler
- Component Registry: Dynamic registration and discovery of handlers
- Type Safety: Full TypeScript support with component prop interfaces
- Language Support: Automatic detection and multi-language responses
- Extensible Design: Easy to add new handlers and UI components
- Create Handler Class in
src/agent/handlers/:
from .base import BaseComponentHandler
class MyCustomHandler(BaseComponentHandler):
@property
def component_type(self) -> str:
return "myCustom"
async def process_request(self, request: str, language: str = 'en') -> Dict[str, Any]:
# Your custom logic here
pass- Register Handler in
src/agent/handlers/registry.py:
from .my_custom import MyCustomHandler
component_registry.register_handler(MyCustomHandler())- Create React Component in
src/agent/components/:
interface MyCustomProps {
// Define your props
}
const MyCustomComponent: React.FC<MyCustomProps> = (props) => {
// Your component implementation
};- Register Component in
src/agent/components/index.ts:
import MyCustomComponent from './MyCustomComponent';
export default {
// ... existing components
myCustom: MyCustomComponent,
};- Weather Handler: Modify city detection, add new weather APIs, customize styling
- Todo Handler: Update task generation prompts, add categories, enhance UI
- Video Editing Handler: Add new task types, customize workflows, enhance progress tracking
- Multi-step Workflows: Chain multiple handlers for complex tasks
- Custom Language Support: Add new languages to
src/agent/utils/language.py - Real-time Features: Implement WebSocket connections for live updates
- User Context: Add user preferences and personalization
While iterating on your graph in LangGraph Studio, you can edit past state and rerun your app from previous states to debug specific nodes. Local changes will be automatically applied via hot reload.
Follow-up requests extend the same thread. You can create an entirely new thread, clearing previous history, using the + button in the top right.
For more advanced features and examples, refer to the LangGraph documentation. These resources can help you adapt this template for your specific use case and build more sophisticated conversational agents.
LangGraph Studio also integrates with LangSmith for more in-depth tracing and collaboration with teammates, allowing you to analyze and optimize your chatbot's performance.


