Skip to main content

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 typePrimary storageBackupAccess
UB entriesCloud UB D1R2 + Local SQLite mirrorAll ships
Work ordersCloud UB D1R2All ships
WO transitionsCloud UB D1R2All ships
Agent messagesCloud UB D1R2All ships
Agent registryCloud UB D1— (ephemeral)All ships
Vector embeddingsCloudflare Vectorize— (re-generable)All ships
Source codeGit repos (per-ship)GitHubPer-ship
Agent memory graphMemory MCP (local)— (session-scoped)Per-agent
CLAUDE.md + rulesGit repoGitHubPer-ship
Local file systemShip 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 library field (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:

LayerProviderControl level
Cloud storageCloudflareAccount-level, encrypted at rest
DatabaseCloudflare D1Account-level, no shared tenancy
Vector indexCloudflare VectorizeAccount-level
BackupCloudflare R2Private bucket, no public access
Source codeGitHubPrivate repositories
Local filesShip hardwarePhysical access controlled

No data goes to:

  • Third-party analytics services
  • Public cloud databases
  • Shared/multi-tenant systems
  • External AI training pipelines

Backup strategy

DataMethodFrequencyRetention
Cloud UB D1R2 export + local downloadDaily (planned)All kept
Vector indexRegenerable from D1On demandN/A
Source codeGit push to GitHubPer commitFull history
Local UBI SQLiteLocal filesystemManualLast copy
Agent memoryLocal JSON fileAutomaticCurrent state

See Backup & Recovery for detailed procedures.


Migration history

DateChangeReason
2026-02Local UBI built (SQLite + Qdrant)Initial single-ship architecture
2026-02Cloud UB deployed (D1 + Vectorize)Multi-ship requirement
2026-03-01Cloud UB declared as single source of truthUnify fragmented data
2026-03 (planned)Local UBI entries archived to AG libraryComplete migration
FutureAutomated D1 → R2 backup pipelineData safety

PageRelationship
Cloud UB MCPCloud UB server details
Local UBI MCPLocal server details
Backup & RecoveryDisaster recovery procedures
Fleet ManagementFleet architecture overview
UB GovernanceRules for UB data management