jeevesagent.runtime.journal¶
Journal stores for the durable runtime.
A journal records the result of every side-effecting step in a run,
keyed by (session_id, step_name). On replay, the runtime returns
the cached result instead of re-executing the step. This is the
mechanism that makes long-running agents resumable across crashes.
Today’s stores:
InMemoryJournalStore— dict-backed; lost on process exit. Useful for tests and for runs where you want replay-within-a-run semantics but don’t need durability across restarts.SqliteJournalStore— sqlite3 file with two tables; survives process restarts. Sync sqlite3 calls dispatched throughanyio.to_thread.run_sync().
Both stores use pickle for value serialization. That’s safe in
this context because journals only ever hold values returned by your
own trusted code (tools, models, memory backends) — the same code
path that ran them in the first place. Switching to JSON would force
every stored value to be JSON-serialisable, which precludes Pydantic
models and arbitrary tool return values.
Classes¶
Dict-backed journal. Process-local; lost on exit. |
|
A single recorded step result with a creation timestamp. |
|
Storage surface for the durable runtime. |
|
Postgres-backed journal. Production-grade durable replay. |
|
SQLite-backed journal. Durable across process restarts. |
Module Contents¶
- class jeevesagent.runtime.journal.InMemoryJournalStore[source]¶
Dict-backed journal. Process-local; lost on exit.
- class jeevesagent.runtime.journal.JournalEntry[source]¶
A single recorded step result with a creation timestamp.
- value: Any¶
- class jeevesagent.runtime.journal.JournalStore[source]¶
Bases:
ProtocolStorage surface for the durable runtime.
- class jeevesagent.runtime.journal.PostgresJournalStore(pool: Any)[source]¶
Postgres-backed journal. Production-grade durable replay.
Same shape as
SqliteJournalStorebut usesasyncpgand a Postgres database. Designed for users who already run a Postgres instance for the rest of their stack (memory, audit, app state) and want their durable-runtime journal to live there too.Why not a DBOS adapter?
DBOS Python’s workflow model requires
@DBOS.workflow()and@DBOS.communicator()decorators at module-load time. OurRuntime.step(name, fn, *args)API takes arbitrary callables at runtime, which doesn’t compose cleanly with DBOS’s static-decoration model.PostgresJournalStoregives the same durability guarantee through our existingJournaledRuntimearchitecture, with no decorator intrusion on user code.
- class jeevesagent.runtime.journal.SqliteJournalStore(path: str | pathlib.Path)[source]¶
SQLite-backed journal. Durable across process restarts.
- property path: pathlib.Path¶