agent-readings / The Agent Runtime
DBOS
Runtime state as database state
---
The one sentence
DBOS argues that a distributed transactional DBMS should be the substrate for cluster operating-system services, so execution state becomes queryable, transactional, and highly available by construction.
For agents, the DBOS idea is the systems ancestor of 'every step is a durable write': if task state, messages, retries, and results live in a transactional store, an agent trajectory becomes recoverable and inspectable instead of ephemeral control flow.
---
Core idea
Put OS state in a distributed DBMS, then implement OS services as stored procedures over tables so scheduling, communication, storage, transactions, high...
Put OS state in a distributed DBMS, then implement OS services as stored procedures over tables so scheduling, communication, storage, transactions, high availability, and analytics share one substrate.
Modelreason
Runtimeact
Worldobserve
01
Define the DBOS stack with distributed DBMS, microkernel services, OS services, and user applications.
02
Represent scheduler state in Task and Worker tables.
03
Implement FIFO, locality-aware, and least-loaded schedulers as stored procedure variants.
04
Represent IPC messages as rows in a Message table partitioned by receiver.
---
Executable shape
The mechanism should fit on one screen.
```python
Task(p_key, task_id, worker_id, priority, created_at)
Worker(p_key, worker_id, unused_capacity)
Message(sender_id, receiver_id, message_id, data)
schedule(task):
worker = select worker_id from Worker
where unused_capacity > 0 and p_key = task.home_partition
order by unused_capacity desc
limit 1
if worker:
update Worker set unused_capacity = unused_capacity - 1 where worker_id = worker
insert into Task values(task.partition, task.id, worker, ...)
else:
insert into Task values(task.home_partition, task.id, null, ...)
send(sender, receiver, id, data):
insert into Message values(sender, receiver, id, data)
receive(receiver):
msg = select * from Message where receiver_id = receiver order by message_id limit 1
delete from Message where receiver_id = receiver and message_id = msg.id
return msg
```
---