# 相关项目

多个团队独立得出同一思路——用类型化 Python 写 agent：**docstring 就是提示，签名就是契约**。

| 项目 | 共同点 | 差异 |
| --- | --- | --- |
| [**NVIDIA NOOA**](https://github.com/NVIDIA-NeMo/labs-OO-Agents) (Apache-2.0) | Agent 是 Python 对象；`...` 方法体由 LLM 实现；docstring 是提示，类型注解是契约 | 状态在 `self` 上；模型**把 Python 写进 Jupyter 式 REPL**（CodeAct）。OpenProgram 让模型**在已注册函数中选择**：动作空间更窄，更易沙箱化和回放。 |
| [**DSPy**](https://github.com/stanfordnlp/dspy) (MIT) | 类型化 **Signature** 取代手写提示 | 按指标优化提示。我们保持提示固定可读，把精力放在执行结构：DAG、重试、上下文作用域。两者互补。 |
| [**Marvin**](https://github.com/PrefectHQ/marvin) (Apache-2.0), [**Mirascope**](https://github.com/Mirascope/mirascope) (MIT) | 装饰函数的 docstring 和返回注解驱动结构化调用 | 专注单次类型化调用。OpenProgram 增加**跨**调用的部分：共享 DAG、`spawn`、分叉、单次上下文预算。 |
| [**LangGraph**](https://github.com/langchain-ai/langgraph) (MIT) | 运行应是可检查、有检查点的图 | 图要预先声明。我们的图**从调用栈记录**：写普通 Python，DAG 就是实际运行的轨迹。见[对比](https://fzkuji.github.io/OpenProgram/docs/reference/comparisons/ai-agent-frameworks.zh.html)。 |
| [**smolagents**](https://github.com/huggingface/smolagents) (Apache-2.0) | 通过代码而不是死板的工具 JSON 行动 | 在沙箱中写代码的 agent。我们在**编写**时通过 `Agent` 方法绑定代码，确定性部分在运行前可审查。 |
| **Scriptorium** | 可读的 agent 记忆；Markdown 笔记；事实引用来源消息；为 Claude Code 提供 MCP | 模型把记忆写成普通文件：可打开、diff，把每条事实追溯到消息 |

描述有误或有遗漏？请提 PR 或 issue。

## 致谢

| 项目 | 移植或改编 |
| --- | --- |
| [**OpenClaw**](https://github.com/openclaw/openclaw) (MIT) | 工具注册表结构（`name / description / parameters / execute`）、带 `check_fn` + `requires_env` 的 provider 抽象、`TOOLSETS` 预设、通过 SKILL.md frontmatter 和延迟绑定 `read` 加载 skill。克隆位于 `references/openclaw/`（已 gitignore）。 |
| [**hermes-agent**](https://github.com/himanshuishere/hermes-agent) (MIT) | `execute_code`（去掉 Docker 和 Modal 层）、`mixture_of_agents` 的起点，多 provider `web_search`、`image_generate`、`image_analyze` 的结构 |
| [**pi-coding-agent**](https://github.com/mariozechner/pi-coding-agent) (MIT) | 经 OpenClaw：AgentSkill 形式（`<available_skills>` XML、name、description、location） |
| [**Claude Code**](https://www.anthropic.com/claude-code) | `DEFAULT_TOOLS` 的使用体验（bash、read、write、edit、glob、grep、list、apply_patch、todo 面板）和 todo 工具的 JSON schema |
| **Anthropic、OpenAI、Google SDK** | 线路契约和第一方 provider 使用的流式客户端；基础依赖。CLI 和 OAuth provider 直接走 HTTP。 |

工具文件在文件级 docstring 中注明更具体的来源。MIT 组件保留 MIT 条款；合并作品按 AGPL-3.0 分发。

## 参与贡献

这是一个带参考实现的**范式提案**。欢迎讨论、其他语言的实现、验证或挑战它的用例，以及 bug 报告。环境、测试和 PR 要求见 [CONTRIBUTING.md](https://github.com/Fzkuji/OpenProgram/blob/main/.github/CONTRIBUTING.md)。
