$ show Kochava-Studios/witsy
Witsy is a feature-rich desktop AI assistant built with Electron and Vue 3. It operates as a Bring-Your-Own-Keys (BYOK) client, aggregating dozens of LLM providers (OpenAI, Anthropic, Google, Ollama, etc.) into a unified chat, agent, and automation platform. The architecture follows a standard Electron main/renderer process split, communicating via IPC, with a Vue 3 frontend and a Node.js backend. Beyond basic chat, Witsy provides a sophisticated agent system supporting multi-step workflows, A2A communication, scheduling, and webhooks. It includes a full RAG pipeline (document ingestion, chunking, embedding, vector search), a plugin system for tools (MCP, code execution, web browsing, image generation), and extensive voice capabilities (STT/TTS with multiple providers). Data is persisted locally as JSON files within workspaces, with a vector database for semantic memory and document retrieval. A key differentiator is its automation layer, which can control the desktop (text selection, pasting, app detection) via platform-specific automators (macOS, Windows, nut-js). It exposes a local HTTP API and a CLI for external integration. The MCP (Model Context Protocol) client allows it to connect to a vast ecosystem of third-party tools. While primarily an application, it contains significant data engineering components (RAG pipeline, memory manager, deep research orchestrator) that are tightly integrated into the app's workflow. The codebase is well-structured with a strong emphasis on testing, though its massive feature surface and reliance on external APIs introduce inherent complexity and maintenance challenges.
The LLM identified 5 files worth highlighting for reuse:
Defines a clean Plugin base class and MultiToolPlugin interface. Each plugin (MCP, filesystem, search, code execution, etc.) implements isEnabled(), getName(), getDescription(), and execute(). This allows the LLM to dynamically discover and use tools. The pattern is well-isolated and could be extracted for any project needing a tool-calling LLM interface.
Implements a strategy pattern for desktop automation. The Automator interface defines actions like selectText, getSelectedText, pasteText, getForegroundApp. Platform-specific implementations (macOS via AppleScript, Windows via PowerShell/nut.js) handle the OS-specific quirks. This is a non-trivial, reusable pattern for any desktop app needing to control the native OS.
Provides a clean factory pattern (getSTTEngine, getTTSEngine) and a common interface for speech services. Each engine (OpenAI, Groq, ElevenLabs, etc.) implements transcribe(), isStreamingModel(), etc. This abstraction decouples the application logic from the specific provider, making it easy to add or swap engines. The pattern is highly reusable for any application needing multi-provider voice support.
Vue composables encapsulate reusable state and logic. useEventBus provides a simple pub/sub mechanism for inter-component communication. useExpertsMenu and useDocReposMenu encapsulate the complex state and IPC logic for managing menus. These are clean, self-contained patterns that demonstrate good Vue 3 composition API practices.
Implements an incremental parser for streaming LLM output. It breaks down the raw text stream into typed blocks (text, media, artifact, tool, search, table) and reuses stable blocks to avoid re-rendering the entire message on each chunk. This is a sophisticated, non-obvious solution to a common problem in LLM chat interfaces.