How gupta-nakul/airline-customer-support-rag works
Main Components
• Frontend Application:
• Located under the "frontend" folder.
• Built with modern web technologies (React, TypeScript).
• Communicates with the backend via APIs.
• Backend Service:
• Found under the "backend" directory.
• Contains two parts:
a. The core routing and chatbot logic (src/app.py, src/chatbot.py).
b. The "agentic_system" modules and tools that build various assistants, graph structures, and manage state (build_assistants.py, build_graph.py, etc.).
• Handles business logic and integrates external APIs (possibly LLM APIs, airline policy lookups, etc.) using API keys declared in the .env file.
• Data Preparation Module:
• Located in the "data_prepare" directory.
• Scripts to download data, prepare a vector database (prepare_vector_db.py), and update the database dates (update_db_date.py).
• Ensures that the system uses up-to-date airline data and booking information.
• Infrastructure & Deployment:
• Docker files in "backend", "data_prepare", and "frontend" directories indicate containerized deployment.
• A docker-compose.yml file suggests orchestration between containers.
• External Services & APIs:
• External LLM services (OpenAI, LangChain) and airline-related search APIs (Tavily Search).
• These are configured using environment variables in the .env file.
Relationships and Interactions
• Frontend communicates with the Backend’s API endpoints to send user queries and receive responses.
• Backend serves as the brain:
• It interacts with “agentic_system” components, which likely construct the structured logic for handling questions (using build_prompts, build_runnables, etc.).
• It utilizes a range of "tools" (for flights, hotels, rental cars, excursions, etc.) to answer specific customer inquiries.
• It integrates with external LLM services to produce augmented generated responses based on dynamic data and airline policies.
• Data Preparation module is used periodically (or as a scheduled task) to fetch, preprocess, and vectorize data needed by the RAG pipeline, ensuring that the chatbot delivers up-to-date information.
Important Architectural Patterns and Design Principles
• Separation of concerns:
• Clear demarcation between front-end, business logic (backend), and data preprocessing.
• Microservices-like modularity within the backend:
• The segmentation into “agentic_system”, “tools”, and “utils” indicates an organized approach where each module performs its designated role.
• Containerization:
• Usage of Dockerfiles and docker-compose points to a containerized deployment strategy for isolation and ease of maintenance.
Technologies, Frameworks, and Libraries
• Frontend: React with TypeScript.
• Backend: Python (with modules for chatbot logic and agentic systems).
• Data Management: Likely the use of a vector database (as indicated by prepare_vector_db.py) and structured data management for real-time airline information.
• External API integrations: OpenAI, LangChain, and Tavily Search.
• Deployment: Docker and Docker Compose.