Autonomous AI Travel Agent with RAG over Real-Time Flight Data
Author: Regis Nde Tene (Chopinregis)
Status: Draft
Duration: 1 Week Deep Dive
Executive Summary
This project develops an AI travel agent that autonomously plans trips based on user preferences, leveraging LLMs for natural language understanding and agentic planning. It utilizes Retrieval-Augmented Generation (RAG) over a real-time flight data API to provide up-to-date and accurate travel options. The application is containerized with Kubernetes and deployed on AWS.
Key Skills
- Python
- API Development (REST, gRPC)
- Data Pipelines
- Production System Design
- Agentic AI Development
- Large Language Models (LLMs)
- Python
- Production System Design
- Agentic AI Development
- Large Language Models (LLMs)
- Python
- Retrieval-Augmented Generation (RAG)
- API Development (REST, gRPC)
- Data Pipelines
- Kubernetes
- Cloud Platforms (AWS/GCP)
- API Development (REST, gRPC)
- Production System Design
- Distributed Systems
- Cloud Platforms (AWS/GCP)
- Production System Design
- Distributed Systems
- Agentic AI Development
- Large Language Models (LLMs)
- Python
- Kubernetes
- Retrieval-Augmented Generation (RAG)
- API Development (REST, gRPC)
- Production System Design
- Distributed Systems
Project Execution Log
Stage 1: API Integration & Data Pipeline Setup
This stage successfully established the initial data backbone for the AI travel agent. We integrated with a real-time flight data API, set up a secure method for handling API keys, and built a Python-based data pipeline to fetch and ingest flight information. The data is now persistently stored in a local SQLite database, laying the groundwork for the RAG component and enabling the LLM to access current flight details.
Deliverables
- [x] `data_ingestion.py` Python script for fetching and storing raw flight data from the API.
- [x] A `data/raw_flight_data/` directory containing JSON files (or a single SQLite database file) of fetched flight data.
- [x] A `config.py` (or `.env` file) for managing API endpoints and API keys securely.
Stage 2: Agentic Planning & LLM Prompt Engineering
This stage established the 'brain' of our AI travel agent. We successfully designed and implemented an agentic planning system, leveraging advanced prompt engineering techniques to guide an LLM in understanding complex user requests, breaking them down into actionable steps, and making informed decisions. We learned to structure an iterative agentic loop and critically refine prompts for optimal agent performance and reasoning.
Deliverables
- [x] Initial Python code for the `AgenticPlanningModule` or similar core agent orchestration logic.
- [x] A documented set of prompt templates used for initial plan generation, sub-task breakdown, and plan refinement.
- [x] Unit and integration tests covering various user input scenarios and expected agent plan outputs.
- [x] A short markdown document (`prompt_engineering_report.md`) outlining the prompt engineering strategies and lessons learned.
Stage 3: RAG Implementation & Vector Database Integration
This stage successfully established the Retrieval-Augmented Generation (RAG) pipeline, overcoming the LLM's knowledge limitations by integrating a real-time flight data source with a vector database. We learned to preprocess, embed, and store external data, and developed a retrieval mechanism to provide the LLM with current, contextually relevant information, significantly enhancing its accuracy and utility as a travel agent.
Deliverables
- [x] `flight_data_ingestor.py`: Python script responsible for fetching flight data from the API, processing it (chunking), embedding it, and upserting into the vector database.
- [x] `rag_retriever.py`: A Python module containing the logic for querying the vector database, performing similarity search, and retrieving relevant document chunks based on a user query.
- [x] Updated `travel_agent.py`: The main agent script, modified to integrate the `rag_retriever` before sending flight-related queries to the LLM.
- [x] `vector_db_schema_definition.md`: A markdown file documenting the schema used in the vector database for storing flight data, including metadata fields and embedding dimensions.
Stage 4: Kubernetes Deployment & API Exposure
This stage successfully transitioned the containerized AI travel agent into a robust, cloud-native environment. We deployed the application and its RAG components to an AWS EKS Kubernetes cluster, defining all necessary `Deployment`, `Service`, and `Ingress` resources. The key outcome was exposing the AI agent's API securely, demonstrating proficiency in Kubernetes orchestration, AWS cloud infrastructure, and the operational aspects of a distributed system.
Deliverables
- [x] `Kubernetes YAML manifests` for the AI agent Deployment, Service, and (if used) Ingress.
- [x] `Kubernetes YAML manifests` for the RAG module Deployment and Service.
- [x] `kubectl output` screenshots or logs demonstrating successful deployment and healthy status of all Pods, Deployments, and Services.
- [x] A `documented accessible API endpoint` (DNS name or IP address) for the AI travel agent, confirmed to be working with a test request.
Stage 5: AWS Cloud Infrastructure Setup
This stage successfully laid the groundwork for our AI travel agent project by setting up the essential AWS cloud infrastructure. We configured a secure and connected VPC with public subnets, established internet connectivity via an IGW, and validated the network by launching and accessing a test EC2 instance. This provides a robust and scalable environment for deploying our containerized application in subsequent phases.
Deliverables
- [x] A screenshot of the AWS Console showing the successfully created VPC, subnets, Internet Gateway, route tables, and security groups, clearly indicating their configured states.
- [x] A text file (`.txt`) containing the sequence of AWS CLI commands used to provision the infrastructure components (VPC, subnets, IGW, route tables, security group, EC2 instance launch).
- [x] Proof of successful SSH connectivity to the launched EC2 instance, including a screenshot demonstrating a successful `ping google.com` command execution from within the instance.
- [x] A high-level conceptual network diagram (e.g., a simple sketch or image) illustrating the layout of the VPC, subnets, IGW, and the EC2 instance's placement and connectivity within this environment.
Stage 6: Testing & Autonomous Agent Evaluation
This stage focused on rigorously testing and evaluating the autonomous AI travel agent. We implemented a comprehensive testing strategy, covering unit, integration, and end-to-end scenarios, to ensure the reliability and accuracy of the RAG system and agentic planning. By defining key performance indicators and using diverse test cases, we thoroughly evaluated the agent's autonomous decision-making and response quality, identifying and resolving issues to prepare the system for production while setting up continuous monitoring.
Deliverables
- [x] `Automated Test Suite (Code)`: A comprehensive set of unit, integration, and end-to-end tests for the entire AI travel agent system.
- [x] `Test Execution Report` (`PDF`/`Markdown`): A detailed report summarizing test results, code coverage metrics, identified bugs, and performance benchmarks.
- [x] `Monitoring Dashboard Configuration` (`YAML`/`JSON`): Configuration files for a monitoring dashboard (e.g., Grafana) displaying key metrics for agent performance, API usage, and system health.
- [x] `Bug/Issue Log` (`Jira`/`CSV`/`Markdown`): A documented list of all identified bugs, performance issues, and anomalies, including severity, priority, and steps to reproduce.