Ever felt planning trips exhausting? Finding the best deals, entering card details, waiting for OTPs, and navigating countless bookings? Ever wondered if there was an AI agent ready to handle it all with a single click?
Welcome to TraveBuddy - a blockchain-powered and AI-driven travel booking platform that reimagines how travelers book trips.
TraveBuddy combines intelligent AI agents with blockchain technology to create a trustless, transparent, and efficient travel booking experience. Our platform connects travelers with top-tier travel providers through a unified interface while ensuring funds are protected through smart contracts.
Unlike traditional booking platforms, TraveBuddy doesn't just search—it converses. Through the power of AI and LangGraph, our intelligent agent engages with you like a real travel agent, understanding your preferences, budget constraints, travel dates, and preferred modes of transport.
Our intelligent assistant learns your preferences through natural conversation:
- Discovers your destination preferences, budget, and timeline
- Analyzes travel trends to identify optimal booking times
- Continuously monitors prices and availability across partner APIs
- Makes informed booking decisions based on your constraints
Algorand blockchain integration ensures transparency and security:
- Fund Protection: Funds are locked in smart contracts at trip creation—neither you nor the platform can access them until conditions are met
- On-Chain Itinerary Commitment: Before releasing funds, TraveBuddy commits a SHA-256 hash of the selected itinerary and constraints on-chain
- Trustless Execution: Smart contracts automatically verify bookings meet all user-specified conditions before releasing funds
- Transparent Auditing: All transactions are immutable and verifiable on the blockchain
- Reduced Fraud Risk: No centralized party controls your funds; execution is governed by code
- trip_id: Internal trip identifier generated by the backend and stored in smart contract state
- app_id: The Algorand application ID; this is the main on-chain identifier you use to look up the trip contract
- app_address: The escrow-style application account address that receives locked funds
Our decision engine continuously monitors prices and executes bookings at optimal times:
- Tracks price history across multiple providers
- Uses trend analysis to predict booking windows
- Executes transactions automatically when conditions are optimal
- Keeps you informed of all decisions and actions
- Runtime: Python with FastAPI
- AI & Parsing: Google Generative AI for natural language processing
- Blockchain: Algorand (py-algorand-sdk, PyTeal for smart contracts)
- Async Processing: asyncio for non-blocking job scheduling
- Smart Contract Language: PyTeal for contract logic
- Framework: Next.js with TypeScript
- Styling: Tailwind CSS
- State Management: React Context API
- API Integration: RESTful endpoints to backend
The backend follows a service-oriented architecture with clear separation of concerns:
- ai_parser.py: Parses user travel requirements into structured constraints using LLM
- constraint_service.py: Normalizes and validates trip constraints
- scheduler.py: Async monitoring loop that triggers booking decisions at optimal times
- decision_engine.py: Determines when to execute bookings based on price trends
- api_fetcher.py: Aggregates prices from partner APIs in real-time
- booking_executor.py: Executes bookings through partner integrations
- contract_service.py: Deploys and manages smart contracts for fund protection
- algorand_client.py: Client for Algorand blockchain interaction
Entry point: backend/main.py with route orchestration through backend/routes/trip.py.
At the heart of TraveBuddy's trust model is the Algorand blockchain:
-
Trip Creation: When you create a trip request, your specified budget is locked in a smart contract. Your funds cannot be accessed by anyone.
-
Booking Monitoring: Our decision engine monitors prices and travel availability in real-time.
-
Automated Execution: Once price and availability conditions are met, a booking is executed through partner APIs.
-
On-Chain Commitment: TraveBuddy commits a SHA-256 itinerary hash (trip id + normalized constraints + selected components) on Algorand.
-
Smart Contract Verification: The smart contract enforces that itinerary commitment exists before funds can be released.
-
Fund Release: Only after verification passes do your locked funds get transferred to the booking provider. If conditions cannot be met, funds are returned to you.
This design eliminates the need to trust TraveBuddy—you only trust the immutable logic of the smart contract.
- Python 3.8+
- Node.js 18+
- Algorand node access (testnet or local node)
- API keys for travel providers
-
Clone the repository:
git clone https://github.com/RSAgr/traveBuddy.git cd traveBuddy -
Set up the Python backend:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure environment variables: Create a
.envfile in the backend directory with:ALGOD_ADDRESS=<your-algorand-node-address> ALGOD_TOKEN=<your-algorand-node-token> USER_MNEMONIC=<your-algorand-account-mnemonic> GEMINI_API_KEY=<your-google-generative-ai-key>Create a
.env.localfile in the frontend directory with:NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=<your-google-maps-api-key> -
Set up the Next.js frontend:
cd frontend npm install
-
Start the backend server:
cd backend uvicorn main:app --reloadThe API will be available at
http://localhost:8000. -
Start the frontend development server:
cd frontend npm run devThe application will be available at
http://localhost:3000.
- User Input: You describe your travel plans through natural conversation
- Constraint Parsing: AI extracts structured trip requirements (destination, budget, dates, transport)
- Fund Locking: Your budget is locked in a smart contract on Algorand
- Continuous Monitoring: Scheduler monitors prices 24/7
- Optimal Booking: Decision engine executes booking when conditions are ideal
- Itinerary Commitment: Backend writes itinerary hash on-chain before payout
- Contract Verification: Smart contract validates commitment state before releasing funds
- Fund Transfer: Funds are released only after verification succeeds
When you create a trip, the backend prints the trip_id, app_id, app_address, create_tx_id, and lock_tx_id to the terminal so you can trace the trip on Algorand.
Algorand was chosen for TraveBuddy because of:
- Pure Proof of Stake: Energy-efficient without proof-of-work wastage
- Deterministic Finality: Transactions are final instantly—no forks or rollbacks
- High Throughput: Capable of processing thousands of transactions per second
- Low Latency: Block times of ~4 seconds enable responsive booking execution
- Affordable: Minimal transaction fees make frequent price checks economical
- Scalability: Can handle volume growth without congestion
- PyTeal Support: Native smart contract framework enabling complex booking logic
This repository currently has no automated test suite. The typical local development flow is:
- Install dependencies as shown above
- Start the API server manually
- Test through the frontend or API directly
Future plans include comprehensive test coverage with pytest.
- Keep backend services small and single-purpose (see existing services pattern)
- Prefer functional service code over classes unless stateful behavior is required
- Place API-layer validation in route handlers; business logic in services
- Use Pydantic models from
backend/models/schema.pyfor typed structures - Maintain async style for long-running workflows using asyncio
- Treat contract deployment as environment-dependent
Contributions are welcome. Please ensure:
- Code follows the existing service-oriented architecture
- Smart contract changes are thoroughly tested
- Environment variables are never committed; use
.envfiles - Async patterns remain non-blocking and resilient
This project is open source under the MIT License. See the LICENSE file for details.
For questions or feedback about TraveBuddy, please open an issue on GitHub.