Token导航 LogoToken导航TokenDH.com
hexswarm (Hexdaemon) logo
AI代理未说明官方级别未说明来源级核验

hexswarm (Hexdaemon)

MCP Server

Hexswarm是一个基于MCP协议的AI代理协调系统,提供共享内存、上下文丰富和基于性能的路由功能,适用于多代理协作任务。

工具数

10

提示词数

0

GitHub Stars

0

资源数

0
AI代理Python工作流自动化

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

hexdaemon

提供方

hexdaemon

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Hexswarm-代理协调协议

AI代理(Hex、Codex、Gemini)通过MCP与共享内存、上下文丰富和基于性能的路由进行通信。

建筑

┌─────────────────────────────────────────────────────────────────┐
│                         HexMem (SQLite)                          │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────────────┐ │
│  │ lessons  │  │  facts   │  │  events  │  │   performance    │ │
│  └──────────┘  └──────────┘  └──────────┘  └──────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
        ▲                ▲                ▲
        │    shared_memory.py            │
        └────────────────┼───────────────┘
                         │
┌──────────────┐    ┌────┴───────┐    ┌──────────────┐
│     Hex      │    │  Context   │    │  Smart       │
│ (orchestrator)│◄───│  Builder   │◄───│  Delegate    │
├──────────────┤    └────────────┘    └──────────────┘
│ MCP Server   │
│              │
│ MCP Client ──┼──────────────────────────────────────┐
└──────────────┘                                      │
        │                                             │
        ▼                                             ▼
┌──────────────┐                              ┌──────────────┐
│    Codex     │                              │   Gemini     │
│   (coder)    │                              │ (researcher) │
├──────────────┤                              ├──────────────┤
│  MCP Server  │                              │  MCP Server  │
└──────────────┘                              └──────────────┘

快速开始

# Smart delegate (auto-selects best agent, enriches context)
/home/sat/bin/hexswarm/bin/smart-delegate.sh auto code "refactor the storage module"

# Shorthand wrapper
hs code "refactor the storage module"
hs research "find papers on LN routing"

# Task lifecycle visibility
hexswarm-status active              # Pending/running tasks
hexswarm-status recent 10           # Last 10 tasks
hexswarm-status stats               # Performance statistics
hexswarm-status agent codex         # Tasks for specific agent

# Query swarm intelligence
/home/sat/bin/hexswarm/bin/swarm-intel.sh lessons code
/home/sat/bin/hexswarm/bin/swarm-intel.sh best research
/home/sat/bin/hexswarm/bin/swarm-intel.sh context "debug the routing issue"

# Direct MCP calls
mcporter call codex.agent_info
mcporter call hex.agent_performance action=get_stats agent_name=codex

特性

上下文丰富

委派任务时,相关上下文会从HexMem自动注入:

  • 课程我们在做类似的工作中学到了什么
  • 事实:关于任务中主题的已知信息
  • 事件:最近的相关活动
# Preview what context would be injected
/home/sat/bin/hexswarm/bin/swarm-intel.sh context "optimize channel fees"

共享内存

代理人可以分享经验教训并查询集体知识:

# Share a lesson
mcporter call hex.agent_memory action=share_lesson agent_name=codex \
  domain=code lesson="Always validate inputs" context="Found bug in API handler"

# Search lessons
mcporter call hex.agent_memory action=search_lessons query="validation"

# Get lessons by domain
mcporter call hex.agent_memory action=get_lessons domain=code

性能跟踪

跟踪哪个代理在哪些任务类型上表现最佳:

# Record performance
mcporter call hex.agent_performance action=record \
  agent_name=codex task_type=code success=true duration_seconds=45

# Get best agent for a task type
mcporter call hex.agent_performance action=best_for_task task_type=research

# View stats
mcporter call hex.agent_performance action=get_stats agent_name=codex

智能路由

smart-delegate.sh auto 根据以下因素选择最佳代理:

  1. 历史性能数据(如有)
  2. 代理配置匹配技能(关键字、域)
  3. 按任务类型默认路由(代码→法典,研究→双子座)

代理映射技能

在中配置代理首选项 config/agent-skills.json:

{
  "task_types": {
    "code": {"preferred": "codex", "fallback": "gemini"},
    "research": {"preferred": "gemini", "fallback": "codex"}
  },
  "domains": {
    "hive": {"preferred": "codex"},
    "lightning": {"preferred": "codex"},
    "papers": {"preferred": "gemini"}
  },
  "keywords": {
    "refactor": "codex",
    "research": "gemini"
  }
}

任务生命周期跟踪

所有任务都在HexMem中跟踪(hexswarm_tasks 表):

# View active tasks
hexswarm-status active

# View recent tasks with results
hexswarm-status recent 20

# View statistics
hexswarm-status stats

# View tasks for specific agent
hexswarm-status agent codex

任务状态: pendingrunningcompleted | failed

异步通知

对于基于tmux的委托,代理人会致电 notify-done.sh 完成后:

# Check for completions
/home/sat/bin/hexswarm/bin/check-completions.sh

MCP工具(每个代理11个)

工具说明
agent_info身份、能力、地位
agent_status可用性、当前任务、队列深度
submit_task提交工作(分块完成)
task_status检查任务进度
task_result获取已完成的任务输出
cancel_task取消待处理/正在运行的任务
agent_resources上下文/令牌跟踪、容量
agent_memory分享/查询经验教训、事实、背景
agent_performance跟踪/查询任务执行情况
check_notifications检查异步完成

内存操作

agent_memory 支持以下操作:

动作描述
log_event记录事件
share_fact记录事实(主谓宾语)
get_context搜索相关上下文
record_handoff记录代理间的切换
share_lesson记录吸取的教训
get_lessons按领域获取课程
search_lessons按关键字搜索课程
get_agent_lessons通过特定代理获取课程

文件结构

/home/sat/bin/hexswarm/
├── agent_mcp/
│   ├── __init__.py
│   ├── auth.py              # DID verification (stub)
│   ├── context_builder.py   # HexMem context enrichment
│   ├── notifications.py     # Async completion notifications
│   ├── protocol.py          # Task types and schemas
│   ├── resources.py         # Token/context tracking
│   ├── server.py            # Base MCP server
│   ├── shared_memory.py     # HexMem integration
│   └── storage.py           # Task persistence
├── servers/
│   ├── codex_server.py
│   ├── gemini_server.py
│   └── hex_server.py
├── bin/
│   ├── smart-delegate.sh    # Context-enriched delegation
│   ├── swarm-intel.sh       # Query swarm knowledge
│   ├── notify-done.sh       # Completion notifications
│   └── check-completions.sh # Check for notifications
└── README.md

任务存储器

~/.agent/
├── codex/tasks/{pending,running,completed,failed}/
├── gemini/tasks/{pending,running,completed,failed}/
├── hex/tasks/{pending,running,completed,failed}/
└── notifications/{pending,processed}/

代理商DIDs

代理DID
六角形did:cid:bagaaieratn3qejd6mr4y2bk3nliriafoyeftt74tkl7il6bbvakfdupahkla
食品法典委员会did:cid:bagaaierawhtwebyik523xjzhmxgfonrw56ssimutvr2surw3iypvgpjzehoa
双子座did:cid:bagaaieraafcrruni2vrpp4nmzhwpe2vnjjjuxj2lb5cew76jixjuil7fxoqa

配置

在中注册的服务器 ~/.mcporter/mcporter.json:

{
  "mcpServers": {
    "codex": {
      "type": "stdio",
      "command": "/home/sat/bin/hexswarm/bin/run-codex-server.sh",
      "env": {
        "CODEX_TASK_DIR": "/home/sat/.agent/codex/tasks",
        "CODEX_WORKDIR": "/home/sat/clawd"
      }
    }
  }
}

生态系统

Hexswarm是集成代理自治堆栈的一部分:

┌─────────────────────────────────────────────────────────────┐
│                    Agent Autonomy Stack                      │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌──────────┐   delegates   ┌──────────┐   falls back to    │
│  │ hexswarm │──────────────▶│  hexmux  │───────────────────▶│
│  │  (MCP)   │               │  (tmux)  │                    │
│  └────┬─────┘               └──────────┘                    │
│       │                                                      │
│       │ reads/writes                                         │
│       ▼                                                      │
│  ┌──────────┐                                               │
│  │  hexmem  │◀── structured memory (lessons, facts, events) │
│  │ (SQLite) │                                               │
│  └────┬─────┘                                               │
│       │                                                      │
│       │ backups, signing                                     │
│       ▼                                                      │
│  ┌──────────┐                                               │
│  │  archon  │◀── decentralized identity (DIDs, vaults)      │
│  │  (DID)   │                                               │
│  └──────────┘                                               │
│                                                              │
└─────────────────────────────────────────────────────────────┘

组件角色

组件目的GitHub
hexswarm通过MCP进行代理协调。上下文丰富、性能路由、共享内存。hexdemon/hexswarm
hexmuxTmux编排回退。适用于需要写访问权限或MCP不可用时的代理。hexdemon/hexmux
hexmem结构化存储器基板。身份、教训、事实、事件。语义搜索。hexdemon/hexmem
阿贡技能去中心化身份操作。DID、凭据、保险库备份。原型技术/代理技能

数据流

  1. 授权:通过hexswarm MCP执行十六进制任务→ 如果需要写入,则回退到hexmux(tmux)
  2. 上下文:在授权之前,hexswarm从hexmem那里吸取了相关的经验教训/事实/事件
  3. 学习:特工通过以下方式将课程记录到hexmem agent_memory 工具
  4. 身份:每个代理都有一个Archon DID,用于未来的加密身份验证
  5. 备份:hexmem备份到Archon vault以实现去中心化持久性

外部链接

目录标签

目录标签

AI代理Python工作流自动化本地部署任务协调共享内存上下文丰富性能路由

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

10

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP