Protocol Architecture

How Memzi works

A three-layer hybrid architecture engineered to resolve the trilemma of speed, sovereignty, and persistence. Each layer is independently useful; together they form the complete memory stack.

The Three Layers

L1

Local Hot Memory

On-Device

Every interaction is ingested, embedded, and stored on-device first using a hybrid vector + graph database. Client-side AES-256 encryption ensures plaintext never leaves user control. Retrieval latency is sub-5ms. This layer serves as the agent's working memory — always available, always private, zero network dependency.

L2

Encrypted Decentralized Cold Storage

IPFS / Arweave

User-initiated or policy-driven replication occurs only after encryption. The decentralized network sees only ciphertext. Wallet-derived keys and optional soulbound NFTs provide cryptographic ownership proofs. This layer guarantees permanence — memories survive device loss, provider shutdown, or regional censorship.

L3

Semantic Interoperability Protocol

Open Schema

A standardized memory schema enables seamless import/export across all major agent frameworks. Granular access controls and zero-knowledge proofs allow selective memory sharing without data exposure. Your agent's intelligence is never locked to a single stack.

Technical Specification

Deep-dive into the implementation details of each protocol component.

Storage Engine

Local layer uses LanceDB for vector similarity (1536-dim embeddings, cosine distance) paired with a lightweight property graph for relational traversal. Memories are chunked, deduplicated via MinHash, and indexed with HNSW for sub-5ms ANN retrieval on datasets up to 10M vectors per device.

LanceDBDuckDBHNSWMinHash1536-dim

Encryption & Key Management

AES-256-GCM with wallet-derived keys (BIP-44 path derivation). Optional integration with Lit Protocol for programmable key management and threshold decryption. Passkey-based fallback for web2 users via WebAuthn. Key rotation is supported via re-encryption envelopes without re-uploading ciphertext.

AES-256-GCMBIP-44Lit ProtocolWebAuthnKey Rotation

Retrieval Pipeline

Hybrid retrieval combines dense vector search with graph-based traversal and BM25 sparse matching. Memories carry importance scores (decayed over time, boosted by access frequency). Auto-summarization compresses old memories into distilled knowledge nodes. Temporal awareness surfaces recent context with configurable recency bias.

Dense + BM25Graph traversalImportance scoringAuto-summarization

Authentication

Primary: WalletConnect + Sign-In With Ethereum (SIWE / EIP-4361). Secondary: passkey-based auth via WebAuthn for non-crypto-native users. All memory operations are signed by the authenticated identity — providing an immutable audit trail regardless of auth method.

WalletConnectSIWE / EIP-4361WebAuthnAudit Trail

Sync Protocol

Encrypted memory diffs are synced via Helia (IPFS) for availability or Arweave for permanent archival. CRDTs (Automerge) handle multi-device conflict resolution. Sync is eventually consistent with configurable policies: real-time, batched, or manual. Bandwidth-optimized: only diffs transit the network.

Helia / IPFSArweaveAutomerge CRDTsDiff-only sync