Skip to content
Furina-he
Back Home

OpenPet

2 MIT

Resident desktop AI character companion with layered Soul / Body / Voice architecture

TypeScript Electron Vue 3 Three-VRM Pixi SQLite WAL Zod MCP

Shipped Interface & Artifact Gallery

OpenPet desktop stage pairing the Hub console with the transparent always-on-top VRM desktop companion
OpenPet desktop stage pairing the Hub console with the transparent always-on-top VRM desktop companion

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

Guaranteed by Design
Guaranteed by Design Configs, chats, memory wiki, characters, and RAG vectors stay local-first — the memory folder opens directly as an Obsidian vault
Explicitly Out of Scope Desktop runtime currently focuses on Windows 10/11; macOS and Linux support remains on the roadmap
Guaranteed by Design Desktop plugins run in per-plugin worker sandboxes with explicit permission gates, and MCP tools pass through authorization checks
Explicitly Out of Scope LLM inference and TTS/ASR rely on user-configured local or cloud providers (OpenAI, Anthropic, Gemini, Ollama, etc.)

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.

Deep-Dive Engineering Note · Read note

CloudLink

Local infrastructure switchboard & live command guardrail for AI coding agents

Continue to Next Project