An AI-powered travel assistant that allows users to upload travel-related PDFs (itineraries, booking confirmations, guides, etc.) and ask natural-language questions based on the document content. The system performs semantic search over the uploaded document and uses a large language model to generate accurate, contextual answers.
- Upload travel-related PDF documents
- Automatic text extraction and chunking
- Semantic search using vector embeddings
- Context-aware Q&A powered by an LLM
- Simple interactive UI
- Cloud-native vector database
High-level flow:
PDF → Text Extraction → Chunking → Embeddings → Qdrant → Retrieval → LLM → Answer
-
PDF Upload The user uploads a PDF file via the Streamlit frontend.
-
Text Extraction & Chunking The backend extracts text from the PDF and splits it into semantically meaningful chunks.
-
Embedding Generation Each text chunk is converted into a vector embedding using Qdrant.
-
Vector Storage (Qdrant) Embeddings and metadata are stored in Qdrant Cloud for efficient similarity search.
-
Semantic Retrieval When a user asks a question, the query is embedded and used to retrieve the most relevant chunks from Qdrant.
-
LLM Answer Generation The retrieved context is passed to a Hugging Face LLM, which generates a grounded answer based on the document content.
- Frontend: Streamlit
- Backend: FastAPI
- Embeddings & Vector Database: Qdrant Cloud
- LLM: Hugging Face
AiTravelAssistant/
├── frontend/
│ └── app.py # Streamlit UI
├── backend/
│ ├── main.py # FastAPI entry point
│ ├── Embeddings.py # convert text to embeddings
│ ├── generator.py # generate final answer
│ ├── ingest.py # read and extract from pdf
│ └── retrievers.py # retrieve relevant info stored in DB previously
├── requirements.txt
├── .env
└── README.md
uvicorn src.main:app --reload
streamlit run src/app.py
Endpoint
POST /upload
Request
multipart/form-data
file: travel.pdf
Response
{
"status": "success",
"chunks_indexed": 42
}Endpoint
POST /query
Request Body
{
"question": "What time is my flight to Paris?"
}Response
{
"answer": "Your flight to Paris departs at 7:45 PM on June 12th from SFO."
}