How tisu19021997/snipai works
Main Components
A. User Interface Layer
• Main Window (PyQt-based)
• Key interfaces: Home, Bookmarks, Recents, Settings
• Components: SearchBar, ImageCard, NetworkGraph, WaterfallLayout
• Theme support (Light/Dark modes)
B. Core Services Layer
• Screenshot Service (Keyboard service)
• Storage Service (SQLite with vector extensions)
• AI Services:
• LLM Service (Ollama integration)
• Embedding Service
• Image Processing Service
C. Model Layer
• Image Model
• Database Models
• Configuration Models
D. External Dependencies
• Ollama Models:
• Moondream (image description)
• Qwen2:1.5b (image tagging)
• mxbai-embed-large (text embedding)
• SQLite-vec (vector storage)
┌─ User Layer ─────────────────────────────────────┐
• PyQt UI │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐│
• Home Interface│ │ Bookmarks │ │ Settings ││
• ┘ └─────────────┘ └─────────────┘│
• ┬─────────────────────────────┘
• ↓
┌─ Services Layer ──────────────────────────────────┐
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Screenshot │ │ AI Services │ │ Storage │ │
• Service │ │(LLM/Embed) │ │ Service │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┬─────────────────────────────┘
• ↓
┌─ Data Layer ───────────────────────────────────┐
• ┌─────────────┐ ┌───────────────────────┐ │
• SQLite-vec │ │ Binary Vector Storage │ │
• ┘ └───────────────────────┘ │
• ┘
Data Flow Indicators
• Screenshot capture → AI processing → Storage flow
• Search query → Embedding → Vector search → UI display flow
• Settings changes → Configuration → System update flow
Technical Details
• PyQt as the UI framework
• SQLite with vector extensions
• Local AI model integration
• Binary embedding optimization
• File system interaction points
The data storage and retrieval mechanisms
This will provide a clear understanding of how SnipAI processes screenshots locally while maintaining efficient search capabilities through binary vector embeddings.