How surya-kf/skyquery-agentic-database-reader works
Main Components
• User Interface: Represent the frontend that includes various HTML templates (e.g., index, login, admin, add/edit flight forms) along with static assets (CSS/JavaScript). This is where user interactions like chat queries, authentication, and administrative actions occur.
• Flask Application (Backend): Centerpiece of the system including the main app (app.py) that processes HTTP requests, handles routing, and integrates the chatbot, admin, and API endpoints.
• Natural Language Processing (NLP) Module: Indicate the integration with Together AI’s Llama 3.3 70B model for extracting flight information (e.g., flight numbers, destinations) from user queries.
• MongoDB Database: Acts as the data repository (collections like “flights” and “users”) to store real-time flight information and user/admin data.
• API Endpoints: Outline RESTful endpoints that provide data for both the chatbot responses and administrative functions.
Relationships and Interactions
• Client-to-Frontend: Show how users interact with the application via web browsers that load HTML templates and static assets.
• Backend-to-NLP Service: Illustrate integration between the Flask backend and the Together AI API for processing natural language queries.
• Backend-to-Database: Indicate how the backend queries and updates flight information stored in MongoDB.
• API Communication: Show that the REST API endpoints are part of the backend that allow both the UI and third-party integrations to access flight data.
Architectural Patterns and Design Principles
• MVC-Like Separation: Even though Flask is lightweight, the project separates concerns – static and template files for presentation (view), application logic in app.py (controller), and data management via MongoDB (model).
• Security & Authentication: Clearly mark the authentication module in the backend, since it manages user sessions and enforces role-based access for admins.
Relevant Technologies and Frameworks
• Python & Flask: Core backend framework.
• MongoDB (Atlas): Document-based data storage.
• Together AI’s Llama Model: NLP processing.
• HTML/CSS/JavaScript: Frontend technologies for building the UI.
• Deployment Tools: Procfile configuration and Render/Gunicorn for server deployment.
Practical Steps for the Engineer
• In the middle layer, detail the Flask application that manages routing, processing chat queries, handling logins, and administrative functions.
• To the side, represent the external NLP module (Together AI’s Llama model), connected via an API call from the Flask backend.
• At the bottom, illustrate the MongoDB database with separate connections for flight and user data.
• Don’t forget to indicate configuration and deployment components like the Procfile (for Render/Gunicorn) if high-level deployment architecture details are desirable.