Search: Encrypted Metadata Search
Full-text search over encrypted-at-rest metadata with Gmail-style operators, hybrid keyword/semantic ranking, and Reciprocal Rank Fusion. No plaintext indexing required.
The Problem
Full-text search requires plaintext indexing. Existing search engines cannot index encrypted-at-rest metadata. There is no Gmail-style operator support for encrypted mail.
Every email client relies on plaintext full-text indexes. Gmail, Outlook, and Thunderbird all store searchable text unencrypted. When metadata is encrypted at rest, traditional FTS engines cannot read it. Users lose the ability to search their own inbox.
Semantic search compounds the problem. Embedding vectors expose content patterns even when the source text is encrypted. No existing solution combines keyword search, semantic ranking, and encryption at rest in a single pipeline.
The Old Way
The PRIVATE.ME Solution
A complete search pipeline that encrypts metadata at rest, supports Gmail-style operators (from:, to:, subject:, has:attachment), and fuses keyword and semantic results via Reciprocal Rank Fusion.
FTS5 full-text search operates on metadata decrypted in memory. The index itself is stored encrypted. Gmail-style query operators parse into structured filters that combine with free-text ranking.
Hybrid ranking merges BM25 keyword scores with cosine-similarity semantic scores using Reciprocal Rank Fusion (RRF). This produces better results than either method alone, without exposing plaintext to external embedding services.
The New Way
How It Works
Three-stage pipeline: parse query operators, dual-index search (keyword + semantic), and Reciprocal Rank Fusion to produce final ranked results.
In-memory only: Decrypted data exists only in memory during query execution.
No external services: Embeddings generated on-device via local AI provider.
Operator support: from:, to:, subject:, has:attachment, before:, after:, is:starred.
Use Cases
Search across encrypted message metadata without exposing plaintext. FTS5 indexes encrypted at rest, decrypted in memory for queries.
FTS5Index only metadata (sender, subject, date) without storing message bodies. Search without full-content exposure.
MetadataUse familiar operators like from:alice subject:invoice has:attachment to filter results with structured precision.
OperatorsCombine BM25 keyword ranking with cosine-similarity semantic search via Reciprocal Rank Fusion for superior relevance.
RRFIntegration
import { createIndex, search } from '@private.me/search'; // Create encrypted search index const index = await createIndex('user@example.com', { enableSemantic: true, embeddingProvider: 'ollama' }); // Search with Gmail-style operators const results = await search( 'from:alice subject:invoice has:attachment', index ); // Results ranked by Reciprocal Rank Fusion results.forEach(r => console.log(r.score, r.subject));
Security Properties
| Property | Mechanism | Guarantee |
|---|---|---|
| Index encryption | AES-256-GCM at rest | No plaintext index |
| In-memory decryption | Decrypt only during query | Minimal exposure |
| Local embeddings | On-device AI provider | No cloud exposure |
| Query privacy | Client-side execution | No server query logs |
| Metadata only | No message body indexing | Content separation |
Ship Proofs, Not Source
Search generates cryptographic proofs of correct execution without exposing proprietary algorithms. Verify integrity using zero-knowledge proofs — no source code required.
- Tier 1 HMAC (~0.7KB)
- Tier 2 Commit-Reveal (~0.5KB)
- Tier 3 IT-MAC (~0.3KB)
- Tier 4 KKW ZK (~0.4KB)
Use Cases
Deployment Options
SaaS Recommended
Fully managed infrastructure. Call our REST API, we handle scaling, updates, and operations.
- Zero infrastructure setup
- Automatic updates
- 99.9% uptime SLA
- Enterprise SLA available
SDK Integration
Embed directly in your application. Runs in your codebase with full programmatic control.
npm install @private.me/search- TypeScript/JavaScript SDK
- Full source access
- Enterprise support available
On-Premise Upon Request
Enterprise CLI for compliance, air-gap, or data residency requirements.
- Complete data sovereignty
- Air-gap capable deployment
- Custom SLA + dedicated support
- Professional services included
Enterprise On-Premise Deployment
While Search is primarily delivered as SaaS or SDK, we build dedicated on-premise infrastructure for customers with:
- Regulatory mandates — HIPAA, SOX, FedRAMP, CMMC requiring self-hosted processing
- Air-gapped environments — SCIF, classified networks, offline operations
- Data residency requirements — EU GDPR, China data laws, government mandates
- Custom integration needs — Embed in proprietary platforms, specialized workflows
Includes: Enterprise CLI, Docker/Kubernetes orchestration, RBAC, audit logging, and dedicated support.