How adityasingh0912/diamond_chatbot works
Main Components
• Frontend/UI:
• Represented by the “templates/index.html”, “static/style.css”, and “static/script.js”. This is the browser-based user interface that handles presentation and user interactions (e.g., multimedia diamond details, modals, and responsive design).
• Backend Server (Flask Application):
• “app.py” acts as the entry point for the Flask application, routing HTTP requests and serving the web interface.
• “chatbot.py” encapsulates the advanced chatbot logic and recommendation engine, handling natural language queries and interfacing with external services.
• External Services & Data Reliance:
• Apache Solr (Local Solr core named “diamond_core”): Used to index, search, and retrieve diamond data enriched with multimedia references.
• Groq API and AI Services (FAISS & SentenceTransformer): For natural language processing, similarity search, and expert recommendation insights.
• (Implied) solr_update.py: A specific script (mentioned in the README) that pushes diamond data (including images, videos, PDFs) to the local Solr instance.
Relationships and Interactions
• The Frontend (HTML/CSS/JS) in the user’s browser sends requests to the Flask backend (via app.py).
• The Flask backend handles incoming requests, calling the chatbot logic in chatbot.py to process queries.
• Chatbot.py connects to:
• The local Solr instance for retrieving diamond information.
• External AI/Groq API services to perform NLP and generate recommendations.
• The application may also have initialization/update workflows (via solr_update.py) to preload or refresh data in Solr.
Architectural Patterns & Design Principles
• API Integration Layer: Emphasize how internal components (app.py and chatbot.py) communicate with external systems (Solr, Groq API, etc.).
• Modular Design: Show that the project is split into distinct modules (web frontend, chatbot logic, data indexing) which support maintainability and scalability.
Relevant Technologies & Frameworks
• Flask (Python) for web server and routing.
• Apache Solr for indexing and search.
• AI/NLP libraries & tools (FAISS, SentenceTransformer) integrated via chatbot.py.
• Frontend technologies such as JavaScript and CSS that enhance the user interface for multimedia support.