
RupeeTravel is a backend API for conversational flight search, powered by an LLM and a local flight database. Users can interact using natural language queries to find flights, get prices, and specify trip details.
- Conversational Flight Search: Accepts free-form queries (e.g., "Find me the cheapest flights from Delhi to Hanoi in December").
- LLM-Powered Intent Extraction: Uses Qwen3:1.7b via Ollama for robust query understanding.
- Guardrails: Python logic corrects common LLM extraction mistakes for reliability.
- SQLite Database: Stores flight data locally for fast queries.
- FastAPI Backend: RESTful API endpoints for integration.
- Automatic Database Population: Loads flight data from
flight-price.json
on startup.
A companion frontend for RupeeTravel is available at:
https://github.com/harsh-vardhhan/flight-search-frontend
- Language: Python 3.11+
- Framework: FastAPI
- LLM: Qwen3:1.7b via Ollama
- Database: SQLite (
flight.db
) - ORM: SQLAlchemy
- Prompt Engineering: LangChain
- Environment Variables: Managed via
.env
-
POST /transcript
Accepts a user query and returns matching flight options or clarification questions. -
GET /
Health check endpoint.
main.py
— FastAPI app and core logicllm_logic.py
— LLM prompt and intent extraction chaincrud.py
— Database query functionsmodels.py
— SQLAlchemy modelsschemas.py
— Pydantic schemasdatabase.py
— DB setupflight-price.json
— Source flight data
-
Startup:
- Database tables are created.
- Flight data is loaded from
flight-price.json
.
-
Query Flow:
- User sends a query to
/transcript
. - LLM extracts intent (origin, destination, dates, trip type, etc.).
- Guardrails fix missing or ambiguous info.
- Database is queried for matching flights.
- Results or clarifications are returned.
- User sends a query to
-
Install dependencies:
pip install -r requirements.txt
-
Start Ollama with Qwen3:1.7b:
ollama pull qwen3:1.7b ollama serve
-
Run the API:
uvicorn main:app --reload
Configure your .env
file for any required secrets or LLM settings.