Skip to content

Food tour planner using LangChain DeepAgents, Google Maps API, and Tavily research. Explore multi-agent coordination patterns: task delegation via SubAgentMiddleware, planning with TodoListMiddleware

Notifications You must be signed in to change notification settings

muratcankoylan/Butterpath

Repository files navigation

DeepAgent Food Tours

AI-powered food tour planner using LangChain DeepAgents, Google Maps API, and Tavily research.

Screenshots

Interactive Map Interface

Map interface with search points

DeepAgent Planning Process

Adding search points to the map

Natural language AI prompt

AI agents planning the tour

Reviews and neighborhood insights

Generated Tour Dashboard

Beautiful HTML tour dashboard header

Establishment details with photos and reviews

Personalized tour recommendations

Features

  • Interactive Map Interface: Click to add search points and visualize coverage areas
  • Smart Search: Scan neighborhoods with multiple overlapping search radii for complete coverage
  • AI Planning: Use natural language prompts to let AI plan personalized food tours
  • Lightweight Data Collection: Efficient API usage with minimal requests
  • Beautiful Dashboards: Auto-generated HTML reports with establishment details and research findings
  • Flexible Export: Preview results and select only the establishments you want before detailed export

Architecture

The project uses a multi-agent architecture powered by LangChain DeepAgents:

  • Scan Manager (Node.js): Web UI and basic scan functionality
  • Dashboard Server (Node.js): Serves generated HTML tour reports
  • DeepAgent API (Python): Coordinates AI agents for intelligent tour planning
    • Restaurant Finder Agent: Searches and evaluates food establishments
    • Neighborhood Researcher Agent: Analyzes local culture and food trends
    • Dashboard Creator Agent: Generates beautiful HTML reports

Prerequisites

  • Node.js >= 18.0.0
  • Python >= 3.9
  • npm >= 9.0.0

API Keys Required

  1. Google Maps API Key (Get it here)

    • Enable: Places API, Geocoding API, Maps JavaScript API
  2. Tavily API Key (Get it here)

    • For neighborhood research and web data
  3. Anthropic API Key (Get it here) OR OpenAI API Key (Get it here)

    • For AI agent reasoning

Installation

  1. Clone the repository:
git clone https://github.com/muratcankoylan/deepagent-food-tours.git
cd deepagent-food-tours
  1. Install Node.js dependencies:
npm install
  1. Install Python dependencies:
pip3 install -r requirements.txt
  1. Create .env file from template:
cp .env.example .env
  1. Edit .env and add your API keys:
GOOGLE_MAPS_API_KEY=your_actual_key_here
TAVILY_API_KEY=your_actual_key_here
ANTHROPIC_API_KEY=your_actual_key_here  # or OPENAI_API_KEY

Usage

Quick Start

Run all three services at once:

./start.sh

This will start:

Manual Start (Individual Services)

If you prefer to run services individually:

# Terminal 1: Scan Manager
npm start

# Terminal 2: Dashboard Server
npm run dashboard-server

# Terminal 3: DeepAgent API
npm run deepagent-api

Basic Scan (No AI)

  1. Open http://localhost:3001
  2. Click on the map to add search points
  3. Configure radius and categories
  4. Click "Create Scan Task"
  5. Wait for scanning to complete
  6. Click "View Results & Export"
  7. Select establishments and export

AI-Powered Tour Planning

  1. Open http://localhost:3001
  2. Click on the map to add search points for the neighborhood
  3. Enter an AI prompt like:
    • "I want a fun evening exploring local food"
    • "Plan a romantic dinner date in this area"
    • "Find the best brunch spots for a Sunday morning"
  4. Click "Create Scan Task"
  5. Wait 1-2 minutes for the AI to plan your tour
  6. Click "View AI Dashboard" to see the generated tour report

Project Structure

deepagent-food-tours/
├── src/
│   ├── services/
│   │   ├── places.js                    # Google Places API wrapper
│   │   ├── neighborhood-analyzer.js     # Multi-point scan logic
│   │   └── geographic-sorter.js         # Route optimization
│   ├── agents/
│   │   ├── food_tour_agent.py           # Main DeepAgent
│   │   └── tools/
│   │       ├── places_lightweight.py    # Lightweight Places API
│   │       ├── tavily_research.py       # Neighborhood research
│   │       └── dashboard_generator.py   # HTML report generator
│   ├── scan-manager.js                  # Web UI backend
│   ├── dashboard-server.js              # Dashboard hosting
│   └── deepagent-api.py                 # Python API bridge
├── public/
│   └── index.html                       # Web UI frontend
├── dashboards/                          # Generated HTML reports
├── output/                              # Export JSON files
├── package.json
├── requirements.txt
├── start.sh
└── .env.example

How It Works

Basic Scanning

  1. User adds search points on the map
  2. System performs circular searches at each point
  3. Automatic deduplication removes overlapping results
  4. User previews results and selects items for detailed export
  5. Full details fetched only for selected items (saves API calls)

AI-Powered Planning

  1. User provides location and natural language prompt
  2. DeepAgent creates task breakdown
  3. Restaurant Finder agent searches for relevant establishments
  4. Neighborhood Researcher agent analyzes the area
  5. Dashboard Creator agent generates an HTML report
  6. User views the complete tour plan at http://localhost:3002

Troubleshooting

Port Already in Use

If you see "address already in use" errors:

# Kill processes on ports 3001, 3002, 5001
lsof -ti:3001,3002,5001 | xargs kill -9

Python Import Errors

Make sure you're in the project root when running:

cd /path/to/deepagent-food-tours
python3 src/deepagent-api.py

Missing API Keys

Check your .env file has all required keys:

cat .env

DeepAgent Timeout

For large neighborhoods, increase the timeout in src/scan-manager.js (currently 5 minutes).

Contributing

Contributions welcome. Please open an issue first to discuss proposed changes.

License

MIT

Acknowledgments

Feel free to use this as a template for your own DeepAgent projects.

About

Food tour planner using LangChain DeepAgents, Google Maps API, and Tavily research. Explore multi-agent coordination patterns: task delegation via SubAgentMiddleware, planning with TodoListMiddleware

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published