A multi-agent Travel Assistant built with Langgraph and LangChain.
It can search flights and hotels via SerpAPI, orchestrated by a Supervisor agent that hands off to specialized sub-agents.
-
Supervisor Agent
Greets the user, understands intent, and routes to the appropriate sub-agent (flights or hotels). -
Flights Advisor Agent
- Search round-trip or one-way flights by IATA codes
- Enforces date validation (no past dates, correct format)
- Fetches detailed itineraries with pricing, airlines, schedule, layovers
-
Hotel Advisor Agent
- Search hotels by location, check-in/check-out dates
- Sort by rating, price, popularity, etc.
- Validate date ranges and room/guest counts
-
Handoff Tool
Seamlessly transfer conversation context between agents.
sarangk90-travel-agent/
├── langgraph.json # Langgraph entrypoint & config
├── main.py # CLI launcher
├── requirements.txt # Python dependencies
└── app/
├── graph.py # StateGraph definition & MemorySaver
├── agents/
│ ├── flights\_advisor\_agent.py
│ ├── hotel\_advisor\_agent.py
│ └── supervisor\_agent.py
└── tools/
└── handoff\_tool.py # make\_handoff\_tool factory
- Python 3.11
- A SerpAPI key: https://serpapi.com/
- An OpenAI API key: https://platform.openai.com/
-
Clone the repo
git clone https://github.com/your-org/sarangk90-travel-agent.git cd sarangk90-travel-agent -
Install dependencies
pip install -r requirements.txt
-
Configure environment Copy
.env.exampleto.env(or create a new.env) and set:SERPAPI_API_KEY=your_serpapi_api_key OPENAI_API_KEY=your_openai_api_key
Run the CLI launcher:
python main.pyYou’ll be prompted:
Enter your message:
Example interaction:
Enter your message: Hi there!
supervisor: Hello! I’m your travel assistant. I can help with:
• Flight searches
• Hotel recommendations
Which would you like to do today?
From there, follow the prompts to search flights or hotels.
-
main.py
- Loads
.env, initializes a UUID thread - Listens for user input and streams responses from the Langgraph
graph
- Loads
-
app/graph.py
- Builds a
StateGraphwith nodes:supervisor,flights_advisor,hotel_advisor, andhuman - Uses
MemorySaverto persist conversation state
- Builds a
-
Agents
- Supervisor Agent Offers options and routes to sub-agents
- Flights Advisor
Validates inputs & calls
find_flightstool (SerpAPI + React agent) - Hotel Advisor
Validates inputs & calls
get_hotel_recommendationstool
-
Handoff Tool
- Custom tool that returns a
Commandto switch active agent
- Custom tool that returns a
- Fork the repo
- Create a feature branch (
git checkout -b feature/XYZ) - Commit your changes (
git commit -m "Add XYZ") - Push to your branch (
git push origin feature/XYZ) - Open a Pull Request!
This project is licensed under the MIT License.