$ show rsclaw-ai/rsclaw
rsclaw is a production-grade AI agent gateway and runtime written in Rust, with a React/Tauri desktop UI. It provides a local-first autonomous agent engine that routes messages through 13+ messaging channels (WeChat, Telegram, Discord, Slack, Feishu, etc.) to any of 15+ LLM providers (Anthropic, OpenAI, Gemini, Grok, DeepSeek, etc.). The core architecture is a WebSocket gateway that manages agent sessions, tool execution, memory persistence, skill invocation, and a knowledge base RAG pipeline. Key subsystems include a computer-use GUI agent (native + browser + ADB + iPhone Mirror operators), a plugin system (WASM, JS subprocess, Codex bundles), an agent-to-agent (A2A) protocol for distributed orchestration, and a three-tier memory store (redb KV + Tantivy FTS + HNSW vectors). The binary is a single compiled crate (~21MB) with no Node.js runtime dependency for the backend. The accompanying Next.js web UI and Tauri desktop shell provide a ChatGPT-like chat interface, memory management, model configuration, and computer-use overlays. While primarily an application, the knowledge base and memory subsystems incorporate significant data engineering patterns: content-aware chunking, hybrid vector/FTS search, entity extraction, and a job-based ingestion pipeline with leadership/leaderboard semantics.
The LLM identified 4 files worth highlighting for reuse:
Defines the `Operator` trait for computer-use automation with screenshot, action execution, and cursor position methods. Implementations include native desktop (enigo+display-info), browser (CDP bridge), ADB (Android), and iPhone Mirroring (macOS). The trait is isolated from the driver and can be extracted to support new automation backends with minimal changes — a clean example of strategy pattern for platform-specific GUI automation.
Provides the `Canonicalize` trait for converting binary/document formats to markdown. Concrete implementations handle PDF, Office Open XML (docx/pptx via zip XML extraction), HTML, images (OCR via a client), email/mbox, and plain text. Each handler is a standalone module that only depends on the trait's input/output types. This pattern is reusable for any document ingestion pipeline that needs format-agnostic text extraction.
Implements `ShutdownCoordinator` with atomic counters and a broadcast channel for coordinating gateway restart/drain. The RAII `InflightGuard` ensures in-flight requests complete before shutdown. The pattern is self-contained (only uses tokio and std) and can be extracted for any service that needs structured lifecycle with drain, reload, and restart semantics.
Provides a filesystem-backed artifact store for large tool outputs, with content-addressed paths, TTL-based housekeeping, and a compaction subsystem that generates previews and deduplicates blobs. The store avoids external dependencies and can be reused in any system that needs to manage large binary attachments with automatic cleanup.