System Overview
Olis is architected as a modern monorepo that combines multiple applications and shared libraries into a cohesive ecosystem. The architecture emphasizes modularity, type safety, and developer experience.Monorepo Structure
Component Architecture
Desktop Client (Electron)
Technology Stack
- Electron: Native desktop wrapper
- Next.js: React framework with App Router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Native Sidecar: Rust-based native modules
- Static export for file:// protocol compatibility
- Hot module reloading in development
- Native integration via Rust sidecar
- Local LLM support via bundled
llama-server
API Server (Python)
Technology Stack
- FastAPI: Modern Python web framework
- Uvicorn: ASGI server
- RAG Pipeline: Document retrieval and generation
- Vector Database: Semantic search
- RESTful API endpoints
- Real-time document processing
- RAG (Retrieval-Augmented Generation) system
- Redis caching layer
- Docker containerization
Chrome Extension
Technology Stack
- Manifest V3: Modern extension API
- TypeScript: Type-safe extension code
- Webpack: Module bundling
- Context menu integration
- Page content extraction
- Background service worker
- Communication with API server
Data Flow
Intent Detection Pipeline
Intent Analysis
Local or remote LLM analyzes the input to detect user intent:
- Local Mode: Bundled llama-server with GGUF model
- Remote Mode: Hosted LLM via API
- NLP Fallback: Heuristic-based detection
Context Retrieval
RAG system retrieves relevant context from:
- Document store
- Vector database (semantic search)
- User’s configured document folder
Technology Decisions
Nx Monorepo
Why Nx?
Nx provides:
- Efficient task orchestration
- Dependency graph visualization
- Incremental builds
- Code generation
- Plugin ecosystem
pnpm Workspace
Why pnpm?
pnpm offers:
- Efficient disk space usage (content-addressable store)
- Fast installation speeds
- Strict dependency isolation
- Monorepo workspace support
Rust Native Modules
Why Rust?
Rust provides:
- Memory safety without garbage collection
- Zero-cost abstractions
- Performance for compute-intensive tasks
- Safe FFI with Node.js via napi-rs
- File system operations
- Encryption/decryption
- Data parsing and transformation
- Native OS integrations
Deployment Architecture
Desktop Client
Artifacts:- Windows: NSIS installer (.exe)
- macOS: DMG, ZIP
- Linux: AppImage, Snap, DEB
API Server
Infrastructure:- Containerized with Docker
- Orchestrated with Kubernetes
- Redis for caching
- Vector database for RAG
- Load balancing and auto-scaling
Security Architecture
Desktop Client
- Context isolation enabled
- Secure IPC communication
- Native keychain integration (keytar)
- Sandboxed renderer process
API Server
- JWT authentication
- Rate limiting
- CORS configuration
- Input validation
- Secure secret management
Performance Considerations
Desktop Client
- Static Export: Eliminates Next.js server overhead
- Lazy Loading: Components loaded on demand
- Code Splitting: Reduced initial bundle size
- Native Modules: Performance-critical paths in Rust
API Server
- Redis Caching: Reduced database queries
- Vector Search: Efficient semantic similarity
- Async I/O: Non-blocking request handling
- Connection Pooling: Database optimization
RAG System
- Batch Processing: Bulk document ingestion
- Incremental Updates: Only process changes
- Embedding Cache: Reuse computed embeddings
- Query Optimization: Efficient retrieval strategies
Development Workflow
Next Steps
Electron Client
Deep dive into the desktop application
API Server
Explore the backend architecture
Development Setup
Set up your development environment
Contributing
Learn how to contribute