build-with-ag2

Trip Planning

A trip planning swarm that creates an itinerary together with a customer. The end result is an itinerary with route times and distances calculated between activities.

Details

The following diagram outlines the key components of the Swarm, with highlights being:

Swarm Diagram

AG2 Features

TAGS

TAGS: trip planning, swarm, graphrag, structured output, itinerary planning, travel automation, routing agent, falkordb, google maps integration

Installation

Requires Python >= 3.12.

1. Install dependencies

uv sync

Or with pip:

pip install "ag2[graph-rag-falkor-db]>=0.9.9" python-dotenv requests

2. Start FalkorDB

FalkorDB is required to run the GraphRAG agent. Start it with Docker:

docker run -d --name travel-planner-falkordb -p 6379:6379 falkordb/falkordb:latest

Note: If port 6379 is already in use by another project, use a different port (e.g. -p 6381:6379) and set FALKORDB_PORT=6381 in your .env file.

3. Configure environment variables

cp .env.example .env

Open .env and fill in:

Running the code

python main.py

You can interact with the system through the command line to plan a trip to Rome. Modify the initial message at the bottom of main.py to plan a trip to another city.

Tip: After the first run, the FalkorDB graph is already populated. Switch init_db to connect_db in main.py for faster subsequent runs.

Contact

License

This project is licensed under the Apache License 2.0. See the LICENSE for details.