Skip to content

Realm State Projection Mechanics ​

In Nimi's distributed architecture, client applications consume data from Realm through structured, read-only State Projections provided by the SDK. Projections serve UI presentation layers in the supported desktop and web experiences, while authoritative data invariants and persistence remain governed by Realm.

Consumer Layering and Invariants ​

LayerResponsibilityArchitectural Rationale
SDK Generated CoreCompiled directly from external Realm OpenAPI specificationsTypes follow the checked-in contract; the deployed service must support that contract
SDK FacadePreserves typed requests, retry policies, and structured errors; Runtime holds credentials for protected App accessSimplifies application development while shielding transport nuances
Application & Desktop ViewsRenders state projections and manages ephemeral UI cachesCaches optimize rendering responsiveness; authoritative state lives upstream

Protocol Evolution and Anti-Drift Strategy ​

When Realm APIs evolve across releases:

  • Schema-Driven Regeneration: Re-compile SDK core models from updated OpenAPI specifications to maintain strict contract compliance.
  • Fail-Closed Diagnostics: If schema mismatch or API drift is detected, SDK facades emit structured error reasons, guiding developers to upgrade dependencies rather than risking silent client corruption.

Source Basis ​

Documentation for Nimi — the installable, open-source, local-first personal AI product.