Skip to main content

Multi-Agent Recursive Engineering Framework

Project description

MAREF — Agent Governance OS

Multi-Agent Recursive Engineering Framework

CI Python 3.10+ Version License Tests Coverage

全球唯一以"Agent 治理"为核心产品定位的框架。 在治理深度上碾压所有竞品(10/10 vs 0-3),将 Agent 治理作为独立的价值主张而非安全 feature。

MAREF 是 Agent 世界的操作系统内核 — 管理 Agent 集群的生命周期、安全边界、状态健康和进化方向。

核心能力

治理层 (世界领先)

  • 10 态 Gray Code 治理状态机 — 数学可证明收敛性 (6bit, 汉明距离=1)
  • TLA+ 形式化验证 — 5 定理证明 (Lyapunov收敛 + Sperner完备性)
  • CircuitBreaker — 3连败自动锁 + HALT 吸收态 + 30s 冷却
  • 四级安全决策树 — Rule→Mode→SafetyGate→User, 97% 自动化率
  • LoRA/本体双重漂移检测 — KL/JS/Hellinger 三重散度 + 人工仲裁

操作层

  • 桌面 Agent 操控 — 截图→解析→键鼠→验证 完整闭环 (macOS/Linux/Windows)
  • 多 Agent 任务编排 — TaskDAG 分解 + 5维 Agent 分发 + Saga 补偿事务
  • SubAgent 上下文隔离 — Git Worktree 式, 96% Token 节省
  • 移动→桌面任务桥接 — mDNS 发现 + 幂等任务队列 + SSE 推送
  • 浏览器安全操控 — Playwright + 安全域名白名单 + 认证会话管理

进化层

  • 递归自演进引擎 — C1(观测)→C2(优化)→C3(收敛) 三循环
  • 红蓝对抗 — 200 轮 5 阶段, 攻击强度 2.47→18.98 (7.7×)
  • 混沌工程 — 5 类 LLM 故障注入 (延迟/错误/截断/幻觉/超时)
  • 记忆三温框架 — Hot/Warm/Cold 三层记忆架构
  • Trust Engine v2 — 5 因子加权 + Goodhart 抗策略操纵检测

生态层

  • A2A/MCP 双协议 — A2A v0.3 + MCP 6 种传输
  • 跨框架适配器 — AutoGen/CrewAI/LangGraph/Dify/Coze 生产级
  • OpenTelemetry — Prometheus + Grafana + OTLP 全链路可观测
  • Serverless 运行时 — Lambda / Cloud Run 适配
  • TypeScript SDK@maref/sdk npm 包

快速开始

# 一键安装
pip install maref

# 桌面操控 (dry-run 安全模式)
maref desktop demo

# 环境诊断 (15项检查)
python scripts/check_desktop_env.py

# 治理状态查询
maref status

# 启动 Sidecar 服务
maref serve --port 8000 --gui
from maref_lite.governance import GovernanceOverlay
from maref_lite.state_machine import GovernanceState

overlay = GovernanceOverlay()
overlay._state_machine.transition(GovernanceState.OBSERVE)
overlay._state_machine.transition(GovernanceState.ANALYZE)
print(overlay.get_status())

架构

                    MAREF: Agent 治理操作系统
    ┌─────────────────────────────────────────────────────────┐
    │  应用层 ─── LangGraph / CrewAI / AutoGen / Anthropic    │
    │             (编排/操控/开发框架)                          │
    │  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─  │
    │  治理层 ─── MAREF (本框架)                               │
    │             · 状态机 · 熔断器 · 四级决策树               │
    │             · 身份/信任 · 漂移检测 · 形式化验证           │
    │  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─  │
    │  通信层 ─── A2A / MCP (Google/Anthropic 标准)            │
    └─────────────────────────────────────────────────────────┘

竞品对比

维度 MAREF Anthropic OpenAI LangGraph CrewAI AutoGen
治理/安全 10 4 3 2 1 1
形式化验证 10 0 0 0 0 0
漂移检测 9 0 0 0 0 0
桌面操控 8 9 7 0 0 0
编排 7 8 8 9 8 8
身份/信任 7 0 0 0 0 0
社区/生态 3 8 9 8 9 8

测试

类型 数量 状态
全量 4,300+
覆盖率 82%
pytest tests/ -v --cov
pytest tests/desktop/ -v    # 桌面操控测试
pytest tests/chaos/ -v       # 混沌工程

路线图

  • v0.1.0-v0.20.0: 工程基础设施 + 形式化验证 + Sidecar + 漂移 + 混沌 + A2A + Identity + 编排 + Desktop Agent → GA
  • Phase Ω (R101-R150): 50 轮自主递归演进全量补强 → v0.21.0 Final
  • v0.30.0-GA: 人机协同层 + 记忆层 + 技能市场层 + 国密 SM2/SM3/SM4-GCM + 技术白皮书
  • v1.0: 递归进化全栈 + Agent 信用评级 + 四象治理模型
  • v2.0: 元 Agent 闭包 + 碳硅共生 + 八卦治理

详见 task_plan_v0.21.0-rc_omega_50_rounds.md

许可证

Apache License 2.0 — LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maref-0.30.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maref-0.30.0-py3-none-any.whl (894.2 kB view details)

Uploaded Python 3

File details

Details for the file maref-0.30.0.tar.gz.

File metadata

  • Download URL: maref-0.30.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for maref-0.30.0.tar.gz
Algorithm Hash digest
SHA256 2baabfc1d20f89f48ffeeb8b17c9d8de57782a5f0835682fd3d6571501fb37b4
MD5 b7bc41e784cb8227e54b7c5ff7ed3052
BLAKE2b-256 fb67fe40d1fd7ae19d607dbe3c5e0f966ae24520d314ee06067f78b3b93ed847

See more details on using hashes here.

File details

Details for the file maref-0.30.0-py3-none-any.whl.

File metadata

  • Download URL: maref-0.30.0-py3-none-any.whl
  • Upload date:
  • Size: 894.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for maref-0.30.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4962b6d3543283105eb684fa55fe82fdf8aab74034a4cfe473254aa319249526
MD5 5ae2e2083a5f3845a779fe7e3cc5bfb3
BLAKE2b-256 a21bcd22cde1c6f27341e9f4f59fb427b4212fef7d79c338a1b6eb07279f157a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page