Annapurna is a sophisticated GenAI-powered conversational agent built with LangGraph and FastAPI that helps customers browse restaurant menus and place orders seamlessly in natural language. This project demonstrates the power of AI agents in creating natural, intuitive food ordering experiences with some creative human like conversations, not the old robotic chatbots.
๐ฑ Application Screenshots
Chat Interface

Menu Browsing & Cart Management

๐ Features
- Intelligent Conversational Interface: Natural language interaction for menu browsing and order placement
- Dynamic Menu Integration: Real-time menu fetching from external services
- Smart Cart Management: Add, modify, and track items in the shopping cart
- Multi-tenant Support: Support for multiple restaurant subdomains
- Memory-Enabled Conversations: Maintains context throughout the ordering session
- RESTful API: Clean API endpoints for frontend integration
- Extensible Architecture: Built with LangGraph for easy workflow modifications
๐๏ธ Architecture
This project uses a modern AI agent architecture:
- LangGraph: Orchestrates the conversational workflow and agent behavior
- FastAPI: Provides high-performance REST API endpoints
- LangChain: Powers the LLM integration and tool calling
- Google Gemini: LLM backend for natural language processing
Agent Workflow
The system implements a state-based conversational agent that:
- Receives user messages
- Processes intent and context
- Calls appropriate tools (menu fetching, cart management)
- Maintains conversation state and memory
- Responds with helpful, contextual information

๐ Project Structure
chatbot-agent/
โโโ backend/ # Main backend application
โ โโโ src/
โ โ โโโ agents/ # Agent-related modules
โ โ โ โโโ nodes/ # LangGraph nodes (chatbot, tools)
โ โ โ โโโ prompts/ # System prompts and templates
โ โ โ โโโ tools/ # Agent tools (cart, menu)
โ โ โ โโโ graph.py # LangGraph workflow definition
โ โ โ โโโ state.py # State management
โ โ โ โโโ output_structures.py
โ โ โโโ api/ # FastAPI routes
โ โ โ โโโ routes/ # API endpoint definitions
โ โ โโโ services/ # Business logic services
โ โ โโโ configs/ # Configuration management
โ โ โโโ main.py # FastAPI application entry point
โ โโโ pyproject.toml # Python dependencies
โ โโโ uv.lock # Lock file for reproducible builds
โโโ training/ # Training and development notebooks
โ โโโ training-agent.ipynb # Jupyter notebook for agent development
โ โโโ menu.json # Sample menu data
โ โโโ main.py # Training scripts
โโโ docs/ # Documentation and diagrams
โ โโโ langgraph-flow.png # Workflow visualization
โ โโโ screenshots/ # Application screenshots
โโโ README.md # This file
๐ Quick Start
Prerequisites
- Python 3.12+
- UV package manager (recommended) or pip
- Environment variables for API keys
Installation
-
Clone the repository
git clone https://github.com/shashanksrajak/chatbot-agent-food-ordering.git cd chatbot-agent-food-ordering
-
Set up the backend environment
cd backend uv sync # or pip install -e .
-
Configure environment variables Create a
.env
file in the backend directory:GOOGLE_API_KEY=your_google_api_key MENU_BACKEND_URL=your_menu_service_url
-
Run the application
cd backend uvicorn src.main:app --reload
The API will be available athttp://localhost:8000
API Documentation
Once running, access the interactive API documentation at:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
๐ ๏ธ Usage
Basic Chat Interaction
curl -X POST "http://localhost:8000/chat" \
-H "Content-Type: application/json" \
-d '{
"message": "Hi, I want to see your menu",
"subdomain": "restaurant1",
"restaurant_name": "name",
"session_id": "user123"
}'
Example Conversation Flow
- User: "Hi, what's on your menu today?"
- Agent: Fetches and displays the current menu
- User: "I'd like to add a margherita pizza to my cart"
- Agent: Adds the item and confirms the addition
- User: "What's in my cart now?"
- Agent: Shows current cart contents and total
Development
Running in Development Mode
# Backend with auto-reload
cd backend
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
# For development with detailed logging
uvicorn src.main:app --reload --log-level debug
Training and Experimentation
training/
directory contains Jupyter notebooks for:- Agent behavior experimentation
- Prompt engineering
- Menu data preprocessing
- Workflow testing
cd training
jupyter notebook training-agent.ipynb
๐งช Key Components
Agent Tools
get_menu()
: Fetches real-time menu data from external servicesadd_to_cart()
: Manages cart item additions with validationview_cart()
: Displays current cart contentsremove_from_cart()
: Handles item removal and modifications
State Management
The agent maintains conversation state including:
- Current cart contents
- User preferences
- Conversation history
- Restaurant context (subdomain)
Memory System
Built-in memory management ensures:
- Context preservation across messages
- Session-based conversation tracking
- Stateful interactions
๐ License
๐ Acknowledgments
- LangChain & LangGraph: For the powerful agent framework
- FastAPI: For the high-performance web framework
- Google Gemini: For the LLM capabilities
- Supabase: For the backend infrastructure
๐ง Contact
Built with โค๏ธ using LangGraph and FastAPI
Interested in this project?
Check out the full source code and documentation on GitHub.