認識 Shepherd:一個開源 Python 基底,讓元代理能分叉、重播及還原任何代理執行

2026年8月8日 20:54
站內 AI 整理稿

Long-running agents accumulate state that no transcript captures.A coding agent at step 10 holds edited files, a running dev server, installed packages, and a warm prompt cache.

When it misreads a traceback and rewrites a file that was already correct, neither available recovery path is cheap: patching forward grows the context and the token bill, and restarting from step one re-pays every model and tool call while reproducing nothing exactly, because runs are non-deterministic.

Jumping back to step eight is the option engineers actually want, and it is the one existing runtimes cannot offer.Git versions files, not a live process or a cache.

Researchers at Northeastern University and Stanford University have released Shepherd, a Python runtime substrate that records an agent run as a Git-like trace of typed events, so any past state can be forked and replayed.

The research team reports forks 5× faster than Docker and over 95% prompt-cache reuse on replay.Is it deployable?Yes but it is available in early alpha and not ready for production.Shepherd is MIT-licensed and installable with pip install shepherd-ai from PyPI.It needs Python 3.11+.

OS-level grant enforcement runs on macOS (Seatbelt) and Linux (Landlock, in a privileged container).Industries: Software engineering and DevOps, AI infrastructure and agent-platform vendors, quantitative finance research, security tooling and offensive-security research, and data engineering.

The common trait is not the vertical.It is long-horizon agent runs against heavy sandbox state, where a failed run is expensive to redo.Applications: Live supervision of coding agents, with a meta-agent reverting a bad write before it commits.

Automated recovery from a wrong tool call, without a full restart.Branching exploration over candidate agent strategies, compared side by side.Rollout generation for reinforcement learning, forking at selected turns.

What Shepherd changes Shepherd is a Python substrate that records an agent’s execution as a first-class object.Every agent-environment interaction becomes a typed event in a Git-like execution trace.Core operations are formalized as functions and mechanized in Lean.

Each interaction is effectively a commit.Unlike Git, the commit covers the agent process and the filesystem together, copy-on-write.A branch therefore carries live state, not just files.Returning to an earlier point is a single fork from that commit.

The research team reports that Shepherd forks the agent process and its filesystem 5× faster than Docker.Because the prompt prefix through the branch point is unchanged, replay achieves over 95% prompt-cache reuse.

The documentation organizes the framework around four concepts: tasks, effects, runs, and workspaces.A task is a typed function whose body the model fills in, so the signature is the contract.An effect is every crossing of the task boundary, and it can be watched, answered, or refused.

A run is the durable record of those crossings.Permissions are declared in the signature.A May[GitRepo, ReadOnly] binding is compiled to that run’s writable roots and enforced at the native syscall jail.

Once a run is forkable, a meta-agent can sit on top Forking enables higher-order agents that observe a trace and intervene before a bad write commits.The research team demonstrates three applications: In runtime intervention, a live supervisor raised pair-coding pass rates on CooperBench from 28.

8% to 54.7%.In counterfactual meta-optimization, branching exploration beat baselines across four benchmarks by up to 11 points, while cutting wall-clock time by up to 58%.In Tree-RL training, forking rollouts at selected turns improved TerminalBench-2 from 34.2% to 39.4%.window.

addEventListener("message",function(e){ if(e.data&&e.data.mtpHeight){var f=document.getElementById("mtp-shep-frame"); if(f)f.style.height=e.data.mtpHeight+"px";} }); Key Takeaways Shepherd records each agent-environment interaction as a typed event in a Git-like, forkable trace.

A commit covers the agent process and filesystem together, so a rewind restores live state, not just files.Reported: 5× faster forks than Docker and over 95% prompt-cache reuse on replay.A live supervisor lifted CooperBench pair-coding pass rates from 28.8% to 54.7%.

Check out the Paper, GitHub, Experiments repo, Project page and PyPI.Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter.Wait!are you on telegram?now you can join us on telegram as well.

Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?Connect with us The post Meet Shepherd: An Open-Source Python Substrate That Lets Meta-Agents Fork, Replay, and Revert Any Agent Run appeared first on MarkTechPost.

Related

相關文章

量子位模型更新

滴滴自動駕駛連獲全國工商聯及北京市榮譽榜單認可

滴滴自動駕駛首次入選2026年民營企業發展新質生產力案例,並登上北京民營企業未來產業先鋒榜。滴滴在民營企業研發投入榜單中名列第25位,北京民營企業百強第7位。滴滴自動駕駛已累計安全運行超過2200天,並與廣汽埃安合作推出新一代Robotaxi車型,開啟無人載客服務。

剛剛

世衛組織發佈重磅報告,呼籲全面升級醫療 AI 研究倫理監管

報告指出,雖然人工智能正在以前所未有的速度重塑健康研究、加速科學發現並改善醫療成果,但在缺乏強有力的倫理防線與監管 oversight 的情況下,AI 醫療研究也可能引入新的風險,從而危及人權、社會公平以及公眾信任。在現有的倫理審查機制方面,世衛組織警告稱,傳統的審查體系往往難以應對人工智能帶來的新型風險,包括算法透明度、偏見、公平性、問責制、隱私保護,以及快速部署 AI 工具可能引發的潛在危害。

1 小時前3500
雷峰網模型更新

蘋果高管稱不建議給iPhone貼膜!網友:免費換屏幕我就信你;高德地圖成「職場版大眾點評」?回應來了;Muse大火,扎克伯格身價暴漲1700億

要聞提示1.蘋果高管稱不建議給iPhone貼膜!網友:免費換屏幕我就信你2.知情人士:DeepSeek將向聯合國安理會介紹AI風險,月之暗面等中國企業也受邀參會3.高德地圖成“職場版大眾點評”?回應來了4.字節通報二季度違規案例:114名員工被辭退,其中8人被移交司法機關處理5.

3 小時前