Skip to main content
This page documents MobKit v0.8.34 (mirrored from v0.8.34). MobKit is a Rust composition crate plus gateway binaries, SDKs, examples, a Flow Editor, and a React console. It is a companion to Meerkat, not a second multi-agent runtime. Meerkat owns individual-agent execution and multi-agent mob orchestration: session construction, prompt and tool execution, stable AgentIdentity, mob membership, spawn, lifecycle, wiring, flows, comms, coordination, and machine authority. MobKit owns application-facing composition around that substrate: startup, host desired-state providers, module routing and delivery, operational policy, MobKit persistence projections, gateway and SDK transport, console timeline projection, and operator UX.

Design principles

  1. One upstream runtime authority - MobKit invokes Meerkat mob operations; it does not become a second authority for membership, lifecycle, wiring, or session truth.
  2. Data at process boundaries - module and gateway communication uses typed serialized messages. In-process Rust hosts may use typed traits and builders without inventing a second wire contract.
  3. Projection, not authority - console rows, timelines, identity views, and MobKit continuity records reflect runtime and host desired state. Their persistence does not turn them into a shadow MobMachine.
  4. Deliberate gateway profiles - Rust library embedding, SDK-facing rpc_gateway, and console/admin mobkit_gateway share a composition root but intentionally expose different authorities.
  5. Fail closed - persistent storage slots, module capabilities, auth, access control, and signed remote contacts refuse missing authority instead of silently weakening the deployment.
Applications decide desired identities, topology, and domain policy. MobKit adapts that intent into Meerkat operations and packages the resulting truth for SDK and console consumers. Meerkat remains the authority that admits and executes mob transitions.

High-level architecture

Gateway profiles

The binaries can both show a console, but that does not make them substitutes. An SDK host launches rpc_gateway. A console/admin deployment that does not need the SDK callback plane uses mobkit_gateway.

Crate structure

The core Rust crate is organized around explicit boundary modules:
The identity_first/ directory is a host continuity layer, not the owner of mob identity. It keys desired roster records, leases, and persistence bridges by Meerkat AgentIdentity, then materializes or resumes members through meerkat-mob.

Module boundary

The module boundary layer provides two communication paths:

MCP path (core modules)

Core modules expose MCP tools. The boundary calls call_module_mcp_tool_json with a tool name and arguments, receives a JSON response, and parses it into the expected type.
Key MCP tools per module: Gating evaluation is an in-process runtime authority, not an MCP module tool. The identity-scoped agent-memory APIs are also separate from this three-tool module boundary. This module-facing memory path is separate from MobKit’s identity-scoped agent memory record layer under memory/. The bundled hot record store is SQLite with deterministic recall and staged write validation. Elephant is an optional deeper backend, not the definition of all MobKit memory.

Subprocess path (custom modules)

For a generic custom module, the supervisor starts the configured process and reads its first stdout line. The line must be a valid normalized JSON event before the startup timeout. This one-shot boundary does not write a request to the module’s stdin.

Event transport

The event transport merges two event sources: Events are ordered by timestamp_ms, then event_id, then source. The tie break is deterministic but does not give either source family priority.

Supervisor design

The supervisor distinguishes generic JSON-line subprocesses from MCP module probes: These transitions describe startup supervision, not a claim that MobKit owns Meerkat member lifecycle. Mob member state changes still go through the Meerkat mob runtime.

HTTP composition

The runtime merges several Axum route families into one HTTP server: Routers are merged into a single axum::Router served on the configured port. The runtime-mounted Flow Editor shares console authentication and applies its own author/deploy access requirements. The standalone mobkit_flow_editor binary has no access controller, while the dispatcher still keeps host deploy sinks fail-closed unless explicitly granted.

Dependencies

External crates

Meerkat crates

Storage and persistence projections

MobKitStorageLayout is the single MobKit path authority. A MobKitStorageProvider wraps or accompanies Meerkat’s realm storage provider and opens the realm-wide MobKit stores for continuity, lease fencing, event log, console timeline, metadata, blobs, agent memory, and schedule state. Those stores are MobKit-owned projections and operational records; canonical Meerkat session and mob state stay upstream. Every persistent slot carries a DurabilityDeclaration. Startup must resolve it to a durable backend, an explicitly declared ephemeral choice, or an error. There is no silent in-memory fallback for persistent mode. Use the live-safe mobkit/storage/doctor operation for diagnosis. Mutating migration and pruning run offline through mobkit_gateway storage-migrate and storage-prune.

Security model

  1. Upstream machine authority - Meerkat admits mob identity, lifecycle, wiring, and session transitions. MobKit policy cannot bypass those machines.
  2. Trusted modules - only modules declared in trusted MobKit configuration are loaded.
  3. Authentication - JWT/OIDC validation and allowlists decide who reaches protected console surfaces.
  4. Optional ABAC - when enabled, AccessController is deny-by-default with deny-overrides across console REST, JSON-RPC, and SSE. Admins are an explicit bypass and enabling without an admin set is rejected.
  5. Non-ambient console credentials - mutation routes expect bearer tokens or explicit SSE/bootstrap tokens. Cookie-based hosts must add origin and CSRF protection.
  6. Signed remote contacts - TCP/UDS peers require real Ed25519 public keys; in-process wiring is authorized through the runtime identity map.
  7. Forged resolution detection - delivery validates routing resolutions against trusted store state.
  8. Rate limiting - delivery applies configured per-route fixed-window limits.

See also