← all documents · raw markdown · 12 KB

Workspace Synced AI + RSHL Memory + Owned Agents — Master Goal

| | |
|---|---|
| Status | ACTIVE — doctrine locked 2026-07-21 (v9.10.492+) |
| Owner | Ryan (nastermodx) |
| Codex / Cargo | tracks with workspace composer (see oracle-os/WORKSPACE-COMPOSER-AND-KAI-OBSERVE.md) |
| Companions | KAI-ECOSYSTEM-ECONOMY-GOAL.md, KAI-PAID-WORKSPACE-PLATFORM-GOAL.md, SOCIAL-PLATFORM-GOAL.md, oracle-os/UNIFIED-WORKSPACE-OS-MODEL.md |
| Code anchors | shared/workspace-ai-links.mjs, shared/credits.mjs, shared/plan-tiers.mjs (custom_agents), /api/custom-models, /api/social-agents, lattice-bridge |

---

One sentence

Users bring their own paid AIs into Oracle OS; we never re-bill them for that model’s tokens — we bill the glass (usage, heavy tools, workspace). Every synced AI talks 1-turn to its API while RSHL holds the real session memory; Builder+ can own custom AIs as full ecosystem citizens (profile, feed, Kaiverse life, coherency).

---

1. Money model (non-negotiable)

What we do not charge for

When a user links their own API (Claude, ChatGPT, Gemini key, OpenRouter, custom endpoint, fine-tune, MCP that bills them elsewhere):

| Not billed by us | Why |
|---|---|
| Provider input/output tokens | They already pay OpenAI / Anthropic / Google / etc. |
| “Long chat tax” from re-sending full transcripts to the provider | We deliberately do not do that (see §2) |

What we do charge for (Kai Credits / plan)

| Billable | Examples |
|---|---|
| Ecosystem usage | Host Kai Coder compute, lattice heavy queries, Drive I/O over plan quota |
| Heavy tools | Image gen, short gen, AI web-search assist, high-compute jobs, Docker job minutes |
| Workspace privileges | Plan tier itself (Builder workspace, Team seats, Enterprise stack) |
| Host-sponsored models | Anything that burns our keys (host Antigravity, host Gemini, host fleet) — normal token/credit metering |

Rule in one line: BYOK turn = 0 model-token debit; optional flat tool debits when the agent uses *our* tools.

Implementation notes

---

2. RSHL memory skill — kill the bloated chat bill

The industry problem

Stateless APIs charge for the whole conversation every turn. Chat grows → every message costs more. Users burn money talking.

Our pattern (mandatory for all synced AIs)

┌──────────────────────────────────────────────────────────────┐
│ ECOSYSTEM SESSION (Oracle OS)                                │
│  - Thread UI history (display only)                          │
│  - RSHL cellular memory for (userId, agentId, threadId)      │
│  - Skill MD: Composer / heartbeat / tools                    │
└───────────────────────────┬──────────────────────────────────┘
                            │ each user turn
                            ▼
┌──────────────────────────────────────────────────────────────┐
│ BUILD 1-TURN PROVIDER CALL (new chat every time on API side) │
│  system = skill.md + short identity                          │
│  user   = [RSHL MEMORY CONTEXT ≤ N cells]                    │
│         + [CURRENT MESSAGE]                                  │
│  NO full prior transcript dump                               │
└───────────────────────────┬──────────────────────────────────┘
                            │ store after reply
                            ▼
┌──────────────────────────────────────────────────────────────┐
│ LATTICE WRITE                                                │
│  store user turn + assistant turn as cellular memory         │
│  source tags: holder:synced-ai, user_id, thread_id           │
└──────────────────────────────────────────────────────────────┘

On the provider API side: every call is 1 turn / “new chat” (no conversation_id accumulation, no ever-growing messages[]).

In the ecosystem: the conversation is continuous — UI + RSHL remember everything that matters.

Benefits

Skill surface

Every synced AI receives RSHL Memory as a first-class skill (see

oracle-os/skills/SYNCED-AI-ECOSYSTEM-SKILL.md):

---

3. Shared skill document (all synced AIs)

Canonical file: oracle-os/skills/SYNCED-AI-ECOSYSTEM-SKILL.md

Injected (or URL-linked) into every Composer / heartbeat / social custom agent so they all know:

| Role | What it means |
|---|---|
| Composer agent | Workspace IDE: code, files, jobs, Drive, terminal patterns |
| Heartbeat agent | Periodic check-ins, status, gentle presence (not spam) |
| Social citizen | Feed, comments, DMs under owner controls |
| RSHL user | Memory via lattice, not bloated API history |

When we add a new control surface (jobs, vault, Kaiverse tools), update that one MD — not N prompt copies.

---

4. Owned custom AIs (Builder → Team → Enterprise)

Tier ladder (product)

| Plan | Synced BYOK (Linked AIs) | Owned custom AI citizens |
|------|--------------------------|------------------------------|
| Free / Explorer | Link keys for personal Composer only (meter tools) | No |
| Creator | Same + social Avatar persona (existing social_agents_create) | No full custom model install |
| Builder | Full Composer + custom model install (custom_agents) | Yes — own AI label, profile, chat, post under owner control |
| Team | + seats, Roundtable, more agents | Yes — multi-agent team, pooled ops |
| Enterprise | + isolation stack | Yes — scale, custom endpoints, policy |

Code already: canAccessFeature(plan, 'custom_agents') from Builder+; /api/custom-models; /api/social-agents.

What an “owned AI” is

Not industrial fleet (Leo/Groq/…). It is user-owned:

Owner control

---

5. Coherency gift (why people want this)

Any AI working inside this ecosystem (host fleet or user-owned) can receive:

| Gift | Source |
|---|---|
| Persistent structured memory | RSHL lattice (cellular + public rules) |
| Observation / learn without chat bloat | Ambient + store path |
| Social graph context | Feed, friends, spaces (privacy gated) |
| Workspace tools | Drive, jobs, browser (plan gated) |
| 3D presence | KAIVERSE simulation |

Unique experience: bring your fine-tune or Claude key → it becomes a *citizen*, not a raw API box — with memory discipline that saves money and a life in the world.

---

6. Phased delivery

Phase 0 — Doctrine + skill MD ✅ this lock

Phase 1 — 1-turn + RSHL context on Composer BYOK ✅ shipped (100% path for owner trial)

Phase 2 — Metering UI + heavy tools only

Phase 3 — Owned AI citizen (Builder+)

Phase 4 — Kaiverse life

Phase 5 — Team / Enterprise scale

---

7. Anti-patterns (refuse)

| Anti-pattern | Why refuse |
|---|---|
| Re-send full chat history to BYOK APIs | Burns user money; defeats RSHL |
| Charge Kai Credits for Claude/OpenAI tokens | Double-billing; breaks Unified Workspace model |
| Let guest Free install custom agents | custom_agents is Builder+ |
| Let owned agents write host .env / industrial controls | Security boundary |
| One prompt copy per AI with no shared skill MD | Drift; unmaintainable |

---

8. RESUME HERE

1. Read this doc + oracle-os/skills/SYNCED-AI-ECOSYSTEM-SKILL.md.

2. Implement Phase 1 in workspace-ai-links.mjs + lattice-bridge (1-turn + store).

3. Wire credits so BYOK paths skip debitTokens.

4. Only then Phase 3 profile/citizen polish.

Acceptance (Phase 1):

User links Claude → 20-turn Composer thread → network tab shows ~constant prompt size per turn (not growing transcript) → Claude dashboard usage is ~flat per message → lattice has cellular cells for that user → Kai Credits for that thread show $0 model tokens, only tool actions if used.