OpenPet
2 MITResident desktop AI character companion with layered Soul / Body / Voice architecture
Shipped Interface & Artifact Gallery
Why This Exists
Most desktop AI assistants are thin webview wrappers around a text box, while classic desktop pets lack real memory, tools, and multi-provider intelligence. OpenPet cleanly separates Soul (how a character thinks and speaks), Body (how it moves), and Voice (how it sounds).
Anchored on a single Zod source of truth in packages/protocol, swapping between VRM 3D, Live2D, and 2D frame-atlas bodies preserves character identity, sessions, and long-term Markdown memory untouched, while isolated worker threads keep rendering smooth and secrets safely separated.
Architecture & Key Trade-Offs
Single Source of Truth in packages/protocol
Local IPC uses JSON-RPC 2.0, LLM output uses inline streaming behavior tags, and plugins use @openpet/plugin-sdk. All schemas plus .dssoul / .dsbody boundaries live in packages/protocol with Zod validation shared across Main, Renderer, and Workers.
Thin Main Process & Crash-Supervised Workers
Renderers run with sandbox and contextIsolation enabled, keeping the character window a pure presentation player. LLM providers, plugins, and MCP servers execute in isolated workers/subprocesses with exponential-backoff supervision and zero secret leakage into plugin workers.
Dual-Track Streaming Pipeline & Local-First Memory Wiki
ContextPipeline retrieves SQLite RAG vectors, memory wiki notes, worldbook entries, and summaries in parallel. Streaming tokens split cleanly into bubble text and real-time character cues, with post-turn memory consolidation persisted locally to SQLite WAL and Markdown.
Honest Engineering Boundaries
Decoupling Soul, Body, and Voice: Multi-Process Architecture for a Desktop AI Companion
How OpenPet separates character identity from rendering engines using a single Zod protocol, sandboxed Electron processes, incremental streaming behavior parsing, and an Obsidian-compatible memory wiki.
CloudLink
Local infrastructure switchboard & live command guardrail for AI coding agents