惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
F
Fortinet All Blogs
D
Docker
博客园 - 司徒正美
腾讯CDC
Recent Announcements
Recent Announcements
The Cloudflare Blog
B
Blog RSS Feed
GbyAI
GbyAI
T
Tailwind CSS Blog
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志

博客园 - 荣锋亮

just-git 纯js 的git 实现 阿里开源的UnifiedModel agno agentos interfaces 简单说明 agno agentos ag-ui 协议 agno agentos 暴露a2a 协议 agno gateway模式 agno 多agent 框架集成能力 agno agentos 简单说明 agno workflow 模式简单说明 agno team agent 简单说明 agno remote agent 简单说明 agno agent 使用 agno agent 平台 sshpiper 简单试用 sshpiper ssh 的反向代理服务 context-propagation spring reactor 的上下文传递包 nginx 发布1.31.2 了 reductstore 的一些部署模式 reductstore 数据写入模式 reductstore bridge 方便reductstore数据bridge 扩展 reductstore zenoh 集成 zenoh 1.9.x 一些新特性 ladybugdb嵌入式图数据库 BlockHound 检测 reactor阻塞调用的agent reductstore 高性能面向机器人以及IOT场景的存储以及流数据基石 zerofs 一些新功能 java nats request-many 支持的一些模式 java nats RequestMany context7 面向llm 以及ai代码编辑器的依赖包更新平台 NATS Agents Protocol nats 团队提出的agent 通信协议
llama-agents 状态管理
荣锋亮 · 2026-05-27 · via 博客园 - 荣锋亮

在工作流执行中经常会有共享状态的处理,llama-agents 通过context 的storage 可以存储信息,默认是没有类型的,当然也可以添加状态

参考玩法

  • 获取以及存储状态
class MyWorkflow(Workflow):

    @step
    async def my_step(self, ctx: Context, ev: StartEvent) -> StopEvent:
       current_count = await ctx.store.get("count", default=0)
       current_count += 1
       await ctx.store.set("count", current_count)
       return StopEvent()

状态复用

实际上就是对于context 的持久化处理

workflow = MyWorkflow()
ctx = Context(workflow)

handler = workflow.run(ctx=ctx)
result = await handler

# Optional: save the ctx somewhere and restore
# ctx_dict = ctx.to_dict()
# ctx = Context.from_dict(workflow, ctx_dict)

# continue with next run
handler = workflow.run(ctx=ctx)
result = await handler

说明

状态参数对于workflow 的运行是比较重要的东西,使用好比较方便

参考资料

https://developers.llamaindex.ai/python/llamaagents/workflows/managing_state/