Kelvin separates memory into:
- Control Plane (Kelvin Root): policy authority, orchestration, delegation minting.
- Data Plane (Memory Controller): execution authority for memory RPC, policy re-enforcement, WASM module sandboxing.
Root never links concrete storage/index drivers directly in the run path.
Kelvin Root
- owns run/session lifecycle and plugin admission.
- mints short-lived signed delegation JWTs per request.
- calls memory through
RpcMemoryManager(implementsMemorySearchManager).
Memory Controller
- exposes gRPC
MemoryService(v1alpha1). - verifies JWT issuer/audience/time validity and strict context equality.
- enforces replay protection via
jticache and bounded replay window. - executes the selected memory WASM module with runtime limits.
- routes host calls through enabled provider features.
WASM Memory Module
- provides
handle_upsert/query/read/delete/healthhandlers. - can only use host imports declared in ABI.
- has no direct host FS/network/shell access.
- Root and controller are expected in the same trust domain/VPC for MVP.
- delegation token crosses the boundary from root to controller.
- controller treats all module code as untrusted and sandboxed.
- controller defaults to loopback-only plaintext binding; non-loopback requires TLS or explicit insecure override.
- Root receives a memory request from brain/core orchestration.
- Root mints JWT claims with operation, capability scope, and limits.
- Root sends gRPC request with
RequestContext. - Controller verifies token and context.
- Controller checks module manifest + token scope + provider availability.
- Controller executes module handler with fuel/timeout/memory constraints.
- Controller executes provider operation and returns canonical response.
- Controller emits audit log with allow/deny reason and latency.
- Unreachable controller: root returns typed
KelvinError::Backendmemory-unavailable error. - Token/context mismatch: controller returns invalid-argument typed errors.
- Module timeout/fuel trap: controller returns timeout/unavailable typed errors.
- Missing provider feature: module registration is rejected before serving traffic.
- Root composition can enable
memory_rpc. - Temporary
memory_legacy_fallbackexists for migration safety only. - In-proc
kelvin-memoryremains transitional/deprecated and is not for new root paths. - Rollout verification helper:
scripts/memory-rollout-check.sh(legacy path + RPC path checks).