How hpy137/tripstar works
TripStar is an AI travel-planning application: users submit trip dates, cities and preferences, then receive an asynchronously generated itinerary with budget, weather, lodging, route/map and attraction details. The backend enriches attraction recommendations from Xiaohongshu, coordinates map-provider lookups, generates the plan with an LLM, and derives a localized knowledge graph. The result view also supports itinerary-context chat, attraction photos and map visualization; preference memory is a separate optional capability. The README documents these branches, but several route and planner implementations were not sampled, so only documented orchestration links are shown.
Main entry points: main.py FastAPI app · api.ts API client · trip_planner_agent.py Trip planner agent · xhs_service.py Xiaohongshu search
Components 26
Trip interface
- Trip setup
frontend/src/views/Landing.vue - API client
frontend/src/services/api.ts - Trip results
frontend/src/views/Result.vue - Trip chat
frontend/src/components/AIChat.vue - Localization
frontend/src/i18n/index.ts
API layer
- FastAPI app
backend/app/api/main.py - Trip tasks
backend/app/api/routes/trip.py - Attraction photos
backend/app/api/routes/poi.py - Chat endpoint
backend/app/api/routes/chat.py - Map endpoint
backend/app/api/routes/map.py - Runtime settings
backend/app/api/routes/settings.py
Planning services
- Trip planner agent
backend/app/agents/trip_planner_agent.py - Chat service
backend/app/services/chat_service.py - LLM adapter
backend/app/services/llm_service.py - Knowledge graph
backend/app/services/knowledge_graph_service.py
External data
- Xiaohongshu search
backend/app/services/xhs_service.py - Map dispatcher
backend/app/services/map_dispatcher.py - AMap service
backend/app/services/amap_service.py - Google Maps
backend/app/services/google_map_service.py
Preference memory
- Memory API
backend/app/api/routes/memory_routes.py - Memory manager
backend/app/memory/memory_manager.py - Memory store
backend/app/memory/sqlite_store.py
Other components
- Traveler
- Xiaohongshu
- LLM provider
- Map providers
Connections 33
- Traveler → Trip setup: enters trip details
- Trip setup → API client: submits plan
- API client → FastAPI app: sends API requests
- FastAPI app → Trip tasks: dispatches trip routes
- FastAPI app → Attraction photos: dispatches photo routes
- FastAPI app → Chat endpoint: dispatches chat routes
- FastAPI app → Map endpoint: dispatches map routes
- FastAPI app → Runtime settings: dispatches settings
- FastAPI app → Memory API: dispatches memory routes
- Trip tasks → Trip planner agent: starts planning task
- Trip planner agent → Xiaohongshu search: searches attractions
- Trip planner agent → Map dispatcher: requests weather and lodging
- Trip planner agent → LLM adapter: generates itinerary
- Trip planner agent → Knowledge graph: builds graph
- Xiaohongshu search → LLM adapter: extracts structured attractions
- Xiaohongshu search → Map dispatcher: geocodes attractions
- Xiaohongshu search → Xiaohongshu: searches notes
- Attraction photos → Xiaohongshu search: requests attraction photo
- Map dispatcher → AMap service: selects or falls back
- Map dispatcher → Google Maps: selects or falls back
- AMap service → Map providers: queries maps and weather
- Google Maps → Map providers: queries maps and weather
- LLM adapter → LLM provider: invokes model API
- Trip tasks → API client: returns task status
- API client → Trip results: supplies plan result
- Trip results → API client: polls task status
- Trip results → Attraction photos: loads attraction photos
- Trip results → Trip chat: shows itinerary chat
- Trip chat → API client: sends chat requests
- Chat endpoint → Chat service: handles chat
- Chat service → LLM adapter: generates reply
- Memory API → Memory manager: recalls and edits preferences
- Memory manager → Memory store: reads and writes memories