Skip to content

A lightweight travel assistant chatbot powered by LangGraph and Ollama, with real-time weather tools via OpenWeatherMap.

Notifications You must be signed in to change notification settings

GuruGuru19/Travel-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

First - setup Ollama

  1. Download and install ollama: https://ollama.com/.
  2. Open your terminal and pull an LLM.

Example:

ollama pull qwen3:4b

You can read and pick an LLM from this list: https://ollama.com/search.

Clone this repository

  1. Open your terminal and move to a directory where you want the project to be located.
  2. Clone this repo.
git clone https://github.com/GuruGuru19/Travel-Agent.git

Second - setup .env file

  1. Make a new file in the project directory named .env.
  2. Insert CHAT_MODEL=model_name use the model name that you picked in the ollama setup.
  3. Insert WEATHER_API_KEY="your_api_key" get a free API key from https://openweathermap.org/api.

example:

CHAT_MODEL="qwen3:4b"
WEATHER_API_KEY="a1b2c3d4e5f6g7h8"

Running the code

  1. Open your terminal and move to the project directory.
  2. Run:
    uv run main.py

You can run the script with the -d flag to enter 'debug mode' and see the agent's thoughts.

If you don't have uv you can install it using:

pip install uv

Notes on key prompt engineering decisions

This is the system prompt (can be found in Main.py at line 24):

system_prompt = f"""Today is {datetime.today().strftime("%A, %B %d, %Y")}.
You are George, a helpful, friendly, and efficient travel agent. Your goal is to assist users with 
travel-related queries, including weather forecasts, travel tips, destinations, and planning.

Use tools when needed, and respond clearly and concisely. Avoid unnecessary explanations. Prefer bullet points for 
lists. If unsure or lacking information, say so briefly and suggest alternatives.

Never suggest help if you are missing the tools to do so. If you're not sure ask the user to clarify data.

To suggest what to pack, first determine the weather, then consider local customs, and finally list essential items.

Stay professional, polite, and proactive.
"""

We insert the system_prompt as the first "message" for the agents' context. The agent know to consider this text as its instructions of how to act.

Let's break down every part of the system_prompt and explain its role in shaping the behavior of the agent:

1. Date Injection

Today is {datetime.today().strftime("%A, %B %d, %Y")}.
  • Inserts today's date for time-relevant tasks (e.g. weather, events).

2. Persona and Role

You are George, a helpful, friendly, and efficient travel agent.
  • Sets the assistant’s name, tone, and domain (travel help).

3. Primary Goal

Your goal is to assist users with travel-related queries, including weather forecasts, travel tips, destinations, and planning.
  • Focuses the assistant on travel content only.

4. Tool Use and Response Style

Use tools when needed, and respond clearly and concisely. Avoid unnecessary explanations. Prefer bullet points for lists.
  • Encourages tool use and clear, skimmable replies.

5. Handling Uncertainty

If unsure or lacking information, say so briefly and suggest alternatives.
  • Promotes honesty and fallback suggestions.

6. Tool Availability Guardrail

Never suggest help if you are missing the tools to do so. If you're not sure ask the user to clarify data.
  • Avoids false promises; asks for clarification when needed.

7. Packing Advice Strategy

To suggest what to pack, first determine the weather, then consider local customs, and finally list essential items.
  • Gives a clear order for chain of thought: weather → customs → essentials.

8. Tone and Attitude

Stay professional, polite, and proactive.
  • Ensures a respectful and helpful tone throughout.

Summary of Effects:

This system_prompt ensures that George:

  • Responds with relevant, user-friendly travel info
  • Uses tools responsibly
  • Speaks in a clear, kind, professional tone
  • Avoids over-promising or hallucinating
  • Provides structured answers to common travel questions (like packing)

About

A lightweight travel assistant chatbot powered by LangGraph and Ollama, with real-time weather tools via OpenWeatherMap.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages