Work in Progress: Traveller is under active development! Exciting features are coming soon—see the roadmap below.
Traveller is a modern, LLM-driven FastAPI backend application designed to assist travelers with two main features:
- Currency Conversion: Convert between BRL (Brazilian Real) and EUR (Euro) using real-time exchange rates, with smart caching for performance.
- Translation: Translate between Brazilian Portuguese and Spanish (Spain), with clear instructions and concise responses.
Traveller leverages advanced Large Language Model (LLM) capabilities, including:
- Tool-Calling: The app uses LLM tool-calling to dynamically invoke specialized functions (tools) for tasks like currency conversion, based on user intent.
- Chaining: Complex workflows are handled by chaining multiple LLM and tool calls together, enabling context-aware, multi-step reasoning and responses.
- LangChain Integration: Built on top of LangChain, the app orchestrates LLMs, prompt templates, output parsers, and tool routing for robust, extensible AI-driven logic.
This makes Traveller a powerful, extensible, and intelligent assistant for travelers, powered by state-of-the-art LLM technology.
- 🚀 WhatsApp Integration: Fully integrate with WhatsApp to allow seamless communication with the assistant.
- 🌍 More Languages & Currencies: Expand support for additional languages and currencies.
✈️ Travel Search & Booking: Enable flight and train price search and booking directly from the app.
- FastAPI: High-performance Python web framework for building APIs.
- LangChain: Advanced language model chains for translation and classification.
- Async Currency Conversion: Uses external APIs and Redis caching for fast, up-to-date rates.
- Dockerized Redis: Easy setup for caching with Docker Compose.
- Ruff & Pytest: Linting and testing for code quality.
- Python 3.9+
- Poetry for dependency management
- Docker and Docker Compose for Redis
-
Clone the repository
git clone https://github.com/yourusername/traveller.git cd traveller
-
Install dependencies
poetry install
-
Configure environment variables
Create a
.env
file in the project root with your API key:EXCHANGE_RATE_API_KEY=your_api_key_here
-
Start Redis with Docker Compose
make start-redis
-
Run the application
poetry run uvicorn src.main:app --reload
- Health Check:
GET /healthz
— returns{ "status": "ok", "timestamp": "..." }
- Ask a Question:
POST /questions
with JSON body{ "input": "your question here" }
- Currency Conversion: Ask for conversions between BRL, EUR, and USD.
- Translation: Ask for translations between Brazilian Portuguese and Spanish (Spain).
curl -X POST 'http://localhost:8000/questions' \
-H 'Content-Type: application/json' \
-d '{"input": "Cerveja"}'
curl -X POST 'http://localhost:8000/questions' \
-H 'Content-Type: application/json' \
-d '{"input": "54.2 EUR"}'
- Lint:
make lint
- Test:
make test
- Format on Save: Enabled with Ruff in VS Code.
src/
main.py # FastAPI app and endpoints
config.py # Pydantic settings
cache.py # Redis client
chains/ # LangChain chains and routing
llms/ # LLM tools: currency_converter, translator
models.py # Pydantic models
- Currency rates are cached in Redis for 1 hour for performance.
- The app uses async everywhere for maximum performance.
- Make sure your API key for currency rates is valid and has quota.