Open-source agent infrastructure that gives an AI assistant persistent memory, scheduled tasks, and messaging channels like Telegram and Lark.
cosmicstack-labs/mercury-agent
Self-hosted AI agent with local memory, permission-gated tools, and access from CLI, Telegram, Discord or Slack.
- Stars
- 3,882
- Forks
- 398
- Open issues
- 20
- Last commit
- 7 hours ago
What is it?
Mercury Agent is a TypeScript AI agent that runs as a single background process on your own machine — macOS, Linux, Windows, or Android via Termux. It installs as a login service, restarts after a crash, and serves the same agent and the same memory whether you reach it from the terminal UI, Telegram, Discord, Slack, Signal, or a local web dashboard bound to 127.0.0.1.
What it adds around the usual file, shell, and web tools is governance: a non-overridable shell blocklist, per-folder read and write scopes, approval prompts, SSRF-guarded fetches, and secret redaction in logs. The Second Brain stores typed, deduplicated facts in a local SQLite database with full-text search and recalls relevant ones before each answer, while a daily token budget caps every turn. Providers including DeepSeek, OpenAI, Anthropic, Ollama, LM Studio, and any OpenAI-compatible endpoint are tried with fallback.
Two modes extend the core: Mercury Code plans and builds inside a repository and only reports a task complete when a build, test, or typecheck passes, and Mercury Bots are persistent specialists with their own persona, permissions, and budget that run on schedules and deliver finished files to a local folder. Around 50 tools ship built in, plus installable community skills and a cron-style scheduler.
Key features
- 01Permissions layer with a fixed shell blocklist, per-folder read/write scopes, per-session Ask Me or Allow All modes, and SSRF-guarded URL fetching.
- 02Second Brain memory: ten fact types extracted automatically into a local SQLite database with full-text search, hourly consolidation, and `/memory` inspection.
- 03Multi-channel access to one runtime from terminal UI, Telegram, Discord, Slack, Signal, and a localhost web dashboard with chat, Kanban, and bot cockpit.
- 04Mercury Code works in a repository with a live plan and marks tasks done only after a build, test, or typecheck passes.
- 05Mercury Bots run as persistent scheduled specialists, solo or as fleets with delegated tasks, per-bot budgets, and file deliverables.
- 06Provider fallback across DeepSeek, OpenAI, Anthropic, Grok, Ollama, LM Studio, and any OpenAI-compatible endpoint, plus a daily token budget with Token Saver mode.
- 07About 50 built-in tools covering files, shell, git, GitHub, scheduling, sub-agents, and Spotify, with installable skills from skills.mercuryagent.sh.
Use cases
- Running a personal assistant that keeps its memory and keeps working after you close the laptop.
- Letting an agent edit code in a repository with approval prompts and verification before it reports success.
- Reaching one agent from a shared Telegram or Discord channel with role-scoped access for admins and members.
- Scheduling recurring research or report jobs that deliver files to a local folder or chat.
- Keeping prompts, keys, and conversation data on your own disk instead of a hosted service.
Quick start
- 1
Install via npm (Node.js 22+)
npm i -g @cosmicstack/mercury-agent - 2
Run Mercury and complete the setup wizard
mercury
Things to know
- Install scripts are piped from the web, so the one-line installer requires trusting an external script.
- Community skills are not audited and should be reviewed before installing.
- Full use needs API keys for an LLM provider or a Mercury Cloud account.
In collections
Topics
FAQ
- What is mercury-agent?
- Self-hosted AI agent with local memory, permission-gated tools, and access from CLI, Telegram, Discord or Slack. Mercury Agent is a TypeScript AI agent that runs as a single background process on your own machine — macOS, Linux, Windows, or Android via Termux. It installs as a login service, restarts after a crash, and serves the same agent and the same memory whether you reach it from the terminal UI, Telegram, Discord, Slack, Signal, or a local web dashboard bound to 127.0.0.1.
- Is mercury-agent free to use? What license does it have?
- mercury-agent is open source under the MIT license. Check the license terms before using it in commercial products.
- Is mercury-agent still maintained?
- Actively maintained. The last commit to mercury-agent was on Nov 7, 2026.
- What can I use mercury-agent for?
- Running a personal assistant that keeps its memory and keeps working after you close the laptop. Letting an agent edit code in a repository with approval prompts and verification before it reports success. Reaching one agent from a shared Telegram or Discord channel with role-scoped access for admins and members. Scheduling recurring research or report jobs that deliver files to a local folder or chat. Keeping prompts, keys, and conversation data on your own disk instead of a hosted service.
- How do I install mercury-agent?
- Install via npm (Node.js 22+): npm i -g @cosmicstack/mercury-agent Run Mercury and complete the setup wizard: mercury
- Where can I get mercury-agent?
- The source code and installation instructions are on GitHub: https://github.com/cosmicstack-labs/mercury-agent
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A self-hosted personal AI assistant with visible memory and a Pi coding-agent workspace, reachable from browsers, phones and WeChat.
Self-hosted, multi-user AI agent platform where teams share domain-specific agents reachable from Telegram, Discord, Feishu and other chat tools.
A local-first personal AI assistant in readable Python, with its own agent loop, SQLite-based memory, and built-in evals.
Self-hosted, privacy-first personal AI assistant platform with autonomous agents, 250+ tools, MCP support, and Telegram and WhatsApp connectivity.
A self-hosted personal AI assistant that answers over WhatsApp, Telegram, Signal, or iMessage using Claude, with memory, reminders, and 500+ app integrations.