
This application is a multi-agent system designed to generate comprehensive travel plans by orchestrating several specialized agents. Each agent is responsible for a specific task in the overall workflow, and they interact via a directed graph that guides inputs, enriches them, collects human feedback, and ultimately provides curated travel proposals.
User Input:
The workflow begins when the user provides their travel preferences (e.g., “I would like to visit Barcelona”). This raw input is captured and passed to the system via the Manager class.
Graph Initialization:
The Manager (located in src/manager.py) sets up the primary state graph which defines the sequence and connections between various agent nodes. For certain scenarios, an alternative graph (graph_only_researchers) is available.
Context Enricher Agent:
src/nodes/agents/context_enricher.pyhuman_in_the_loop tool).Outcome:
Ensures that all subsequent agents have a rich context from which to operate.
User Input Summary Agent:
src/nodes/llm/user_input_summary.pyOutcome:
Produces an “enriched user input” that consolidates all essential travel details for the planning stage.
Planner Agent:
src/nodes/llm/planner.pyProcess:
The agent can adjust proposals based on any previous human feedback.
Human Loop Node:
src/nodes/hil/human_loop.pyProcess:
The user reviews the proposals and provides feedback (e.g., choosing a preferred plan or suggesting modifications).
Router Agent:
src/nodes/llm/router.pyOutcome:
Routes the process back to the planner for revisions or progresses it to specialized research.
Researchers Manager Agent:
src/nodes/llm/research_manager.pySpecialized Agents:
Flight Researcher Agent:
src/nodes/agents/flight_researcher.pyHotel Researcher Agent:
src/nodes/agents/hotel_researcher.pyPersistent Caching for Research:
Both the flight and hotel search tools use a Redis-based persistent caching mechanism (implemented in src/cache/redis_cache.py).
Trip Finalizer Agent:
src/nodes/llm/finalizer.pyOutcome:
The user receives a final, detailed travel itinerary that clearly presents all available options.
State Propagation:
A mutable State object (defined in src/states/state.py) is passed along the workflow. Each agent enriches or modifies this state.
Graph-Based Workflow:
The interconnected nodes in the workflow (outlined in src/graphs/graph.py) allow for dynamic routing based on human feedback and intermediate results.
Debug and Iteration:
The Manager class supports a debug mode, which enables iteration and continuous refinement of the plan based on user input.
To improve efficiency and reduce the number of expensive API calls, the application incorporates a Redis-based caching mechanism:
src/cache/redis_cache.py using Redis.
search_flights (located in src/nodes/agents/tools/amadeus/search_flights.py) and search_hotels (located in src/nodes/agents/tools/amadeus/search_hotels.py) instantiate a local RedisCache instance during each tool invocation.