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

推荐订阅源

IT之家
IT之家
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
小众软件
小众软件
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
有赞技术团队
有赞技术团队
J
Java Code Geeks
WordPress大学
WordPress大学
The Cloudflare Blog

博客园 - 荣锋亮

pg-boss 基于pg 的node 队列job 服务 Omnigres 基于pg的开发平台 zerofs 支持native kernel client multigres pg 版的Vitess drizzle-duckdb duckdb drizzle orm client dumbodb 面向文档db 的版本管理db doltlite sqlite 的版本控制 doltgresql pg 的dolt 服务 TokenHub 基于golang 的llm proxy 服务 duckgres PostHog 开源的通过pg协议暴露duckdb服务能力 jenkins 2.568.1 publish over ssh java.lang.NoSuchMethodError: 'java.lang.Object jenkins.plugins.publish_over_ssh.BapSshHostConfiguration 问题 scriptc vercel 开源的ts 转native 编译器 itty-router 轻量的microrouter drizzle-proxy 格式简单说明 drizzle-proxy 简单说明 duckdb iceberg rest catalog连接的一个问题 supabase wrappers pg 扩展服务 ice 运行简单说明 pgnats pg 的nats 扩展 ice 轻量iceberg rest catalog 服务 zerofs v2.1.0 支持无缝的ha 以及恢复了 liteparse 的可视化引用 VaultS3 与zerofs 集成测试 VaultS3 一个轻量的s3 兼容服务 liteparse-server liteparse rest&grpc服务 smoothdb 兼容postgrest的服务 fluxbase 基于golang 开发的兼容supabase的服务 pg_durable 微软开源的基于pg 的持久运行扩展 liteparse ocr api 规范 基于litserve 以及RapidOCR扩展一个liteparse ocr 服务
通过dbos 解决llama-agents workflow 持久执行问题
荣锋亮 · 2026-05-29 · via 博客园 - 荣锋亮

dbos 是一个很不错的持久运行框架,llama-agents 开发了一个扩展模块可以方便集成

参考玩法

核心就是运行传入DBOSRuntime

import asyncio

from dbos import DBOS
from llama_agents.dbos import DBOSRuntime
from pydantic import Field
from workflows import Context, Workflow, step
from workflows.events import Event, StartEvent, StopEvent


# 1. Configure DBOS — SQLite by default
DBOS(config={"name": "counter-example", "run_admin_server": False})


# 2. Define events and workflow (nothing DBOS-specific here)
class Tick(Event):
    count: int = Field(description="Current count")


class CounterResult(StopEvent):
    final_count: int = Field(description="Final counter value")


class CounterWorkflow(Workflow):
    @step
    async def start(self, ctx: Context, ev: StartEvent) -> Tick:
        await ctx.store.set("count", 0)
        print("[Start] Initializing counter to 0")
        return Tick(count=0)

    @step
    async def increment(self, ctx: Context, ev: Tick) -> Tick | CounterResult:
        count = ev.count + 1
        await ctx.store.set("count", count)
        print(f"[Tick {count:2d}] count = {count}")

        if count >= 20:
            return CounterResult(final_count=count)

        await asyncio.sleep(0.5)
        return Tick(count=count)


# 3. Create runtime, attach to workflow, and launch
runtime = DBOSRuntime()
workflow = CounterWorkflow(runtime=runtime)


async def main() -> None:
    await runtime.launch()
    result = await workflow.run(run_id="counter-run-1")
    print(f"Result: final_count = {result.final_count}")


asyncio.run(main())

说明

dbos 扩展还支持一些其他参数(默认是sqlite,可以扩展到pg 等),是持久化workflow 比较推荐的选择(context 以及store 都会存储到db 中)

参考资料

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