跳到正文
DEV Community· Nexus Foundry·· 2 小時前AI 評分54

AI 智能體完成任務後,如何留下下一個工作階段可用的交接記錄?

Your agent finished the task. Did it leave a note the next one can actually use?

AI 導讀

Nexus Foundry 為多工作階段 AI 智能體提出結構化交接方案,以八個必填部分記錄目標、決策、檔案、未決問題及驗證狀態,取代單純聊天摘要。附帶的 handoff_check.py 使用 Python 標準函式庫,按八個部分評估完整度,並可用 --fail-below 75 設定 CI 門檻;驗證器檢查的是結構,不保證內容真實。

正文

Multi-session agent work has a predictable failure point: the context boundary. Session A does three hours of work, hits its limit, and dies. Session B starts fresh — no memory of why the auth refactor touched the billing module, no record of which approach was tried and rejected, no list of what's verified vs. assumed.

The default "handoff" is a chat summary. It captures what the agent said it did, not what it knows. The next session inherits vibes.

What a real handoff needs

I run agents against a 250-SKU store where sessions rotate constantly, so I built a kit around one idea: a handoff is a structured document with a completeness contract, not a summary. Eight sections, all required:

  • Objective — what "done" means, in one sentence
  • Context — what the receiving agent needs to know that isn't in the repo
  • Decisions made — including the rejected alternatives, so they don't get re-litigated
  • Files touched — exact paths, so the next session doesn't grep the whole tree
  • Open questions — what's genuinely undecided vs. what looks undecided
  • Next steps — ordered, with the first one being the smallest verifiable action
  • Verification state — what was actually run and passed, vs. what was assumed
  • Secrets excluded — a reminder that credentials never go in the doc (the most common leak vector in agent workflows)

The part that makes it a protocol instead of a template

A template without a validator is a suggestion. The kit ships handoff_check.py — stdlib Python, scores completeness 0–100 across the 8 sections, --fail-below 75 for CI gating. A handoff that scores under threshold literally cannot be "handed off" in an automated pipeline.

The honest scope, because it matters: the validator checks structure, not truth. A complete-looking handoff can still contain wrong claims — that's what the Verification State section is for, and why "tests pass" needs to be a receipt, not an assertion. (I wrote about that receipt format separately if you want the verification side.)

Why this beats memory tools for the session boundary

Agent memory kits solve long-term recall. Session search solves log retrieval. Neither solves the immediate problem: a cold-start agent needs a dense, structured briefing right now, and it needs to know when the briefing is too thin to act on.

$14 — JSON + Markdown templates, the validator, a complete example, and a deliberately-incomplete example so you can watch the scorer fail:

https://wesleygitari2-cloud.github.io/nexus-store-redirect/p/agent-handoff-kit

If your agents already hand off context between sessions, what does your handoff doc look like — and does anything check it?

來源:DEV Community · dev.to