This document outlines the strategic roadmap for evolving FoldDB from its current centralized cloud architecture into the peer-to-peer, mediated model for personal data described in GOAL.md.
The goal state describes a decentralized network where individuals operate Personal Data Nodes (PDNs), data access is peer-to-peer, and AI mediators compute insights in situ rather than transferring raw data. The current FoldDB implementation is a centralized multi-tenant cloud platform. This strategy bridges that gap through four major phases, progressively decentralizing data ownership while preserving what works today.
| Capability | Current Implementation |
|---|---|
| Data Storage | Centralized DynamoDB with tenant partitioning by user_hash |
| Identity | Pseudonymous passkey-based auth (WebAuthn) |
| Multi-tenancy | Strict "Zero Fallback Keys" isolation per user |
| Schema | Global Schema Registry at schema.folddb.com |
| AI Queries | LlmQueryService for semantic search and summarization |
| Transport | AWS Lambda + API Gateway, standalone Actix-web server |
| Third-Party Access | Planned: Passkey-native auth proxy with scoped JWTs |
| Capability | Goal State Description |
|---|---|
| Data Storage | Local Personal Data Nodes (self-hosted or custodial) |
| Identity | PDN is identity; connection-based trust |
| Multi-tenancy | N/A — each user operates their own node |
| Schema | Global schema, local stores (already aligned) |
| AI Queries | AI Mediators aligned to data owner's interests |
| Transport | P2P network layer; no central server |
| Third-Party Access | Peer connections with query-level disclosure |
-
No P2P Network Layer — The system lacks peer discovery, connection management, and direct node-to-node communication.
-
No Policy Engine — The goal requires fine-grained disclosure policies; we have only coarse API-level permissions.
-
Limited Mediator Capabilities — The current LLM service answers questions but doesn't filter disclosure or detect inference attacks.
-
No Derived Insight Pipeline — We lack mechanisms for generating verified claims, risk scores, or cryptographic attestations.
-
No Local-First Runtime — The current standalone server assumes cloud backends; true PDNs need a fully local data layer.
- Global Schema Registry — Already implements "Global Shape, Local Content"
- Schema Isolation — Multi-tenant enforcement can evolve into PDN isolation
- LLM Query Service — Foundation for AI mediator layer
- Passkey Identity — Aligns with cryptographic identity model
Goal: Enable true self-hosting with no cloud dependency
┌─────────────────────────────────────────────────────┐
│ Local PDN │
│ ┌─────────┐ ┌─────────────┐ ┌────────────────┐ │
│ │ Storage │ │ Schema │ │ AI Mediator │ │
│ │ (Sled) │ │ Registry │ │ (Local LLM) │ │
│ └─────────┘ └─────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────┘
Deliverables:
- Local-only Sled storage as default (no DynamoDB)
- Embedded schema registry (sync from global on demand)
- Local LLM integration (Ollama, llama.cpp) for offline mediator
- Desktop/CLI distribution for personal hosting
Preserves: Ingestion pipeline, query engine, schema system
Goal: Users define what can be revealed and to whom
┌─────────────────────────────────────────┐
│ Disclosure Policy │
├─────────────────────────────────────────┤
│ WHO: @bank_peer │
│ WHAT: income_summary, credit_indicators │
│ HOW: aggregated (no raw records) │
│ WHEN: valid until 2026-03-01 │
└─────────────────────────────────────────┘
Deliverables:
- Policy definition language (YAML/JSON DSL)
- Schema-aware disclosure rules (field-level controls)
- Query-time policy enforcement in AI mediator
- Audit log of all disclosures
- Revocation mechanisms with immediate effect
New Concept: Policies replace API permissions
Goal: Replace client-server with peer connections
┌─────┐ ┌─────┐
│PDN A│◄────────►│PDN B│
└──┬──┘ └──┬──┘
│ │
│ ┌─────┐ │
└───►│PDN C│◄────┘
└─────┘
Deliverables:
- libp2p or similar transport layer
- Peer discovery (bootstrap nodes, DHT, or invite codes)
- Connection handshake with mutual authentication
- Encrypted channels (Noise protocol or similar)
- Revocable connections with cascade policies
Major Shift: Institutions become peers, not privileged endpoints
Goal: AI computes insights without leaking raw data
Query: "Assess creditworthiness"
│
▼
┌───────────────────────┐
│ AI Mediator │
│ • Interpret request │
│ • Check policy │
│ • Compute locally │
│ • Enforce disclosure │
└───────────────────────┘
│
▼
Response: Score + Explanation
(No raw financial data sent)
Deliverables:
- Query classification (direct / derived / verified claim)
- Inference attack detection (rate limits, entropy monitoring)
- Output guards (minimum aggregation, differential privacy hints)
- Cryptographic attestations (signed claims, ZK proofs for specific assertions)
- Mediator alignment: explicit owner-interest prioritization
Key Insight: Raw data rarely leaves the node
Users can operate in three modes during transition:
| Mode | Description | Use Case |
|---|---|---|
| Cloud-Managed | Current DynamoDB-backed hosting | Users who prefer custodial simplicity |
| Self-Hosted | Local PDN with optional cloud sync | Privacy-conscious users |
| Federated | Custodian hosts PDN on user's behalf | Intermediate trust model |
All modes share the same schema registry and protocol.
# Export entire PDN to portable format
fold_db export --format pdn-bundle --output my_data.zip
# Import to new node (self-hosted or different custodian)
fold_db import --from my_data.zip --verify-signatures-
fold_dbruns fully offline - Ingest files, query via AI, no network calls
- Embed schema locally
- Define policy restricting field access
- Query returns filtered/aggregated data per policy
- Audit log captures disclosure event
- Two PDNs discover and connect
- PDN A queries PDN B with permission
- Response computed by B's mediator, sent to A
- User PDN receives "assess creditworthiness" query
- AI mediator computes risk score
- Only score + explanation returned
- Raw financial data never transmitted
-
Schema Governance: Who controls the global schema? DAO? Foundation? Community RFC?
-
Custodian Liability: If a hosting provider acts as custodian, what legal/technical guarantees?
-
Mediator Marketplace: Allow third-party AI mediators? How to verify alignment?
-
Backward Compatibility: Can existing Exemem cloud users transition seamlessly?
-
Performance: P2P queries will have higher latency — how to cache or optimize?
- Spike: Local-Only Mode — Get
fold_dbrunning with Sled-only storage, no AWS dependencies - Design: Policy DSL — Draft the disclosure policy language spec
- Research: P2P Libraries — Evaluate libp2p, Holepunch, or custom transport
- Prototype: Policy Engine — Implement field-level disclosure in mediator
- Prototype: Two-Node Demo — Basic P2P connection and query forwarding
- Production: Local-First Distribution — Desktop app or Docker container
- Production: Policy UI — User-friendly disclosure rule editor
FoldDB has a solid foundation for the goal state:
- Global schemas already implement the "shape is public, content is private" principle
- Multi-tenant isolation can evolve into per-node sovereignty
- LLM Query Service is the embryonic AI mediator
The journey requires major new capabilities — P2P networking, policy enforcement, and aligned mediation — but the path is incremental. Each phase delivers standalone value while moving toward the ultimate vision of personal data as personhood.
"The ambition is not to eliminate institutions or analytics, but to realign power."