PocketRisu is a self-hosted AI roleplay chat platform, forked from RisuAI. It runs as a Node.js server with a Svelte 5 frontend, accessed via browser. The system supports multiple AI providers (OpenAI, Anthropic, Google Gemini, etc.) through a pluggable adapter pattern, and includes character management, lorebooks, plugins, MCP (Model Context Protocol) tools, translation, TTS, image generation, and a comprehensive data-driven settings system. Data is stored in SQLite with content-defined chunking for large values, and the architecture is a monolith with a client-server split: the server handles persistence, backup, asset manifests, and model job processing; the client handles UI, state management, and direct AI API calls (with optional server-side proxy). Key entry points include src/main.ts (client bootstrap), server/node/server.cjs (server), src/ts/storage/database.svelte.ts (central store), and src/ts/process/request/ (AI request handling). External dependencies include Node.js, SQLite, various AI provider APIs, MCP servers, and browser APIs (File System Access, IndexedDB). The codebase is well-tested with unit and integration tests, and features a sophisticated plugin system with sandboxed execution, a model preset registry with remote sync, and a chat delta sync mechanism for efficient data transfer.