Spaces:
Running
๐ Plan-a-Party Multi-Agent System
A comprehensive party planning system built with LangChain and Gradio, featuring multiple specialized AI agents that work together through an interactive conversational interface to help you plan the perfect party!
โจ Features
๐ค Multi-Agent Architecture
- Theme Planning Agent - Generates creative party themes and creates beautiful 4x4 invitation cards using FLUX.1-dev
- Guest Invite Email Agent - Manages guest lists from CSV and sends personalized invitation emails via Resend MCP
- Venue Search Agent - Searches for party venues using Bright Data MCP SERP search
- Theme Decor/Favor Shop Agent - Generates shopping lists and builds Amazon carts with intelligent query optimization
๐จ Key Capabilities
- Interactive Chat Interface - Natural language conversation to guide party planning
- Event Metadata Collection - Captures budget, location, and date through conversation
- Theme Generation - AI generates 3 creative, age-appropriate party themes
- Natural Language Theme Selection - Select themes directly in chat (e.g., "I like the first one")
- Invitation Cards - Beautiful 4x4 invitation cards with custom text and images using FLUX.1-dev
- Email Automation - Send invitations to multiple guests via Resend MCP
- Venue Discovery - Search for party venues using Bright Data SERP with location, budget, and guest count filters
- Smart Shopping - Generate theme-based shopping lists with Amazon-optimized search queries
- Cart Building - Build Amazon shopping carts with product links and pricing
๐ Setup
Prerequisites
- Python 3.8+
- Hugging Face account with API token
- (Optional) Bright Data token for venue search
- (Optional) Zapier Gmail API key for Resend MCP email sending
- (Optional) Amazon MCP server (requires Node.js) for shopping
- (Optional) Fewsats API key for payment processing
Installation
Clone or navigate to the project directory:
cd plan-a-partyCreate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtSet up environment variables: Create a
.envfile or set environment variables:export HUGGINGFACEHUB_API_TOKEN=your_token_here export HF_TOKEN=your_token_here export BRIGHTDATA_TOKEN=your_brightdata_token # Optional export ZAPIER_GMAIL_API_KEY=your_zapier_key # Optional export FEWSATS_API_KEY=your_fewsats_key # OptionalSet up Amazon MCP (Optional):
cd amazon-mcp npm install npm run build cd ..
Environment Variables
Create a .env file or set these environment variables:
# Required
HUGGINGFACEHUB_API_TOKEN=your_token_here
HF_TOKEN=your_token_here
# Optional - for venue search
BRIGHTDATA_TOKEN=your_brightdata_token
# Optional - for email sending
ZAPIER_GMAIL_API_KEY=your_zapier_key
# Optional - for Amazon shopping
FEWSATS_API_KEY=your_fewsats_key
๐ฏ Usage
Running Locally
python app.py
The Gradio interface will launch at http://localhost:7860
Running on Hugging Face Spaces
- Push this repository to Hugging Face Spaces
- Set environment variables in Space settings
- The app will automatically deploy!
๐ Interactive Workflow
The app uses a conversational interface where you interact naturally:
- Start Planning โ Describe your party (e.g., "I want to plan a birthday party for my 6 year old kid")
- Provide Details โ System asks for budget, location, and date (e.g., "Budget is under $500, in San Jose CA on June 10, 2025")
- Theme Generation โ System automatically generates 3 theme options
- Select Theme โ Choose a theme in natural language (e.g., "I like the first one" or "Let's go with the Minecraft theme")
- Generate Invitation โ Click "Generate Invitation Card" button (appears when all info is ready)
- Find Venues โ Ask to search for venues (e.g., "Search for venues") - uses your stored location
- Upload Guest List โ Upload CSV with name and email columns
- Send Invitations โ Ask to send invitations (e.g., "Send the invitations")
- Shop for Decor โ Ask about shopping (e.g., "What decor items do you recommend?")
- Build Cart โ Select items and ask to build Amazon cart
๐ Project Structure
plan-a-party/
โโโ app.py # Gradio entrypoint
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ PROJECT_SUMMARY.md # Detailed architecture documentation
โโโ .env.example # Example environment variables
โโโ invitations/ # Generated invitation card images
โโโ src/
โโโ config.py # Configuration management
โโโ party_context.py # Shared state between agents (Pydantic models)
โโโ agents/
โ โโโ orchestrator.py # Main orchestrator agent (conversational flow)
โ โโโ theme_planning_agent.py
โ โโโ guest_invite_email_agent.py
โ โโโ venue_search_agent.py
โ โโโ theme_decor_favor_shop_agent.py
โโโ tools/
โ โโโ csv_guest_parser.py
โโโ mcp/
โ โโโ mcp_clients.py # MCP clients (Amazon, Fewsats, Resend, BrightData)
โโโ ui/
โโโ gradio_ui.py # Gradio interface (interactive chat)
๐ง Technologies Used
- LangChain - Agent framework and tool orchestration
- Gradio - Interactive web UI framework
- Hugging Face - Open-source LLMs and image generation
- Mistral-7B-Instruct-v0.3 - Text generation
- FLUX.1-dev - Image generation for invitation cards
- MCP (Model Context Protocol) - Integration protocol for external services
- Bright Data MCP - SERP search for venue discovery
- Resend MCP - Email sending via Zapier
- Amazon MCP - Product search and cart building
- Fewsats MCP - Payment processing (X402/L402 protocols)
- Pydantic - Data validation and shared context models
- Pandas - CSV processing
๐ CSV Format for Guest List
Your guest list CSV should have two columns:
name,email
John Doe,john@example.com
Jane Smith,jane@example.com
๐จ Architecture Highlights
Shared Context (PartyContext)
- Centralized state management using Pydantic models
- Stores event metadata (budget, location, date)
- Manages theme options and selections
- Tracks guest lists, venue results, and shopping cart items
Conversational Flow
- Multi-turn dialogue to progressively gather requirements
- Natural language understanding for theme selection
- Context-aware responses based on collected information
- Dynamic UI updates based on conversation state
MCP Integration
- Graceful Degradation - App works even if optional MCP servers are unavailable
- Bright Data - Real-time SERP search for venue discovery
- Resend - Reliable email delivery via Zapier integration
- Amazon - Optional shopping with intelligent query optimization
- Fewsats - Payment processing for future order placement
Query Optimization
- Amazon search queries are automatically optimized from item names
- Strips descriptions, normalizes case, and adds relevant keywords
- Improves product matching accuracy
๐ ๏ธ Development
Adding New Agents
- Create a new file in
src/agents/ - Implement agent functions with
@tooldecorators - Add agent wrapper to orchestrator in
src/agents/orchestrator.py - Update
TOOL_ROUTERdictionary in orchestrator - Update Gradio UI if needed
Testing
Each agent can be tested independently:
from src.agents.theme_planning_agent import generate_party_themes
result = generate_party_themes.invoke({
"party_description": "Birthday party for 5 year old"
})
print(result)
๐ฎ Future Enhancements
- Order tracking and status updates
- Multi-language support
- Theme customization options
- Calendar integration for date selection
- Budget tracking and alerts
- Guest RSVP management
- Venue booking integration
๐ License
This project is open source and available for the Hugging Face MCP Hackathon.
๐ค Contributing
This is a hackathon project. Feel free to fork and extend!
๐ Acknowledgments
- Hugging Face for open-source models and infrastructure
- LangChain team for the agent framework
- Bright Data for SERP search capabilities
- All open-source contributors
Built for the Hugging Face MCP-1st-Birthday Hackathon ๐