How amine123max/monolith works
Monolith is a local-first desktop workspace for AI-agent chat, coding, and collaboration. A user unlocks the optional local PIN gate, selects a workspace and starts a session; the React client sends requests through Tauri IPC to Rust orchestration, which routes model calls, runs tools, streams events, and persists session history and usage in local SQLite. Separate product branches cover provider configuration and secrets, local GGUF models, the integrated editor/terminal workbench, and desktop-native behavior. Relationships among backend crates and unsampled feature implementations follow README architecture statements; source excerpts establish the frontend entry points and IPC boundary.
Main entry points: App.tsx Workspace app · commands.rs Command handlers · runtime.rs Agent runtime · orchestrator.rs Session orchestration
Components 22
Desktop experience
- Workspace app
apps/monolith-desktop/src/App.tsx - PIN gate
apps/monolith-desktop/src/pages/LoginGate.tsx - Session chat
apps/monolith-desktop/src/pages/SessionChat.tsx - Workbench
apps/monolith-desktop/src/components/AgentInspector.tsx - UI state
apps/monolith-desktop/src/store/app.ts
Agent runtime
- Agent runtime
crates/monolith-agent/src/runtime.rs - Session orchestration
crates/monolith-agent/src/orchestrator.rs
Models and tools
- Model routing
crates/monolith-router/src/route.rs - OpenAI adapter
crates/monolith-provider-openai/src/lib.rs - Anthropic adapter
crates/monolith-provider-anthropic/src/lib.rs - Tool registry
crates/monolith-tools/src/registry.rs
Local data and security
- Session domain
crates/monolith-domain/src/session.rs - Session repository
crates/monolith-db/src/repository/session.rs - SQLite database
crates/monolith-db/src/pool.rs - Encrypted credentials
crates/monolith-security/src/file_store.rs - Security controls
crates/monolith-security/src/lib.rs
Desktop shell
- IPC client
apps/monolith-desktop/src/lib/ipc.ts - Command handlers
apps/monolith-desktop/src-tauri/src/commands.rs - Local models
apps/monolith-desktop/src-tauri/src/local_models.rs
Other components
- Desktop user
- Configured model endpoints
- Workspace files
Connections 25
- Desktop user → PIN gate: unlocks
- Desktop user → Workspace app: uses
README.md - Workspace app → PIN gate: checks access
apps/monolith-desktop/src/App.tsx - Workspace app → Session chat: opens sessions
README.md - Workspace app → Workbench: renders
apps/monolith-desktop/src/App.tsx - Workspace app → UI state: updates
apps/monolith-desktop/src/App.tsx - Session chat → IPC client: sends commands
README.md - Workbench → IPC client: requests tools
apps/monolith-desktop/src/components/AgentInspector.tsx - IPC client → Command handlers: invokes
apps/monolith-desktop/src/lib/ipc.ts - Command handlers → Agent runtime: dispatches
README.md - Agent runtime → Session orchestration: drives sessions
README.md - Session orchestration → Model routing: selects model
README.md - Model routing → OpenAI adapter: routes requests
README.md - Model routing → Anthropic adapter: routes requests
README.md - OpenAI adapter → Configured model endpoints: sends requests
README.md - Anthropic adapter → Configured model endpoints: sends requests
README.md - Agent runtime → Tool registry: executes calls
README.md - Tool registry → Workspace files: reads and writes
README.md - Session orchestration → Session repository: persists history
README.md - Session repository → Session domain: stores entities
crates/monolith-db/src/repository/session.rs - Session repository → SQLite database: reads and writes
README.md - Command handlers → Encrypted credentials: protects keys
README.md - Command handlers → Security controls: applies safeguards
README.md - Workspace app → Local models: manages models
README.md - Local models → Configured model endpoints: downloads fallback
README.md