Zero-knowledge guarantee: The Nia server never sees plaintext content. Encryption, embedding, and decryption all happen on your device.
How It Works
Supported E2E Source Types
The E2E encryption layer is source-agnostic — every adapter produces the same{ files, cursor, stats } shape and pipes through the same buildE2ESyncBatch() pipeline.
Key Concepts
Encryption Key
A user-owned passphrase that never leaves your device and is never sent to the server. Stored in the macOS Keychain (or platform-equivalent secure storage). Used to derive AES-256-GCM encryption keys via PBKDF2.Blind Index Key
Derived separately from the same passphrase. Produces deterministic HMAC-SHA256 tokens for keywords, contact hashes, and conversation hashes. These tokens enable the server to filter encrypted results without knowing the plaintext values.Embedding Profile
All E2E sources use thezembed-1-2560 embedding profile. Embeddings are computed client-side so that query embeddings from the agent match the stored document embeddings — enabling vector similarity search over encrypted data.
Decrypt Sessions
When an agent needs to read E2E-encrypted content, the desktop app creates a temporary scoped session with configurable limits:- TTL: session expires after a set duration
- Max chunks: limits how many chunks can be decrypted
- Allowed operations: restricts what the session can do
Sync Modes
E2E Data Pipeline
Every adapter follows the same pipeline:API Endpoints
Push Encrypted Data
Decrypt Sessions
Source Management
Querying E2E Sources
Use the standard search endpoint with thee2e_session_id parameter:
Demo App
See E2E encryption in action with the iMessage demo app — a full working example of syncing, indexing, and chatting with your iMessage history:nia-imessage-app-demo
Open-source demo app showcasing E2E encrypted iMessage sync, indexing, and conversational search. Clone it to get started quickly.
Cookbook
Sync iMessage with E2E Encryption
This is the most common E2E use case — indexing your iMessage history so agents can search your conversations without the server ever seeing message content.1
Set up encryption
On first run, the desktop app prompts for a passphrase. This derives both the encryption key and blind index key. The passphrase is stored in your macOS Keychain.
2
Build the sync batch
The iMessage adapter reads
~/Library/Messages/chat.db and produces conversation-windowed chunks:3
Encrypt and upload
4
Query from an agent
Create a Decrypt Session for a Remote Agent
Decrypt sessions let you grant temporary, scoped access to encrypted data without sharing your key:Add a New Source Type
Follow the adapter pattern to add support for any local data source:Purge Encrypted Data
Remove all encrypted data for a source:Check E2E Source Usage
Security Model
Related Pages
Local Sync
Set up continuous sync for local folders and databases.
Source Types
Browse all supported source types.
SDK Examples
Complete code examples including E2E sync.
Privacy
Learn about Nia’s privacy and security practices.

