显示HN:Agent Kernel – 三个Markdown文件让任何AI代理具有状态。
Show HN: Agent Kernel – Three Markdown files that make any AI agent stateful

原始链接: https://github.com/oguzbilgic/agent-kernel

## 代理内核:简单、有状态的 AI 代理 代理内核提供了一种非常简单的方式来构建持久的 AI 代理,只需三个 markdown 文件和一个 Git 仓库,无需复杂的框架或数据库。它适用于流行的 AI 编码代理,如 OpenCode、Claude 和 Codex。 流程很简单:克隆仓库,选择你的代理(例如 `opencode`),并定义其身份。然后,代理通过两个关键目录管理其自身的记忆:`knowledge/` 用于当前事实(状态),`notes/` 用于会话日志(叙述)。 该系统利用现有的代理指令文件(如 `AGENTS.md`)来教导代理*如何*记忆,从而在会话之间创建有状态的体验。每个代理都生活在自己的仓库中,允许存在多个独立的代理——一个“家庭实验室代理”、一个“投资代理”等——所有都在相同的核心系统上运行。该项目是开源的(MIT 许可证),并且可在 GitHub 上轻松获取。

## Agent Kernel 与 AI 状态的挑战 - 摘要 Hacker News 的讨论围绕“Agent Kernel”项目展开,该项目利用三个 Markdown 文件(AGENTS.md、KNOWLEDGE.md 和 notes/)来创建具有状态的 AI 代理。虽然简单的文本记忆概念很有吸引力,但许多评论者对它的可靠性表示怀疑。 一个关键问题是,代理难以辨别*哪些*信息需要保留,导致“知识”文件膨胀,并且无法可靠地遵循 AGENTS.md 中的指令。 许多用户强调现有的解决方案,例如 Claude Code 的自动记忆和活动日志记录,认为这些方案更有效。 另一些人建议利用 Git 等工具来跟踪更改,并依赖于开发人员的手动输入来获取关键的学习内容。 还提出了替代方法,包括基于 HTTP 代理的状态管理(Spotless)以及将 Markdown 与向量数据库结合以实现可扩展的内存。一个反复出现的主题是潜在的偏见和“创伤重演”——代理沉迷于过去的互动,并表现出扭曲的视角。 最终,讨论强调了创建真正可靠且无偏见的具有持久记忆的 AI 代理的持续困难。
相关文章

原文

The easiest way to create an AI agent. Clone, start, talk.

Your agent remembers between sessions, takes notes, and builds on past work. No framework, no database — just three markdown files and a git repo.

Works with any AI coding agent: OpenCode, Claude Code, Codex, Cursor, Windsurf, etc.

git clone https://github.com/oguzbilgic/agent-kernel.git my-agent
cd my-agent

Start your agent:

opencode     # or claude, codex, cursor, etc.

That's it. The agent reads the kernel, realizes it's new, asks who you want it to be. You tell it. It remembers.

AGENTS.md          ← kernel (generic, don't edit)
IDENTITY.md        ← who this agent is (agent maintains)
KNOWLEDGE.md       ← index of knowledge files (agent maintains)
knowledge/         ← facts about the world (mutable)
notes/             ← daily session logs (append-only)

Two kinds of memory:

  • knowledge/ — State. Facts about how things are right now. The agent updates these when reality changes.
  • notes/ — Narrative. What happened each session — decisions, actions, open items. Append-only. Never modified after the day ends.

AI agents already read AGENTS.md (or CLAUDE.md, .cursorrules, etc.) as project instructions. This kernel uses that mechanism to teach the agent how to remember.

The agent doesn't need a database, a vector store, or a custom framework. It just needs:

  • A file that says "you are stateful, here's how"
  • A git repo to store memory in
  • Plain markdown files

Each agent is its own repo. To create another:

git clone https://github.com/oguzbilgic/agent-kernel.git another-agent
cd another-agent
opencode     # or claude, codex, etc.

Same kernel, different identity, different knowledge. You can have a homelab agent, an investing agent, a health agent — all running the same OS.

MIT

联系我们 contact @ memedata.com