How udit-rawat/quest works
Main Components
a) Core Components:
• RAG Engine Service
• Document Retriever
• Data Embedder
• Memory Buffer
• Generation Model Interface (Ollama Integration)
• Web Interface (Flask)
b) External Dependencies:
• Ollama Models (qwen2.5-coder:1.5b and deepseek-r1:1.5b)
• FAISS/HNSW Index
• Metadata Store
Component Relationships
• User Query Flow: Web Interface → RAG Engine → Retriever/Generator
• Data Processing Flow: Embedder → HNSW Index → Retriever
• Generation Flow: RAG Engine → Ollama Models → Response Processing
• Memory Management: Query/Response → Memory Buffer → Context Enhancement
Specific Implementation Details
Key elements:
• HNSW Index for similarity search
• Metadata store for problem information
• Memory buffer for context retention
• Dynamic prompt switching mechanism
• Confidence threshold handling (0.6 threshold)
┌─────────────────┐
• Web Interface │
• ┬────────┘
• ↓
┌─────────────────┐ ┌─────────────────┐
• RAG Engine │←→ │ Memory Buffer │
• ┬────────┘ └─────────────────┘
• ↓
┌────────┴────────┐ ┌─────────────────┐
• Retriever │←→ │ HNSW Index │
• ┬────────┘ └─────────────────┘
• ↓
┌─────────────────┐
• Ollama Models │
• ┘
Key Interactions to Highlight
a) Query Processing Path:
• User input → RAG Engine
• RAG Engine → Retriever → HNSW Index
• RAG Engine → Ollama Models
• Response → Memory Buffer
• Final Output → User Interface
b) Data Flow Path:
• Document Processing → Embedder
• Embeddings → HNSW Index
• Metadata → Storage
• Solutions → JSON Storage
Performance Optimizations
• Query retrieval optimization (15s)
• Reasoning model optimization (4min)
• HNSW parameter tuning
• Dynamic prompt switching
Implementation Notes
• Version1Components for legacy implementations
• src/DSAAssistant for current implementation
• Research components for experimental features