Skip to content

Harness Architecture

Maktabi Desktop Agent is engineered on the ICM Umbrella architecture (Interpretable Context Methodology).

System Architecture

┌────────────────────────────────────────────────────────┐
│ Maktabi Desktop Client │
│ ┌────────────────────┐ ┌──────────────────────┐ │
│ │ UI Renderer │ │ Local Harness │ │
│ │ (React + Tailwind) │◄────►│ (Electron Main/IPC) │ │
│ └────────────────────┘ └──────────┬───────────┘ │
│ │ │
│ ┌─────────────────────────────────┼────────────┐ │
│ │ Local File System (Word, Excel) │ OS Keychain│ │
│ └─────────────────────────────────┴────────────┘ │
└─────────────────────────────┬──────────────────────────┘
│ HTTPS / SSE (Bearer mk_dsk_...)
▼
┌────────────────────────────────────────────────────────┐
│ Maktabi API Gateway (prod-vps) │
│ ┌────────────────────┐ ┌──────────────────────┐ │
│ │ Traefik v3 Ingress │─────►│ Next.js Auth Gate │ │
│ └────────────────────┘ └──────────┬───────────┘ │
│ │ │
│ ┌─────────────────────────────────┼────────────┐ │
│ │ Supabase DB (Pooler 6543) │ OmniRoute │ │
│ └─────────────────────────────────┴────────────┘ │
└────────────────────────────────────────────────────────┘

Key Architectural Principles

1. Local-First Processing

Your documents, drafts, templates, and revision histories are stored on your local drive (C:\Users\...). No document content is mirrored or persisted on Maktabi cloud servers.

2. Zero-Retention Gateway

When an inference request is dispatched to adem or adem-pro:

  • The API gateway performs an immediate authorization check against maktabi.desktop_tokens.
  • It validates that credits_balance > 0.
  • The request streams through an unbuffered proxy directly to OmniRoute.
  • The raw prompt and completion are discarded immediately after streaming. Only token counts are logged in maktabi.usage_events for credit metering.