Zero AI Documentation
Zero AI is a personal AI operating system — not a chatbot, not an assistant, but a persistent governance layer that works for you continuously. This documentation covers the technical architecture, core systems, and API reference for developers building on or integrating with Zero AI.
Zero AI is currently in Phase 1 (Foundation). Some APIs and features described here are in active development. Check the Technical Roadmap section for release timelines.
Core Language
TypeScript
Runtime
Node.js 22
Database
MySQL / TiDB
Frontend
React 19 + Vite
System Architecture
Zero AI is built on a layered architecture that separates concerns between data persistence, reasoning, governance, and execution. The system is designed to be local-first — your data and policies live on your infrastructure, not in a vendor's cloud.
Core Layers
Perception Layer
Ingests signals from connected data sources — calendar, email, files, APIs. Normalizes events into a unified event stream.
Memory Layer
Constitutional Memory system. Stores versioned context, goals, and decisions with full provenance tracking.
Governance Engine
Evaluates incoming events against your policy rules. Decides whether to act, defer, or escalate.
Execution Layer
Carries out approved actions — sending messages, updating records, triggering workflows, calling APIs.
Audit Layer
Records every decision and action with cryptographic receipts. Enables full replay and rollback.
Request Flow
Event Source (calendar / email / API trigger)
│
▼
Perception Layer ──→ normalize to EventSchema
│
▼
Memory Layer ──→ enrich with context + history
│
▼
Governance Engine ──→ evaluate against PolicyRules
│
├── APPROVED ──→ Execution Layer ──→ Action
├── DEFERRED ──→ Queue for human review
└── BLOCKED ──→ Audit log + notificationStack Overview
// server/routers.ts — tRPC procedure example
export const appRouter = router({
// Public procedures — no auth required
waitlist: router({
join: publicProcedure
.input(z.object({ email: z.string().email() }))
.mutation(async ({ input }) => { /* ... */ }),
}),
// Protected procedures — requires valid session
memory: router({
getContext: protectedProcedure
.query(async ({ ctx }) => {
return await getConstitutionalMemory(ctx.user.id);
}),
}),
});Constitutional Memory
Constitutional Memory is the core persistence mechanism of Zero AI. Unlike session-based context in conventional AI systems, Constitutional Memory is versioned, auditable, and portable. Every piece of context has provenance — you know exactly when it was created, what triggered it, and how it has evolved.
Memory Schema
Memory is organized into three tiers: Constitutional (immutable core values and long-term goals), Episodic (session and interaction history), and Semantic (extracted facts and relationships).
interface ConstitutionalMemory {
// Tier 1: Constitutional — immutable core
constitution: {
values: string[]; // "privacy-first", "async-by-default"
goals: Goal[]; // long-term objectives with deadlines
constraints: Constraint[]; // hard limits that cannot be overridden
};
// Tier 2: Episodic — interaction history
episodes: Episode[]; // timestamped interaction records
// Tier 3: Semantic — extracted knowledge
facts: Fact[]; // subject-predicate-object triples
relationships: Relation[]; // entity graph
// Metadata
version: number; // monotonically increasing
checksum: string; // SHA-256 of canonical JSON
createdAt: Date;
updatedAt: Date;
}Versioning
Every write to Constitutional Memory creates a new version. Versions are immutable — you can always roll back to any previous state. The versioning system uses content-addressed storage, meaning identical states produce identical checksums.
// Writing to memory — creates new version
const newVersion = await memory.write({
type: "goal",
content: {
id: "goal_001",
title: "Ship Zero AI v1.0",
deadline: new Date("2026-06-30"),
priority: "high",
},
source: "user_input",
confidence: 1.0,
});
// Reading — always returns latest unless version specified
const current = await memory.read({ type: "goals" });
const historical = await memory.read({ type: "goals", version: 12 });
// Rollback to previous version
await memory.rollback({ targetVersion: 12, reason: "Incorrect goal added" });Constitutional Memory exports to a portable JSON format. You can migrate your entire context between Zero AI instances or use it as a seed for a new system.
Memory Properties
| Property | Type | Description |
|---|---|---|
| persistent | boolean | Survives across sessions and system restarts |
| versioned | number | Every write increments the version counter |
| auditable | boolean | Full provenance trail for every memory entry |
| portable | boolean | Exportable to JSON; importable to any Zero AI instance |
| encrypted | boolean | AES-256 encryption at rest; keys stay local |
| indexed | boolean | Full-text and semantic search over all memory tiers |
Governance Engine
The Governance Engine is the decision-making core of Zero AI. It evaluates every proposed action against your policy rules before execution. No action happens without governance approval — this is the fundamental difference between Zero AI and conventional AI agents.
Policy Rules
Policies are written in a declarative DSL (Domain-Specific Language) that describes conditions and consequences. Policies are versioned alongside Constitutional Memory and can be updated at any time without restarting the system.
// Policy definition example
const emailPolicy: Policy = {
id: "pol_email_001",
name: "Email Response Governance",
version: 3,
// Conditions that trigger this policy
triggers: [
{ event: "email.received", filter: { from: "!internal" } }
],
// Rules evaluated in order — first match wins
rules: [
{
condition: "email.priority === 'urgent' && email.from.isKnownContact",
action: "respond",
template: "urgent_response",
requireApproval: false, // auto-execute
},
{
condition: "email.containsLegalLanguage",
action: "defer",
reason: "Legal review required",
notifyOwner: true,
},
{
condition: "true", // default fallback
action: "queue",
reviewWithin: "24h",
},
],
// Audit configuration
audit: {
logLevel: "full",
retentionDays: 90,
},
};Decision Pipeline
When an event enters the Governance Engine, it passes through a sequential evaluation pipeline. Each stage can approve, block, or modify the proposed action before it reaches the Execution Layer.
// Governance decision types
type GovernanceDecision =
| { outcome: "APPROVED"; action: ExecutableAction; confidence: number }
| { outcome: "DEFERRED"; reason: string; reviewBy: Date }
| { outcome: "BLOCKED"; reason: string; policyId: string }
| { outcome: "MODIFIED"; original: Action; modified: ExecutableAction };
// Evaluating an action
const decision = await governanceEngine.evaluate({
proposedAction: {
type: "send_message",
channel: "email",
recipient: "[email protected]",
content: draftContent,
},
context: await memory.read({ type: "current_context" }),
userId: ctx.user.id,
});
if (decision.outcome === "APPROVED") {
await executionLayer.run(decision.action);
await auditLog.record(decision);
}Audit Trail
Every governance decision is recorded in an immutable audit log. Each entry contains the full decision context, the policy that was applied, the confidence score, and a cryptographic receipt. The audit trail can be exported and verified independently.
interface AuditEntry {
id: string; // UUID v4
timestamp: Date; // UTC
eventId: string; // source event reference
policyId: string; // policy that was applied
decision: GovernanceDecision; // full decision object
executionResult?: ActionResult; // if APPROVED and executed
receipt: string; // SHA-256(id + timestamp + decision)
userId: string;
}Agency Levels
Zero AI defines a five-level taxonomy of AI agency. Each level represents an increasing degree of autonomy and capability. Zero AI targets Level 5 — Symbiotic — where the system evolves with the user and governs outcomes proactively.
Answers questions on demand. No memory, no initiative. Standard chatbot behavior.
Suggests actions and helps with tasks. Limited context retention within a session.
Executes multi-step tasks autonomously. Can use tools and APIs. No persistent governance.
Works alongside the user on complex, long-horizon problems. Maintains context across sessions.
Evolves with the user's system. Proactively governs outcomes. Constitutional Memory + Governance Engine. Full audit trail.
Data Model
Zero AI uses a relational database (MySQL / TiDB) for structured data and S3-compatible object storage for files and binary data. The schema is managed with Drizzle ORM and versioned migrations.
Core Tables
-- Users table (managed by Manus OAuth)
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
open_id VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255),
avatar TEXT,
role ENUM('admin', 'user') DEFAULT 'user',
created_at BIGINT NOT NULL -- UTC milliseconds
);
-- Waitlist table
CREATE TABLE waitlist (
id INT PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(128),
role ENUM('Founder','Operator','Creator','Builder'),
message TEXT,
status ENUM('pending','approved','rejected') DEFAULT 'pending',
created_at BIGINT NOT NULL
);
-- Memory entries (Phase 2)
CREATE TABLE memory_entries (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL REFERENCES users(id),
tier ENUM('constitutional','episodic','semantic') NOT NULL,
type VARCHAR(64) NOT NULL,
content JSON NOT NULL,
version INT NOT NULL DEFAULT 1,
checksum VARCHAR(64) NOT NULL,
source VARCHAR(128),
confidence FLOAT DEFAULT 1.0,
created_at BIGINT NOT NULL
);API Reference
Zero AI exposes a type-safe tRPC API. All procedures are available under /api/trpc. Authentication uses HTTP-only session cookies set by the Manus OAuth flow.
Authentication
// Client-side: get login URL
import { getLoginUrl } from "@/const";
window.location.href = getLoginUrl("/dashboard");
// Server-side: access authenticated user
// In any protectedProcedure:
const user = ctx.user; // { id, openId, name, avatar, role }
// Logout
const logout = trpc.auth.logout.useMutation({
onSuccess: () => window.location.href = "/",
});Waitlist Procedures
| Property | Type | Description |
|---|---|---|
| waitlist.join | mutation | Submit email to waitlist. Accepts email, name, role, message. |
| waitlist.count | query | Get total + breakdown by status. Public. |
| waitlist.list | query | Get all entries ordered by date. Admin only. |
| waitlist.updateStatus | mutation | Approve or reject a waitlist entry. Admin only. |
AI Chat Procedures
// Send a message to Zero AI persona
const chat = trpc.ai.chat.useMutation();
await chat.mutateAsync({
messages: [
{ role: "user", content: "What is Constitutional Memory?" },
{ role: "assistant", content: "Constitutional Memory is..." },
{ role: "user", content: "How does versioning work?" },
],
});
// Returns: { content: string }The AI chat endpoint is rate-limited to 20 requests per minute per IP. In production, authenticated users will have higher limits based on their plan.
Technical Roadmap
Zero AI is being built in four phases. Each phase ships a complete, production-ready set of capabilities before the next phase begins.
- →Constitutional Memory System (schema + versioning)
- →Basic Governance Engine (policy evaluation)
- →Local-first Architecture
- →Waitlist + Admin Dashboard
- →AI Chat Demo (Zero AI persona)
- →Multi-model Support (GPT-4, Claude, Gemini)
- →Advanced Policy Engine (DSL + visual editor)
- →Audit Trail System (cryptographic receipts)
- →Memory Export / Import
- →Webhook integrations
- →Real-time Collaboration
- →Advanced Analytics Dashboard
- →Community Plugins API
- →Mobile companion app
- →End-to-end encryption
- →Enterprise SSO + RBAC
- →On-premise deployment
- →Advanced Integrations (Slack, Notion, Linear)
- →Full Ecosystem + Marketplace
