How chiraggulati098/devflow works
Project type and purpose
• DevFlow is a desktop-based, full-stack AI programming assistant.
• It combines a PyQt5 GUI (“frontend/”) with a set of backend modules for PDF processing, vector storage, RAG (Retrieval-Augmented Generation) logic, and external API integration (Google Gemini).
• Its goal is to guide developers through the project lifecycle, answering queries based on uploaded documentation and ultimately scaffolding or generating code.
File structure
• Top-level entrypoint: main.py – initializes the application, starts the GUI and backend threads.
• frontend/
• UI components: chat_interface.py, menu_interface.py, settings_dialog.py, tech_stack_dialog.py, project_setup.py
• Shared widget definitions: components.py, ui.py
• backend/
• PDF ingestion: pdf_processor.py (uses pdfplumber to extract and chunk text)
• Vector database: vector_store.py (ChromaDB integration, syncing with docs/)
• AI integration: ai_model.py (Google Gemini calls, query summarization, reranking with sentence-transformers)
• Config & templates: project_config.py, templates/gitignore_template.txt
• docs/: source PDF materials the system ingests
• requirements.txt: declares dependencies (PyQt5, chromadb, google-generativeai, etc.)
Key insights from README
• RAG pipeline: ingest → embed → retrieve → generate → rerank.
• UI runs in the main thread, heavy processing offloaded to QThreads.
• Future modules: backend/code_generation.py for project scaffolding and state management.
a. Main components
1. UI Layer (frontend/)
– Chat window, panels for workflow steps, settings dialogs
2. Controller / Orchestrator (main.py + QThread classes)
– Manages user events, delegates tasks to backend
3. PDF Processor (backend/pdf_processor.py)
4. Vector Store (backend/vector_store.py + ChromaDB)
5. AI Model (backend/ai_model.py)
– External service: Google Gemini API
– Local reranker: sentence-transformers
6. Project Config & Templates (backend/project_config.py + templates/)
7. Docs Directory (docs/)
8. Persistent Storage (ChromaDB files on disk)
9. External Services
– Google Gemini endpoint
b. Relationships & data flows
• User types a query in UI → Controller queues it in a QThread
• QThread calls PDF Processor to ensure all docs/ are chunked
• Controller calls Vector Store to retrieve top-k relevant chunks
• Controller passes query + chunks to AI Model → calls external API → reranks responses → returns answer
• Controller emits signal back to UI thread → UI displays answer
• On project creation / code generation (future): Controller calls Project Config + Templates → writes new files to disk
c. Architectural patterns
– Modular separation of concerns (UI vs. processing vs. storage vs. external API)
– Asynchronous processing via QThreads to maintain responsive UI
– RAG micro-pipeline pattern (ingest → store → retrieve → generate)
– Use of template engine for code scaffolding
d. Key technologies & frameworks
– PyQt5 (GUI)
– pdfplumber (PDF ingestion)
– ChromaDB (vector store)
– Google-generativeai (Gemini API)
– sentence-transformers (reranking)
– python-dotenv (API key management)
Detail
• Future extension point: Code Generation module calling Config & Templates.
• Error-retry logic in AI Model (e.g., “retry up to 3×”).
• Notes on threading boundaries to illustrate responsiveness.