Home/Docs/Getting Started/ContextUnity Manifesto

ContextUnity ManifestoπŸ”—

An open R&D and application platform for building sovereign, zero-trust AI systems β€” free from cloud provider dependencies and vendor lock-in.

PrefaceπŸ”—

ContextUnity is an R&D and production platform engineered for teams building real AI applications that they fully own and control. Rather than another thin wrapper around hosted LLM APIs, it provides a modular AI service mesh where agents plan, execute, verify, document, and learn under fail-closed security boundaries.

Managed black-box agent platforms lock teams into single cloud vendors, burn tokens on every loop, and strip away data and infrastructure ownership. ContextUnity is built so you can run your own applications on local hardware, private servers, or any cloud of your choice β€” with zero cloud provider lock-in and zero vendor lock-in. Several domain products are already in active development on top of ContextUnity.

This document separates what is on the planned iterative engineering track (0.6 β†’ 0.14) from the long-term evolutionary horizon (0.15+).


1. Fundamental PrinciplesπŸ”—

  • Universal Protocol: All service-to-service communication flows over gRPC using a single typed ContextUnit envelope (ADR-0001).
  • Zero-Trust Security: No agent holds ambient privileges. ContextToken credentials undergo dynamic Capability Stripping (Attenuation) before every node execution (ADR-0017); a child token can never widen its parent's permissions.
  • Inversion of Control (Federated Execution): The platform never steals application database credentials. Agents emit typed intents while consumer projects execute @federated_tool handlers inside their own perimeters over bidirectional gRPC streams.
  • Pass-by-Reference: Rather than shuffling megabytes of raw prompts between services, ContextUnit carries lightweight UUID pointers to canonical records (ADR-0004).
  • Manifest-First Architecture: Projects integrate via a single declarative contextunity.project.yaml without boilerplate orchestration glue (ADR-0002).

Part I β€” Planned Iterative Track (0.6 β†’ 0.14)πŸ”—

Everything in Part I maps directly to the Platform Roadmap (0.6 β†’ 0.14).

2. Flat Hybrid Memory (ContextBrain)πŸ”—

ContextBrain unifies transport pointers, working memory, and long-term experience into a graph-first, vector-fallback store (ADR-0011, ADR-0018):

  • Blackboard: Run-scoped coordination scratchpad for active plans, handoffs, and receipts.
  • BrainCell: Atomic, versioned knowledge units with provenance, tenant isolation, and decay policies.
  • CellEdges: Explicit relational, causal, and dependency edges traversed first for exact multi-hop recall.
  • BrainSynapse (Q-Learning): Outcome observations from FinalVerdict adjust edge weights over time so proven paths rise and noisy ones prune.
  • BrainEngram (Vector Fallback): pgvector semantic index activated when graph traversal falls below coverage threshold, paired with background consolidation.

Multi-tenancy is enforced at the database kernel via PostgreSQL Row-Level Security (RLS) on tenant_id.

3. Stateless Orchestration (ContextRouter) & Durable Execution (ContextWorker)πŸ”—

  • Stateless LangGraph 1.2 DAGs: ContextRouter compiles contextunity.project.yaml into runnable graphs with per-node model policies, automatic fallback chains, and tool contracts.
  • Unified PATH L / PATH T (ADR-0016): ContextWorker runs identical workflow definitions on local async runners (PATH L) for laptop/CI speed and on Temporal Server (PATH T) for durable timers, heartbeats, and crash recovery.
  • Contract-Enforced Safety: Destructive actions require explicit upstream proof pointers (e.g., a Shield clearance ID or encrypted offload pointer per ADR-0015) in their Pydantic tool schema so an LLM cannot bypass verification steps.

4. Defense-in-Depth (ContextShield) & PrivacyπŸ”—

  1. Token Attenuation: TokenBuilder strips scopes per LangGraph node before execution.
  2. gRPC Permission Interceptors: Fail-closed scope enforcement on every RPC boundary.
  3. AI Firewall & Prompt Vault: Canonical prompts and secrets remain in Shield; Router performs controlled pre-LLM PII masking.
  4. PostgreSQL RLS: Kernel-level tenant isolation even if upstream layers fail.
  5. Ephemeral Sandboxes: Generated or untrusted code runs in isolated sandboxes with restricted network and filesystem access.

5. Read-Only Observability (ContextForge)πŸ”—

ContextForge unifies operational visibility into a single read-only Django + HTMX console:

  • Trace & Graph Journey: Inspect ContextUnit execution, pointer dereferencing, and memory recall paths without mutating production control planes.
  • Human-in-the-Loop (HITL) Review Queues: High-risk actions pause for explicit operator approval and emit ReportOutcomeObservation back to ContextBrain.
  • ForgeLibrarian & Lab Mode: Continuous architecture diagnostics and side-by-side workflow replay.

6. Graceful Degradation: Laptop to ClusterπŸ”—

ComponentProduction ClusterLocal Loopback
ContextBrainPostgreSQL + pgvectorSQLite
Service RegistryRedisIn-Memory
ContextWorkerTemporal (PATH T)Async Runner (PATH L)
TransportgRPC + mTLSLocal loopback / in-process

Part II β€” Evolutionary Horizon (0.15+)πŸ”—

The capabilities below represent long-term research and decentralized ecosystem evolution beyond the 0.6 β†’ 0.14 foundation.

7. Teacher–Student Loops & LoRA Hot-SwappingπŸ”—

  • Golden Trajectory Distillation: ContextWorker scans high-Q-value trajectories to curate compact tool-calling datasets.
  • Unsloth + Local Fine-Tuning: Lightweight LoRA adapters train inside ephemeral sandboxes and register in ContextBrain.
  • Dynamic Hot-Swapping & Auto-Fallback: Router routes routine tasks to specialized local adapters and falls back to frontier models on uncertainty, feeding new successes back into the training loop.

8. Deep Archive & CRDT SynchronizationπŸ”—

  • Cold Storage: Continuous WAL archiving (Point-in-Time Recovery) and client-side encrypted backups to S3/R2.
  • Differential Sync & CRDTs: Conflict-free state replication across edge nodes with offline Worker buffers.

9. Federated P2P Mesh & ContextSeedπŸ”—

  • Signed ContextSeed Packages: Verified BrainCells, procedures, and capabilities packaged into cryptographically signed, portable seeds without leaking raw tenant conversations.
  • Edge Federation & Zero-DNS Gossip: WireGuard-backed peer nodes sharing verified knowledge under local Shield policy validation.
  • Immune Node Isolation: Instant Ed25519 certificate revocation across the mesh when anomalies are detected.

10. M2M Economy & Autonomous Geo-DeploymentπŸ”—

  • Shield-Governed Wallets & Temporal Escrow: Agents hire external specialist agents via escrow workflows (HireExternalAgentWorkflow), releasing funds only after automated verdict validation.
  • Experience Tokenization: High-Q-value strategies and adapters packaged as reusable ecosystem artifacts.

11. Vision: Sovereign Foundation for AI ApplicationsπŸ”—

ContextUnity is an open R&D and application core (Core, Router, Brain, Worker, Shield, Forge, CLI, Django) around which teams and the community build domain extensions, manifests, and products β€” with several real-world products already in active development on top of the platform:

  • For a solo developer: Install contextunity-cli, write a YAML manifest, and run locally on your own hardware with zero cloud dependencies.
  • For a product team: Switch configuration to your own PostgreSQL, Redis, Temporal, and Shield enforcement β€” no vendor lock-in, full sovereignty over data and models.
  • For the open ecosystem: Sovereign installations that retain 100% data ownership while selectively exchanging verified engineering memory.