Skip to content

mastermaxx03/goodfoods-ai-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GoodFoods AI Concierge

An AI-powered restaurant discovery and booking assistant built for the FDSE AI Agent Challenge.
It simulates a real-world hospitality concierge using LLM reasoning, structured tool calling, and business-driven behavioral nudges.

The assistant helps customers:

  • Discover restaurants based on vibe, cuisine, and location
  • Book and modify reservations
  • Manage large-group deposit workflows
  • Receive post-booking upsells based on inventory
  • Get discounts during cancellations
  • Interact seamlessly in English or Hinglish

๐Ÿš€ Project Demo Video

Click here to view the full demonstration video on Google Drive


๐ŸŒŸ Project Description

GoodFoods AI Concierge is designed to maximize restaurant revenue and reduce operational inefficiencies.
It uses behavioral economics to nudge users toward choices that reduce wastage, increase basket size, and improve occupancy โ€” all while keeping conversations natural and context-aware.

The system includes:

  • A Persona-Engineered LLM acting as a sales-optimized concierge
  • A Tool Calling Layer for real backend operations
  • A Smart Search Engine scoring restaurants by vibe, proximity, cuisine, and promotions
  • A Deposit Gatekeeper for high-risk reservations
  • An Inventory-Drain Engine for scarcity-based upsell recommendations
  • A Yield-Management Flow that offers discount codes on cancellations to shift users to low-occupancy days

๐Ÿš€ Setup Instructions

  1. Clone the repository
git clone <your-repo-url>
cd goodfoods-ai-concierge
  1. Create a virtual environment
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Install Dependencies, create env file and run the app.
pip install -r requirements.txt
OPENAI_API_KEY=your_openai_api_key_here
streamlit run main.py

๐Ÿ›  Interesting Techniques Used

Structured Tool Calling

The assistant uses OpenAIโ€™s function-calling system to trigger backend logic deterministically.

Persona Engineering

A tightly controlled system prompt ensures deterministic behavior:

  • Enforces upsells
  • Controls deposit workflow
  • Handles confirmation gating
  • Adds localization rules

Behavioral Economics in AI Flow

Implements:

  • Scarcity cues
  • Loss aversion nudges
  • Default choice anchoring
  • โ€œToday onlyโ€ temporal framing

Session-Level State Management

Uses st.session_state to persist:

  • Tool call history
  • Pending deposits
  • Search context
  • Booking arguments

Fallback Search Logic

When no nearby restaurants match, the system gracefully expands search radius and warns users.

Hinglish Natural Language Support

The prompt is optimized so the bot understands and responds to Hinglish inputs:

โ€œBro kaam ka vibe chaiye near Indiranagarโ€
โ†’ Works seamlessly.


๐Ÿ“š Technologies / Libraries of Note


๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ main.py                # Streamlit UI + agent loop
โ”œโ”€โ”€ agent_service.py       # Tool routing + payment confirmation logic
โ”œโ”€โ”€ database.py            # Restaurant DB + search + booking logic
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ restaurants.json   # Mock data storage
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ .env
โ””โ”€โ”€ README.md

๐Ÿง  Prompt Engineering Overview

The system prompt is the core of the agentโ€™s behavior. It is engineered to enforce strict business logic:

1. Persona

  • Role: AI Sales Concierge for GoodFoods (Bangalore).
  • Goal: Maximize revenue and reduce food wastage while providing excellent service.

2. Behavioral Rules

  • The Upsell Mandate: Must always mention a promotion when suggesting a restaurant.
  • Inventory Drain: Must trigger an upsell using the inventory_nudge payload after every confirmed booking.
  • Validation: Must validate required parameters (name, time, guests) before calling book_table.
  • Safety Protocol: Follows a two-step confirmation for destructive actions (e.g., asking "Are you sure?" before cancel_reservation).

3. Safety Mechanisms

  • No accidental cancellations.
  • No hallucinated bookings.
  • Requires mandatory name capture before tool execution.

4. Localization

  • Currency: Uses โ‚น (INR).
  • Time Format: Uses 12-hour timestamps (e.g., "7 PM").
  • Geography: Uses Bangalore-specific locality names (Indiranagar, Whitefield, Koramangala).
  • Language: Native support for Hinglish (Hindi + English).

๐Ÿค– Bot Features & Capabilities

Core Capabilities

  • Psychographic Search: Suggests restaurants based on vibe (work, romantic, party), cuisine, capacity, and proximity.
  • Structured Tool Calling: The LLM decides which tool to invoke (search_restaurants, book_table, etc.) without regex-based routing.
  • Hinglish Support: Handles inputs like "Bro kaam ka vibe chahiye Whitefield side" or "Thoda romantic but not too loud".

The Revenue Engines

  1. Deposit Workflow:

    • For groups > 6 guests, the system triggers a deposit_required state.
    • It shares a mock payment link and waits for textual confirmation (including Hinglish keywords).
    • It allows the user to "juggle" context (switch topics) while the deposit is pending.
  2. The Inventory-Drain Engineโ„ข:

    • On confirmed bookings, the backend returns a specific inventory_nudge.
    • The prompt forces the AI to pitch this surplus dish immediately to reduce waste.
  3. Cancellation Yield Management:

    • If a user cancels, they receive a discount code (e.g., COMEBACK20).
    • Strategy: The code is valid only on Monโ€“Thu to shift demand to low-occupancy days.

๐Ÿงฉ Technical Implementation (For Developers)

This project demonstrates several advanced patterns for building LLM agents without heavy frameworks.

1. Manual Tool-Orchestrated Agent

  • No LangChain/CrewAI used; logic is explicit.
  • Tool definitions are strictly typed.
  • Routing handled via agent_service.py.

2. Scoring-Based Search Algorithm

database.py implements a weighted scoring function:

  • Vibe Alignment: Tag overlap.
  • Cuisine Match: +5 points.
  • Location Boost: Strict filtering first, fallback search second.
  • Availability Friction: Higher score for venues with 5+ tables available.

3. Context-Safe Responses

  • Internal fields (like inventory counts) are stripped from search results before being sent to the LLM to save tokens and prevent hallucinations, only revealing them when necessary.

๐Ÿ’ฌ Example User Journeys

Journey 1: Romantic Dinner (Upsell Flow)

User: "Quiet romantic vibe at 9 PM"

AI: Suggests GoodFoods Signature with a wine promotion.

User: "Book for Animesh"

AI: Confirms booking. Triggers Inventory Engine: "By the way, only 3 portions of Hand-Pulled Burrata left. Reserve one?"

User: "Reserve it"

AI: Confirms the pre-reserved dish.

Journey 2: Office Lunch (Deposit Flow)

User: "Lunch for 9 people at 3 PM near Whitefield. Name Animesh."

AI: Recommends GoodFoods Garden. Detects group > 6, pauses booking. "We require a โ‚น1000 pre-payment."

User: "I have made the payment." (or "Paisa bhej diya")

AI: Detects payment keywords, replays book_table with payment_confirmed=True, and finalizes the booking.

Journey 3: Cancellation (Yield Management)

User: "Cancel my reservation."

AI: "Are you sure?"

User: "Yes confirm."

AI: Cancels booking. "Here is code COMEBACK20 for 20% off your next visit (Valid Monโ€“Thu)."


๐Ÿ“ˆ Business Strategy Impact

Metric Strategy Implemented
Basket Size โฌ†๏ธ AI upsells using scarcity-based inventory nudges.
Wastage โฌ‡๏ธ Highlights surplus dishes likely nearing expiry.
No-Shows โฌ‡๏ธ Deposit requirements for large groups secure high-value slots.
Occupancy โฌ†๏ธ Recommends quieter branches/times to balance load.
Revenue (Slow Days) โฌ†๏ธ Cancellation codes push demand to Mon-Thu.

โš ๏ธ Limitations & Future Roadmap

Current Limitations:

  • Not production-grade (no real concurrency or auth).
  • Deposit flow relies on textual confirmation (keywords), not real payment gateway callbacks.
  • Restaurant availability is static JSON, not connected to a live POS.

๐Ÿ”ฎ Future Enhancements:

  • Real payment verification via Stripe/Razorpay webhooks.
  • Live POS integration for real-time inventory.
  • Multilingual support (Kannada, Tamil, Hindi script).
  • Manager Analytics Dashboard (Occupancy & Upsell rates).

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages