How adarshukla3005/ai-restaurant-assistant works
Project type and purpose
• This is a modular full-stack AI assistant:
• Frontend: Streamlit web UI (app.py)
• Backend: Local vector database (ChromaDB), embedding service, external LLM API (Gemini-2.0-flash)
• Data-ingestion pipeline: Web scraper + JSON data processing
Main components
a. User Interface (Streamlit)
• app.py (Runs locally at localhost:8501)
• Communicates with the query-processing layer
b. Query Processing Layer (src/models/query_processor.py)
• Orchestrates between vector search and LLM API
• Applies business logic, fallback rules (restaurant vs. general queries)
c. Embedding Service (sentence-transformers)
• src/models/embeddings.py
• Generates vector embeddings for queries and data
d. Vector Database (ChromaDB)
• chroma_db folder + src/database/vector_db.py
• Stores/retrieves embeddings + metadata for restaurant data
e. External LLM API (Gemini-2.0-flash)
• Configured in src/config/llm_config.py
• Used for general knowledge responses
f. Data Storage
• Raw JSON data (data/*.json)
• Conversation history (convo_history/*.json)
• Database file (chroma_db/chroma.sqlite3, binary shards)
g. Data Ingestion / Web Scraping
• webscraper.py + utils/zomato_scraper.py + utility scripts (utils/)
• Selenium + BeautifulSoup → JSON → normalization → vector ingestion
Relationships and data flows
• User → Streamlit UI → Query Processor
• Query Processor →
• Vector Database (via vector_db.py) for restaurant queries
• Embedding Service to convert text to vectors
• External LLM API for general queries
• Data Ingestion Pipeline (offline) →
• Web Scraper → raw JSON → utils processing → embeddings → ChromaDB
• Conversation History Logger (conversation_history.json) captures Q&A
Architectural patterns & design principles
• Modular separation of concerns (config / database / models / prompts)
• “Adapter” layers: vector_db adapter isolates DB implementation
• Single responsibility: each module (scraping, embedding, query logic) is independent
• Data pipeline vs. real-time query path are decoupled
Technologies & frameworks
• Frontend: Streamlit
• Embeddings: sentence-transformers/all-MiniLM-L6-v2 (local)
• Vector DB: ChromaDB (local, file-based)
• LLM: Google Gemini-2.0-flash (external API)
• Web Scraping: Selenium + BeautifulSoup4
• Orchestration: Python scripts + app.py
Inclusion checklist
• Component labels (UI, services, DB, files, external)
• Arrowed lines illustrating request/response or data-flow direction
• Call out config files (llm_config.py), prompt templates (prompts.py), and model adapters