How breeznik/agui_demo works
AG-UI Demo is a Breeze flight-booking assistant: users chat in either a React or vanilla-JS browser, while a FastAPI service streams a LangGraph ReAct agent’s responses and state. The documented booking path is flight search, flight selection, passenger details, approval interrupt, and confirmation into a cart; flights are invented rather than sourced from an airline. The graph also covers BYOK configuration and request-scoped model access. Edges follow the excerpts or README; unsampled implementation details are not inferred.
Main entry points: graph.py ReAct agent graph · app.py Agent API · ChatInterface.jsx Chat interface · useAgentChat.js Agent chat hook
Components 20
Browser clients
- React app
frontend/src/App.jsx - Chat interface
frontend/src/Chat/ChatInterface.jsx - Agent chat hook
frontend/src/hooks/useAgentChat.js - Stream helpers
frontend/src/lib/agentStream.js - Key handling
frontend/src/lib/apiKey.js - Provider config
frontend/src/hooks/useAgentConfig.js - Booking panel
frontend/src/Chat/BookingPanel.jsx - Vanilla client
frontend-vanilla/src/main.js - Stream helpers
frontend-vanilla/src/agentStream.js
Agent service
- Agent API
backend/src/app.py
Booking workflow
- ReAct agent graph
backend/src/graph.py - Search flights
backend/src/graph.py - Select flight
backend/src/graph.py - Save passenger
backend/src/graph.py - Confirm booking
backend/src/graph.py - Review booking
backend/src/graph.py - Booking cart
backend/src/graph.py
Model and context
- Context limits
backend/src/middleware.py - LLM provider
Other components
- Traveler
Connections 27
- Traveler → Chat interface: chats in
README.md - Traveler → Vanilla client: chats in
README.md - React app → Chat interface: renders
frontend/src/App.jsx - Chat interface → Agent chat hook: uses
frontend/src/Chat/ChatInterface.jsx - Chat interface → Provider config: loads config
frontend/src/Chat/ChatInterface.jsx - Chat interface → Booking panel: renders state
frontend/src/Chat/ChatInterface.jsx - Agent chat hook → Stream helpers: uses
frontend/src/hooks/useAgentChat.js - Agent chat hook → Key handling: sets headers
frontend/src/hooks/useAgentChat.js - Agent chat hook → Agent API: streams runs
README.md - Provider config → Agent API: fetches config
frontend/src/hooks/useAgentConfig.js - Vanilla client → Stream helpers: uses
frontend-vanilla/src/main.js - Vanilla client → Agent API: streams runs
README.md - Agent API → ReAct agent graph: runs graph
backend/src/app.py - ReAct agent graph → Search flights: dispatches tools
README.md - ReAct agent graph → Select flight: dispatches tools
README.md - ReAct agent graph → Save passenger: dispatches tools
README.md - ReAct agent graph → Confirm booking: dispatches tools
README.md - ReAct agent graph → Review booking: dispatches tools
backend/src/graph.py - Search flights → Select flight: offers options
README.md - Select flight → Save passenger: precedes details
README.md - Save passenger → Confirm booking: precedes approval
README.md - Confirm booking → Booking cart: adds confirmed
README.md - Review booking → Booking cart: reads state
backend/src/graph.py - ReAct agent graph → Context limits: uses middleware
backend/src/graph.py - ReAct agent graph → LLM provider: calls model
backend/src/graph.py - Agent API → Agent chat hook: streams events
README.md - Agent API → Vanilla client: streams events
README.md