Skip to content

Conversation

@harsehajd
Copy link

Summary

Adds date planner templates in Python and TypeScript using Stagehand and Browserbase. Automates restaurant discovery, verification, and AI-based recommendations for date planning.

Features

Core functionality

  • Interactive CLI prompts for preferences (cuisine, location, budget, date, special requirements)
  • AI-generated search queries (3 diverse queries per request)
  • Concurrent browser sessions for parallel searches
  • Click-through verification visits restaurant pages and extracts details
  • AI scoring ranks restaurants by relevance (1-10 scale, filters by cuisine match)
  • Nearby activity suggestions

Technical highlights

  • Concurrent processing: multiple browser sessions run in parallel
  • Data extraction: structured schemas (Pydantic/Zod) for restaurant data
  • Error handling: fallbacks for API failures and validation errors
  • Verification: visits restaurant pages to extract ratings, hours, contact info, reservation availability
  • Quality filtering: minimum score threshold (5/10) and cuisine matching

Implementation details

Python (templates/python/date-planner/):

  • Uses stagehand with asyncio for concurrent sessions
  • Pydantic models for data validation
  • InquirerPy for interactive CLI prompts
  • OpenAI GPT-4.1 for query generation and scoring

TypeScript (templates/typescript/date-planner/):

  • Uses @browserbasehq/stagehand with Promise.all() for concurrency
  • Zod schemas for type-safe data extraction
  • Inquirer for CLI prompts
  • Same OpenAI integration as Python version

Workflow

  1. Collect user preferences via interactive prompts
  2. Generate 3 diverse search queries using AI
  3. Launch concurrent browser sessions (one per query)
  4. Extract restaurant links from Google search results
  5. Verify top 3 restaurants per query by visiting their pages
  6. AI-score all restaurants based on user preferences
  7. Filter to top 3 matches (score ≥ 5/10, cuisine match)
  8. Suggest nearby activities for the primary recommendation
  9. Display a date plan with primary restaurant, backups, and activities

Use cases

  • Personal date planning with personalized recommendations
  • Restaurant discovery across multiple platforms
  • Event planning for special occasions
  • Travel planning for restaurant recommendations in different cities

Files added

  • templates/python/date-planner/main.py (700 lines)
  • templates/python/date-planner/README.md
  • templates/typescript/date-planner/index.ts (614 lines)
  • templates/typescript/date-planner/README.md

Both templates include documentation, error handling, and README guides.

@harsehajd harsehajd changed the title initial commit: date planner template, python + ts Date Planner Template Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants