How mrzasad/langgraph-superstore-ai-assistant works
This is a Streamlit conversational shopping assistant. A shopper enters a request in the chat; the LangGraph agent consults an LLM, dispatches shopping tools, and returns a response to the UI. Product search, loyalty lookup, price calculation, cart operations, and checkout are distinct capabilities; adding an item pauses for approval before the cart changes. Product and user data are loaded from the repository’s spreadsheet and JSON file. The excerpts show the main graph, data loading, approval flow, and UI; some tool implementations and wiring are documented in the README rather than excerpted.
Main entry points: agent.py Tool dispatch · llm.py LLM configuration · imtiaz_superstore_products.xlsx Product spreadsheet · users_data.json User profiles
Components 18
Conversation
- Chat and sidebar
agent.py - LangGraph agent
agent.py - LLM call
agent.py - LLM configuration
llm.py - Approval controls
agent.py
Shopping capabilities
- Tool dispatch
agent.py - Product search
agent.py - Loyalty lookup
agent.py - Price calculation
agent.py - Add to cart
agent.py - View and remove
agent.py - Checkout response
agent.py
State and data
- Product spreadsheet
imtiaz_superstore_products.xlsx - User profiles
users_data.json - Session cart
agent.py - Conversation checkpoint
agent.py
Other components
- Shopper
- Groq model
Connections 22
- Shopper → Chat and sidebar: sends request
README.md - Chat and sidebar → LangGraph agent: invokes
agent.py - LangGraph agent → LLM call: routes to
agent.py - LLM call → LLM configuration: calls
agent.py - LLM configuration → Groq model: configures
llm.py - LangGraph agent → Tool dispatch: dispatches tools
README.md - Tool dispatch → Product search: runs
README.md - Tool dispatch → Loyalty lookup: runs
README.md - Tool dispatch → Price calculation: runs
README.md - Tool dispatch → Add to cart: runs
README.md - Tool dispatch → View and remove: runs
README.md - Product search → Product spreadsheet: filters
agent.py - Loyalty lookup → User profiles: reads
agent.py - Add to cart → Product spreadsheet: checks stock
agent.py - Add to cart → Approval controls: requests approval
agent.py - Approval controls → Add to cart: resumes
agent.py - Add to cart → Session cart: adds item
agent.py - View and remove → Session cart: reads or updates
README.md - Chat and sidebar → Approval controls: shows controls
agent.py - Chat and sidebar → Checkout response: formats checkout
agent.py - LangGraph agent → Conversation checkpoint: checkpoints
agent.py - LangGraph agent → Chat and sidebar: returns response
agent.py