Data Residency
Benchmarked against: Anthropic — Data residency / Zero Data Retention Architecture: Cloud UB (D1 + Vectorize + R2) + per-ship local storage Decision: Cloud UB = single source of truth (Captain, 2026-03-01)
Data residency defines where SuperPortia's data lives, how it's organized, and how it's protected. This page maps every data type to its storage location and backup strategy.
Data location map
Storage by data type
| Data type | Primary storage | Backup | Access |
|---|---|---|---|
| UB entries | Cloud UB D1 | R2 + Local SQLite mirror | All ships |
| Work orders | Cloud UB D1 | R2 | All ships |
| WO transitions | Cloud UB D1 | R2 | All ships |
| Agent messages | Cloud UB D1 | R2 | All ships |
| Agent registry | Cloud UB D1 | — (ephemeral) | All ships |
| Vector embeddings | Cloudflare Vectorize | — (re-generable) | All ships |
| Source code | Git repos (per-ship) | GitHub | Per-ship |
| Agent memory graph | Memory MCP (local) | — (session-scoped) | Per-agent |
| CLAUDE.md + rules | Git repo | GitHub | Per-ship |
| Local file system | Ship filesystem | — (manual backup) | Per-ship |
Cloud UB (primary)
Cloudflare D1
- Technology: SQLite-compatible distributed database
- Location: Cloudflare global network (nearest edge)
- Tables: entries, work_orders, wo_transitions, agent_messages, agent_registry, captain_status
- Library system: Entries partitioned by
libraryfield (11 libraries) - Size: Growing — currently hundreds of entries, designed for thousands
Cloudflare Vectorize
- Technology: Vector similarity search index
- Embedding model: Cloudflare's built-in embedding model
- Dimensions: 768
- Purpose: Semantic search component of hybrid search
- Regenerable: If lost, can be rebuilt from D1 entry content
Cloudflare R2
- Technology: S3-compatible object storage
- Purpose: D1 database backups
- Strategy: Periodic exports of D1 tables to JSON/SQLite dump files
- Retention: All backups kept (storage is cheap)
Local storage (per-ship)
Local UBI SQLite
- Purpose: Local mirror of UB data for fast access
- Sync: Currently manual; future: automated sync from Cloud UB
- Status: Being phased out — Cloud UB is the authoritative source
Local Qdrant
- Purpose: Local vector database for semantic search
- Status: Being phased out in favor of Cloudflare Vectorize
- Limitation: Does not support Chinese semantic search well
Git repositories
- Purpose: Source code, configurations, documentation
- Backup: Pushed to GitHub
- Each ship has its own repo — code may differ by platform
Memory MCP
- Purpose: Agent knowledge graph (entities, relations, observations)
- Scope: Per-agent, session-scoped (not persisted across sessions by default)
- Persistence: Stored in local JSON file, survives across sessions for the same agent
Data sovereignty
All data stays within controlled infrastructure:
| Layer | Provider | Control level |
|---|---|---|
| Cloud storage | Cloudflare | Account-level, encrypted at rest |
| Database | Cloudflare D1 | Account-level, no shared tenancy |
| Vector index | Cloudflare Vectorize | Account-level |
| Backup | Cloudflare R2 | Private bucket, no public access |
| Source code | GitHub | Private repositories |
| Local files | Ship hardware | Physical access controlled |
No data goes to:
- Third-party analytics services
- Public cloud databases
- Shared/multi-tenant systems
- External AI training pipelines
Backup strategy
| Data | Method | Frequency | Retention |
|---|---|---|---|
| Cloud UB D1 | R2 export + local download | Daily (planned) | All kept |
| Vector index | Regenerable from D1 | On demand | N/A |
| Source code | Git push to GitHub | Per commit | Full history |
| Local UBI SQLite | Local filesystem | Manual | Last copy |
| Agent memory | Local JSON file | Automatic | Current state |
See Backup & Recovery for detailed procedures.
Migration history
| Date | Change | Reason |
|---|---|---|
| 2026-02 | Local UBI built (SQLite + Qdrant) | Initial single-ship architecture |
| 2026-02 | Cloud UB deployed (D1 + Vectorize) | Multi-ship requirement |
| 2026-03-01 | Cloud UB declared as single source of truth | Unify fragmented data |
| 2026-03 (planned) | Local UBI entries archived to AG library | Complete migration |
| Future | Automated D1 → R2 backup pipeline | Data safety |
Related pages
| Page | Relationship |
|---|---|
| Cloud UB MCP | Cloud UB server details |
| Local UBI MCP | Local server details |
| Backup & Recovery | Disaster recovery procedures |
| Fleet Management | Fleet architecture overview |
| UB Governance | Rules for UB data management |