How vanshajr/chatsynth works
Project type and purpose
• ChatSynth is a monolithic Python/Streamlit “full-stack” web application that:
– Builds a structured user profile (JSON)
– Generates a FAISS vector index from that profile
– Provides a RAG-style chat interface (rag_chatbot.py)
– Deploys a new chatbot repo to GitHub via one-click integration
File structure
• app.py – orchestrator entry point, implements Steps 1–4 via Streamlit UI
• deployed_files/
– rag_chatbot.py – the standalone chat app code pushed to user’s GitHub repo
– requirements.txt – dependencies for the deployed chatbot
• requirements.txt – dependencies for the builder app
Extract key architecture notes from README
• Streamlit front end + orchestration
• FAISS vector store for knowledge retrieval
• External LLM services (Groq Cloud, HuggingFace)
• GitHub API for one-click deployment
Main components & interactions
a. Frontend (Streamlit UI)
– Built in app.py – renders forms and buttons for each step
– Collects user inputs (profile data, tokens, repo name)
b. Profile Processor
– Validates form inputs, emits structured JSON
– Saves JSON to local storage (temp file or memory)
c. FAISS Index Builder
– Reads JSON, uses HuggingFace embeddings to build FAISS index
– Persists index locally (folder or file)
d. Chat Handler (RAG Service)
– rag_chatbot.py logic:
• Retrieves top-k docs from FAISS
• Calls LLMs (Groq Cloud API, HuggingFace model)
• Streams chat responses back to UI
e. Deployment Service (GitHub Deployer)
– Uses GitHub API + user’s tokens
– Generates new repo: pushes rag_chatbot.py + requirements.txt
– Returns URL for one-click Streamlit deployment
External services & data stores
• External LLM Services: Groq Cloud API, HuggingFace Inference API
• GitHub API – create repo + push code
• Local storage: JSON profile files, FAISS index files
Architectural patterns & principles
– Monolith subdivided into “layers”: UI layer, business-logic layer, data-layer
– Clear separation of concerns: profile build → indexing → retrieval/chat → deployment
– Externalize all long-running or stateful operations (vector store, GitHub push)