展示HN:基于模式的、基于Git的代理系统结构化状态
我研究了如何以 a) 结构化的方式存储代理状态,b) 在没有专用的 MCP 内存/状态服务器的情况下运行,并且 c) 能够清晰地记录所有状态变化的审计轨迹。经过查找,我没有找到符合这些要求的解决方案。
在 [https://github.com/commitspark/demo-agentic-mcp](https://github.com/commitspark/demo-agentic-mcp) 中,我演示了一种通过将 Claude 代理与我之前发布的 Commitspark 库及其完全基于 Git 的 GraphQL API 结合起来的实现,满足这些要求。
在演示中,模拟了两个独立的 Claude 代理,它们共同参与一个任务跟踪器。第三个代理负责审查任何任务变更,并回滚明显错误的变更。完整的演示记录包含在 README 中,包括代理的原始工具调用。
任务代理通过一个小型的 MCP 服务器访问数据,该服务器暴露了两个 Commitspark API(GraphQL API 和模式 API)。这些代理可以获取模式并编写自己的 GraphQL 调用,GraphQL 会自动确保写入的数据符合模式。此外,验证代理还可以访问基本的 Git 功能,以查看差异并回滚提交。
我特别希望得到反馈:共享代理状态的模式验证是否是人们实际面临的问题,或者松散类型的 JSON + 重试在实践中是否足够好。
查看原文
I looked into how to store agentic state in a) a structured way that b) runs without any dedicated MCP memory/state servers and where I can get c) a clear diff-able audit trail of all state changes over time. Nothing that I could find fit the bill.<p>In <a href="https://github.com/commitspark/demo-agentic-mcp" rel="nofollow">https://github.com/commitspark/demo-agentic-mcp</a> , I demo an implementation that fulfills these requirements by combining Claude agents with my previously published Commitspark library and its entirely Git-backed GraphQL API.<p>In the demo, two independent Claude agents are simulated that contribute to a task tracker. A third agent reviews any task changes and rolls back obviously bad ones. A full demo transcript is included in the README, including the agents' raw tool calls.<p>Task agent access to data happens via a small MCP server that exposes two Commitspark APIs (GraphQL API, schema API). These agents can then fetch the schema and author their own GraphQL calls, with GraphQL automatically enforcing written data is schema-conformant. The validator agent additionally has access to basic git functionality to view diffs and revert commits.<p>I'm looking for feedback specifically on: whether schema validation on shared agent state is a problem people actually have, or whether loosely-typed JSON + retries is good enough in practice.