Skip to main content

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

olis-monorepo/
├── apps/
   ├── electron-client/    # Desktop application
   ├── api-server/          # Python backend
   └── chrome-extension/    # Browser extension
├── libs/
   ├── shared-ui/          # Shared React components
   ├── shared-types/       # TypeScript type definitions
   └── native-modules/     # Rust native modules
├── infra/                  # Infrastructure configuration
├── scripts/                # Build and utility scripts
└── docs/                   # Documentation

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
Key Features:
  • 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
Key Features:
  • RESTful API endpoints
  • Real-time document processing
  • RAG (Retrieval-Augmented Generation) system
  • Redis caching layer
  • Docker containerization
API Architecture:
# Main API structure
api-server/
├── src/
│   ├── backend/
│   │   ├── routers/       # API route handlers
│   │   ├── utils/         # Utility functions
│   │   │   └── retrievers/  # RAG components
│   │   └── models/        # Data models
│   └── main.py           # Application entry
└── tests/
    └── integration_tests/  # API tests

Chrome Extension

Technology Stack

  • Manifest V3: Modern extension API
  • TypeScript: Type-safe extension code
  • Webpack: Module bundling
Key Features:
  • Context menu integration
  • Page content extraction
  • Background service worker
  • Communication with API server

Data Flow

Intent Detection Pipeline

1

User Input

User types or speaks query in the desktop client or extension
2

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
3

Context Retrieval

RAG system retrieves relevant context from:
  • Document store
  • Vector database (semantic search)
  • User’s configured document folder
4

Response Generation

Combined context and query generate intelligent response

Technology Decisions

Nx Monorepo

Why Nx?

Nx provides:
  • Efficient task orchestration
  • Dependency graph visualization
  • Incremental builds
  • Code generation
  • Plugin ecosystem
Commands:
# Run single app
nx serve electron-client

# Build all apps
nx run-many --target=build --all

# View dependency graph
nx graph

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
Use Cases:
  • 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