sapphire-agent
A personal AI assistant agent that lives in a sapphire-workspace and talks to me through Matrix and Discord.
Status: personal project. This is something I built for my own use. It only has to work in my environment, and that is the only environment I test it in. You are welcome to use it, fork it, or send pull requests, but I am not going to maintain providers, channels, or features I do not personally use. If your use case overlaps with mine, great; if not, fork freely.
The reason this exists at all is that other agents I tried (openclaw, zeroclaw, …) either did not support what I needed, were not actually tested for the parts I cared about, or did not accept fixes. So I wrote my own. Please calibrate expectations accordingly.
What it does
- Channels: Matrix (E2EE via
matrix-sdk) and Discord (serenity), running concurrently. - Providers: Anthropic Messages API with SSE streaming and a multi-round tool-use loop, plus OpenAI-compatible backends (local LLMs, OpenRouter, …) selectable per room/session via the
[providers]/[profiles]/[room_profile]schema. - Workspace: backed by
sapphire-workspace— file index, full-text + vector search (LanceDB), git sync. - Built-in tools:
file_read,file_write,file_append,file_delete,dir_list,dir_walk,web_search,weather,shell,timer_set/timer_preset/timer_cancel/timer_status(incl. Pomodoro presets), plus workspace memory / search / sync tools. - Sessions: human-readable
grain-idaliases, auto-generated titles, history dump on resume. - Background: heartbeat cron tasks, periodic memory compaction, periodic workspace sync, daily / weekly / monthly / yearly logs with catch-up.
- Voice: optional
sapphire-call voicesatellite with local STT/TTS (viasherpa-onnx), Silero VAD, and an openWakeWord wake detector. See crates/sapphire-call. - Agent-to-agent:
/a2aendpoint speaks the v1 A2A protocol (JSON-RPCSendMessage, AgentCard) with per-profile bearer-token auth — enable via[a2a].enabled = true. - External AI integration:
/mcpendpoint publisheswrite_reportandrecall_memorytools so Claude Code (and other MCP clients) can share project context with the agent — see docs/mcp-integration.md. - Commands:
sapphire-agent— start the channel listeners + JSON-RPC HTTP control API (/rpc,/mcp,/a2a)sapphire-agent verify— validate config and report loaded workspace filessapphire-call— interactive REPL / voice satellite client (separate crate; see crates/sapphire-call)
Install
Or from source:
Configure
Copy config.example.toml to your config directory (~/.config/sapphire-agent/config.toml on Linux) and fill in the Anthropic API key, workspace path, and whichever channels you actually want.
Then:
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.