How aditipatil38/aura works
Project type and purpose
• This is a full-stack conversational AI web application (“AURA – Virtual Therapy Assistant”) built with Flask.
• It exposes an HTML/JavaScript chat UI, communicates with a Python backend, leverages LangGraph + LangChain for LLM orchestration, uses a RAG pipeline (FAISS + HuggingFace embeddings over a local corpus), calls out to Groq’s LLaMA3 API, and persists chat history in Firebase.
File structure
• Top-level files:
• app.py – Flask application entry point, routes HTTP requests
• firebase_config.py – Firebase client setup for reading/writing chat history
• graph.py – Definition of the LangGraph workflow (turn-based LLM orchestration)
• rag.py – RAG logic (builds/queries FAISS index over data/therapy_notes.txt using HuggingFace embeddings)
• Directories:
• templates/chat.html – front-end UI served by Flask
• data/therapy_notes.txt – the corpus for retrieval augmentation
• img/ – static screenshots
• No separate “static” folder shown, but likely embedded JS/CSS in chat.html.
README for additional insights
• Confirms tech stack: Flask (backend), HTML+JS (frontend), LangGraph & LangChain, Groq API for LLM, FAISS + HuggingFace for RAG, Firebase Realtime DB.
• Describes features: emotional grounding, multilingual support, retrieval from therapy_notes, chat history via Firebase.
Components
a. Main components
• Frontend (Chat UI in browser)
• Flask Backend (app.py)
• LangGraph Workflow (graph.py)
• RAG Pipeline (rag.py + FAISS index over data/therapy_notes.txt + HuggingFace embeddings)
• LLM Service (Groq LLaMA3 API)
• Firebase Realtime Database (chat history)
b. Relationships & interactions
1. User → Browser (UI)
2. Browser ↔ Flask app (HTTP POST chat messages / GET HTML)
3. Flask app invokes LangGraph workflow → calls Groq LLM
4. RAG pipeline queries FAISS index → returns context
5. LangGraph orchestrates RAG context + prior conversation → LLM API → response
6. Flask app writes/reads last-3 messages to Firebase via firebase_config.py
7. Flask returns response JSON → Frontend displays
c. Architectural patterns & design principles
• Layered separation: Presentation (frontend), Application (Flask + Graph), Data (FAISS index, Firebase), External Service (Groq API)
• Retrieval-Augmented Generation pattern
• Checkpointing conversational state via LangGraph + Firebase
d. Relevant technologies
• Flask (web server / routing)
• LangGraph & LangChain (LLM orchestration)
• Groq’s LLaMA3 API (LLM endpoint)
• FAISS + HuggingFace embeddings (vector store)
• Firebase Realtime DB (persistent chat history)
• HTML + JavaScript (frontend chat UI)
Final guidance
• Be as granular as practical: separate the LangGraph orchestration from the RAG retrieval module even though they both live in the Python backend.
• Major actors: user browser, backend modules, vector store, external API, database.