8000 GitHub - alazycat/Daedalus: "AI Agent Harness in Rust — TAOR loop, MCP, Auto Memory, self-evolving Skills, multi-provider" · GitHub
[go: up one dir, main page]

Skip to content
alazycatPublic

About

"AI Agent Harness in Rust — TAOR loop, MCP, Auto Memory, self-evolving Skills, multi-provider"

Resources

Contributing 8000

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Daedalus — AI Agent Harness

License Rust Tests

基于 Harness Engineering 理念构建的 Rust AI Agent 框架。参考 Agent-Harness-Develop-Book,将"用确定性代码约束非确定性模型输出"这个核心原则落地为可运行的工程系统。

特性

  • TAOR 循环: Think → Act → Observe → Reflect 状态机,支持并行工具执行
  • 多 Provider: Anthropic / DeepSeek / OpenAI 兼容 / Ollama
  • 7 内置工具: read_file, write_file, edit_file, bash, grep, explore (SubAgent)
  • MCP 集成: Model Context Protocol stdio 客户端,支持外部工具服务器
  • Auto Memory: 跨会话记忆(4 类:用户/反馈/项目/参考),会话结束自动提取
  • Skill 系统: 从任务中学习可复用工作流,信任引擎自动创建,越用越聪明
  • 上下文压缩: OutputManager 统一截断,轮次折叠,上下文不溢出
  • 安全引擎: Bash 三态权限(deny / ask / allow),可配置规则,/permit 管理
  • 会话持久化: JSON 保存/恢复,/sessions 历史列表,--resume 恢复
  • 首次向导: 零配置启动,交互式选择 Provider 和 API Key
  • 预置 Skill: 3 个 Rust 编程 Skill 开箱即用
  • 指数退避: Provider 错误自动重试(1s→2s→4s),友好中文错误
  • 跨平台: Windows / Linux / macOS 预编译二进制

安装

下载预编译二进制

从 GitHub Releases 下载。

从源码编译

git clone https://github.com/xxx/daedalus.git
cd daedalus
cargo build --release

需要 Rust 1.96+ (Edition 2024)。

快速开始

./target/release/daedalus

首次运行启动配置向导,选择 Provider 并输入 API Key。之后直接运行即可。

配置

所有配置在 .daedalus/config.toml:

[provider]
type = "openai_compat"
model = "deepseek-chat"
base_url = "https://api.deepseek.com/v1"
max_tokens = 8192

[loop]
max_turns = 0  # 0 = unlimited, context-window-driven

API Key: 设置环境变量 DEEPSEEK_API_KEY / ANTHROPIC_API_KEY / OPENAI_API_KEY,或通用 DAEDALUS_PROVIDER_API_KEY.

MCP 工具

在 .daedalus/mcp.toml 配置外部工具服务器:

[[servers]]
name = "filesystem"
command = "npx"
args = ["-y", "@anthropic/mcp-server-filesystem", "/tmp"]

启动时自动连接并注册为 mcp.filesystem.* 系列工具。

命令

/exit    — 退出(自动保存 session + Auto Memory)
/clear   — 清空对话历史
/status  — 显示运行状态
/skills  — 列出已学习的 Skill
/sessions — 列出已保存的会话
/resume  — 恢复最近会话(或 --resume 参数)
/permit  — 管理 Bash 权限规则
/help    — 显示帮助

Skill 系统

从任务中学习可复用工作流。预置 3 个 Rust Skill,Agent 每 ~10 轮自动建议创建新 Skill。信任达标后自动创建。

/skill auto on 开启自动创建。

架构

推理与编排层   → AgentLoop TAOR + ExploreTool SubAgent
上下文与记忆层 → SystemPrompt + MEMORY.md + Skills + OutputManager + Pruning
工具与安全执行层 → 7 Tools + MCP + Bash Permissions (deny/ask/allow)
支撑层        → tokio + reqwest + tracing + CI + Session + Startup check

参考书的四层架构完整实现。

许可证

Apache-2.0 © 2026 Daedalus Authors

About

"AI Agent Harness in Rust — TAOR loop, MCP, Auto Memory, self-evolving Skills, multi-provider"

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0