hive-exp
An MCP server enabling AI agents to record, query, and share structured problem-solving experiences with human review and confidence decay.
README
hive-exp
AI Agent Experience Management System — structured, cross-agent, human-reviewed knowledge for your AI tools.
<p align="center"> <strong>English</strong> | <a href="README_CN.md">简体中文</a> </p>
What is hive-exp?
When an AI agent solves a non-trivial problem — a TypeScript compiler error, a broken build, a failing test — the solution disappears the moment the session ends. The next time the same error appears (in a different project, by a different agent, even by the same agent tomorrow), the work starts from zero. hive-exp fixes this by recording experiences: structured JSON objects with a canonical signal → strategy → outcome shape, persisted locally and queryable in milliseconds.
Knowledge does not stay siloed per-agent. Because hive-exp speaks the Model Context Protocol (MCP), Claude Code, Codex, Gemini CLI, Cursor, and Windsurf all read and write the same experience store. An experience recorded by Claude Code while fixing a TypeScript path alias issue is immediately available to Codex the next time it encounters the same signal. The experience store is a shared brain, not a per-agent scratch pad.
Humans stay in the loop. Experiences start as provisional and can only be promoted to the trusted zone by an explicit human action — via the CLI or the dashboard. Confidence decays over time using an exponential half-life model; experiences that accumulate consecutive failures or go 30 days without a single reference are auto-archived. The dashboard gives you a live view of every experience, its current confidence, and its usage statistics.
Quick Start
# Install CLI globally
npm install -g hive-exp
# Initialize for your AI agents (auto-detects installed agents)
hive-exp init --force
# Or run the MCP server directly
npx @hive-exp/mcp
Agent Configuration
hive-exp init --force writes the correct snippet automatically. To configure manually:
Claude Code — ~/.mcp.json
{
"mcpServers": {
"hive-exp": {
"command": "npx",
"args": ["-y", "@hive-exp/mcp"]
}
}
}
Codex — ~/.codex/config.toml
[mcp_servers.hive-exp]
type = "stdio"
command = "npx"
args = ["-y", "@hive-exp/mcp"]
Gemini CLI — ~/.gemini/mcp.json
{
"mcpServers": {
"hive-exp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@hive-exp/mcp"],
"env": {}
}
}
}
Antigravity — ~/.gemini/antigravity/mcp_config.json
{
"mcpServers": {
"hive-exp": {
"command": "npx",
"args": ["-y", "@hive-exp/mcp"]
}
}
}
Cursor — .cursor/mcp.json
{
"hive-exp": {
"command": "npx",
"args": ["-y", "@hive-exp/mcp"]
}
}
Windsurf — .windsurf/mcp.json
{
"hive-exp": {
"command": "npx",
"args": ["-y", "@hive-exp/mcp"]
}
}
CLI Commands
| Command | Description |
|---|---|
hive-exp init [--force] [--agent <type>] |
Auto-detect AI agents and write MCP configuration |
hive-exp add [--file <path>] [--signals ...] [--strategy <name>] |
Add a new experience record |
hive-exp validate <path> |
Validate an experience JSON file against the schema |
hive-exp sign <path> [--secret <secret>] |
Sign an experience file with HMAC-SHA256 |
hive-exp query [--signal] [--strategy] [--scope] [--limit] [--format] |
Query experiences by signal, strategy, or scope |
hive-exp promote <exp_id> [--confirm] |
Promote an experience to the trusted zone (human confirmation required) |
hive-exp archive <exp_id> [--reason] |
Archive an experience (soft delete) |
hive-exp stats [--type] [--format] |
Show strategy statistics and experience health overview |
hive-exp replay [--from <date>] [--verbose] |
Rebuild SQLite projection from the event log |
hive-exp export [--format] [--min-confidence] [--scope] [--agent] [--promoted-only] [--output] |
Export experiences for RAG or external consumption |
MCP Tools
The MCP server exposes five tools to connected agents:
| Tool | Description |
|---|---|
hive_exp_query |
Search for experiences matching error signals; returns strategies ranked by success rate and confidence |
hive_exp_record |
Record a new experience after successfully solving a non-trivial problem |
hive_exp_outcome |
Record the outcome after applying a strategy from a queried experience |
hive_exp_stats |
Get strategy statistics and experience health overview (overview, strategy_ranking, at_risk) |
hive_exp_promote |
Propose promoting an experience to the trusted zone (sets pending_promotion; actual promotion requires human confirmation) |
Dashboard
# Start the dashboard (requires the CLI to be installed)
hive-exp dashboard
# Or start directly from source
npx tsx apps/dashboard/src/server.ts
The dashboard runs at http://localhost:3333 and shows all experiences, their current confidence scores, usage statistics, and a promotion queue for human review.
Architecture
packages/core/ — Core library (schema, events, signer, sanitizer, consensus, cron)
packages/mcp/ — MCP Server (5 tools, stdio transport, zero external dependencies)
packages/signer-ed25519/ — Optional Ed25519 signer (drop-in replacement for HMAC-SHA256)
apps/cli/ — CLI tool (10 commands)
apps/dashboard/ — Web dashboard (Express + HTML/CSS/JS)
hooks/ — Claude Code PostToolUse hook (signal-detector.py)
Data is stored under ~/.hive-exp/ by default:
~/.hive-exp/
├── experiences/
│ ├── provisional/ — New, unreviewed experiences
│ ├── promoted/ — Human-confirmed trusted experiences
│ ├── archived/ — Auto-archived (zero-ref, low-confidence, consecutive fail)
│ └── superseded/ — Dedup-superseded experiences (backup)
├── events/ — Append-only JSONL event log (yyyy-mm.jsonl)
├── db.sqlite — SQLite projection for fast queries
└── signal-conventions.yaml
How It Compares
| Feature | hive-exp | Mem0 | Letta | Vector DB |
|---|---|---|---|---|
| Structured signal→strategy→outcome | Yes | No (free-form text) | No | No |
| Multi-agent cross-vendor sharing | Yes | No | No | No |
| Human-in-the-loop promotion | Yes | No | Limited | No |
| MCP native (zero adapter code) | Yes | No | No | No |
| Confidence decay + auto-archival | Yes | No | No | No |
| Zero external dependencies (no Docker/Postgres/Neo4j) | Yes | No | No | No |
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.
Python SDK coming soon.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。