LlamaAgents DBOS Runtime
DBOS durable runtime plugin for LlamaIndex Workflows.
Installation
pip install llama-agents-dbos
Usage
import asyncio
from llama_agents.dbos import DBOSRuntime
from dbos import DBOS, DBOSConfig
from workflows import Workflow, step, StartEvent, StopEvent
# Configure DBOS
config: DBOSConfig = {
"name": "my-app",
"system_database_url": "postgresql://...",
}
DBOS(config=config)
# Create runtime and workflow
runtime = DBOSRuntime()
class MyWorkflow(Workflow):
@step
async def my_step(self, ev: StartEvent) -> StopEvent:
return StopEvent(result="done")
workflow = MyWorkflow(runtime=runtime)
# launch_sync() works outside async contexts; use await runtime.launch() inside one
runtime.launch_sync()
async def main():
result = await workflow.run()
asyncio.run(main())
Workflow concurrency
Set num_concurrent_runs to limit how many runs of a workflow may be active
at once on each DBOS worker:
workflow = MyWorkflow(runtime=runtime, num_concurrent_runs=8)
The default is None, which is unlimited. Unlimited workflows start directly,
with no queue in the path. Limited workflows submit through a DBOS queue named
_llamaindex_workflow_queue:<workflow_name>, and runs beyond the limit wait as
ENQUEUED. Admission takes about the configured
DBOSRuntime(queue_polling_interval_sec=...), one second by default. Capacity across
a deployment is the limit times the number of workers. The queue is shared, so
an enqueued run has no affinity to the replica that submitted it. Any worker
with a free slot can pick it up.
The runtime declares the queue for every workflow, limited or not, so turning a limit on or off never strands queued work. A new limit does not count runs that started before it, so a worker can briefly exceed the limit while those finish.
Waiting runs are rows in the database, filed under the workflow's name
(workflow_name, defaulting to the Python module and class name). A worker
only looks for waiting work under the names it knows, so if you rename a
workflow, rows filed under the old name are invisible to the new deployment.
Keep old workers running until they finish that work.
A run that is still waiting in the queue cannot be cancelled yet, because cancellation is a message delivered to the running workflow. The request is saved, and the run stops itself as soon as it starts.
DBOS normally watches every queue automatically. An application that instead
passes an explicit list to DBOS.listen_queues must add this runtime's
queues to it (runtime.workflow_queues), or waiting runs are never picked
up. Build the list after registering workflows and before launch.
Features
- Durable workflow execution backed by DBOS
- Automatic step recording and replay
- Distributed workers and recovery support
- Per-worker workflow concurrency with an unlimited default
Metadata
Release files for llama-agents-dbos 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_agents_dbos-0.7.0.tar.gz | 25.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_agents_dbos-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.3 kB
Release files / llama_agents_dbos-0.7.0.tar.gz
| Download URL | llama_agents_dbos-0.7.0.tar.gz |
|---|---|
| Size | 25.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
baa18d8e0415b252b0783c1dbf497d85e6a042f82e7af0514ceb8eee615077ce
|
|
BLAKE2b-256 checksum How to use checksums |
7fdf5ead26dda9514554e7c9431e6a4f2ad9296f9b8faa89a10613b7634d655a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_agents_dbos-0.7.0-py3-none-any.whl
| Download URL | llama_agents_dbos-0.7.0-py3-none-any.whl |
|---|---|
| Size | 32.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc613336d7f8b46263b72f35635fc6afc09761c417696cb92d4851b0976d217d
|
|
BLAKE2b-256 checksum How to use checksums |
3fa70837f678e6c60187ea10578a94a9e26af33329b0866d483ca81ff93d11aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|