Wayfairer provides a modular API through its LangGraph-based workflow. While primarily designed as a Streamlit application, the core functionality can be accessed programmatically through the main workflow engine.
The main workflow orchestrator that manages the multi-agent travel planning process.
router_agent(state): Classifies user intent as travel-related or chitchatplanner_agent(state): Extracts travel details from user inputflight_agent(state): Searches for flight optionshotel_agent(state): Searches for hotel optionsitinerary_agent(state): Creates detailed travel itineraryfinal_agent(state): Formats final response for userchitchat_agent(state): Handles non-travel conversations
{
"messages": List[AnyMessage], // Conversation history
"user_query": str, // Original user input
"destination": str, // Target destination
"departure_city": str, // Starting location
"dep_iata": str, // Departure airport code
"arr_iata": str, // Arrival airport code
"flight_search_query": str, // Flight search parameters
"hotel_search_query": str, // Hotel search parameters
"flight_results": str, // Raw flight data
"hotel_results": str, // Raw hotel data
"itinerary": str, // Generated itinerary
"llm_calls": int, // Counter for LLM usage
"is_travel_related": bool // Intent classification result
}Handles the user interface and real-time visualization of the agent workflow.
- Hero section with animated gradient background
- Destination strip with popular locations
- Input area with quick suggestion chips
- Real-time agent tracking visualization
- Metrics display (agents run, LLM calls, status)
- Boarding pass style results presentation
- Download functionality (Markdown/PDF)
Provides flight search capabilities with fallback mechanisms.
search_flights(query: str, dep_iata: str = None, arr_iata: str = None) -> str- Searches for flights using AviationStack API
- Falls back to Tavily search when API unavailable
- Returns formatted flight information string
Provides web search capabilities for hotel and travel information.
tavily_search(query: str) -> str
<tool_call> <function=Bash> <parameter=command> git add API_DOCS.md