How mirix-ai/mirix works
Project Type and Purpose
• This is a full-stack, open-source multi-agent personal assistant application.
• Frontend: Electron + React for desktop UI, capturing user input and screen activity.
• Backend: Python library + FastAPI server managing six specialized memory agents, orchestrating data flows, and interfacing with LLM APIs and a local database.
• Frontend → FastAPI API endpoints: user messages, file uploads, settings.
• FastAPI → AgentWrapper: wraps incoming requests into internal messages.
• AgentWrapper ↔ Message Queue → Specialized Agents: dispatch tasks (e.g., “summarize screen capture” → EpisodicMemoryAgent).
• Agents → Service Layer → ORM → Database: persist new memory records or query existing ones.
• Agents → LLM API Clients → External LLM Providers (OpenAI, etc.) → Agents: generate responses or process data.
• Agents → File Manager → Local filesystem / Cloud mapping: store screen captures, audio files.
• BackgroundAgent monitors screen activity → sends captures back through the same orchestration flow.
• FastAPI → Frontend: streams or returns responses to display chat bubbles and memory visualizations.
Architectural Patterns and Design Principles
• Layered Architecture: separation of concerns across UI, API, agent/orchestration, services, data.
• Multi-Agent Pattern: each memory type is encapsulated in its own agent class, promoting modularity and extensibility.
• Dependency Injection via Configuration: agents, database, and LLM clients are wired from YAML configs.
• Event-Driven messaging: in-process message queue decouples agents and orchestrator.
• Privacy-first local storage: database and screen captures remain on user’s machine, controlled by Electron settings.
Technologies and Frameworks
• Frontend: Electron, React, JavaScript/TypeScript ecosystem (Node.js, package.json)
• Backend: Python 3.x, FastAPI, SQLAlchemy, pglite, uvicorn
• LLM Clients: openai, anthropic, cohere, google-ai, aws-bedrock wrappers
• Data: SQLite or PostgreSQL, BM25 full-text search, vector similarity (pgvector)
• Build & Packaging: PyInstaller spec files (main.spec, mirix_backend.spec), Electron packaging scripts