jeevesagent.runtime¶
Durable runtime adapters.
InProcRuntime— no durability; just runs every step.JournaledRuntime— generic journal-backed runtime that caches step results and replays them on a second call to the same(session_id, step_name). Pair with anyJournalStore.SqliteRuntime— convenience:JournaledRuntimerooted at a sqlite file. Durable across process restarts.
Future adapters: DBOSRuntime (Postgres-backed via DBOS workflows),
TemporalRuntime (Temporal cluster).
Submodules¶
Classes¶
Dict-backed journal. Process-local; lost on exit. |
|
No durability. Each step runs immediately. |
|
Trivial session: just a holder for the session ID and signals. |
|
A single recorded step result with a creation timestamp. |
|
Storage surface for the durable runtime. |
|
Runtime that journals every step's result for replay. |
|
The handle yielded by |
|
Postgres-backed journal. Production-grade durable replay. |
|
|
|
SQLite-backed journal. Durable across process restarts. |
|
|
Package Contents¶
- class jeevesagent.runtime.InMemoryJournalStore[source]¶
Dict-backed journal. Process-local; lost on exit.
- class jeevesagent.runtime.InProcRuntime[source]¶
No durability. Each step runs immediately.
- async session(session_id: str) collections.abc.AsyncIterator[InProcSession][source]¶
- async step(name: str, fn: collections.abc.Callable[Ellipsis, collections.abc.Awaitable[Any]], *args: Any, idempotency_key: str | None = None, **kwargs: Any) Any[source]¶
- stream_step(name: str, fn: collections.abc.Callable[Ellipsis, collections.abc.AsyncIterator[Any]], *args: Any, **kwargs: Any) collections.abc.AsyncIterator[Any][source]¶
- name = 'inproc'¶
- class jeevesagent.runtime.InProcSession(session_id: str)[source]¶
Trivial session: just a holder for the session ID and signals.
- id¶
- class jeevesagent.runtime.JournalEntry[source]¶
A single recorded step result with a creation timestamp.
- value: Any¶
- class jeevesagent.runtime.JournalStore[source]¶
Bases:
ProtocolStorage surface for the durable runtime.
- class jeevesagent.runtime.JournaledRuntime(store: jeevesagent.runtime.journal.JournalStore | None = None)[source]¶
Runtime that journals every step’s result for replay.
Pass any
JournalStore(in-memory for tests, sqlite for durable single-process use, future Postgres/DBOS adapters for multi-process / multi-host).- async session(session_id: str) collections.abc.AsyncIterator[JournaledSession][source]¶
- async step(name: str, fn: collections.abc.Callable[Ellipsis, collections.abc.Awaitable[Any]], *args: Any, idempotency_key: str | None = None, **kwargs: Any) Any[source]¶
- stream_step(name: str, fn: collections.abc.Callable[Ellipsis, collections.abc.AsyncIterator[Any]], *args: Any, **kwargs: Any) collections.abc.AsyncIterator[Any][source]¶
- name = 'journaled'¶
- property store: jeevesagent.runtime.journal.JournalStore¶
- class jeevesagent.runtime.JournaledSession(session_id: str)[source]¶
The handle yielded by
JournaledRuntime.session().- id¶
- class jeevesagent.runtime.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.PostgresRuntime(pool: Any)[source]¶
Bases:
jeevesagent.runtime.journaled.JournaledRuntimeJournaledRuntimebacked by Postgres for cross-host durable replay.- classmethod connect(dsn: str, *, min_size: int = 1, max_size: int = 10) PostgresRuntime[source]¶
- Async:
Open a fresh asyncpg pool and return the runtime rooted at it.
- name = 'postgres'¶
- class jeevesagent.runtime.SqliteJournalStore(path: str | pathlib.Path)[source]¶
SQLite-backed journal. Durable across process restarts.
- property path: pathlib.Path¶
- class jeevesagent.runtime.SqliteRuntime(path: str | pathlib.Path)[source]¶
Bases:
jeevesagent.runtime.journaled.JournaledRuntimeJournaledRuntimewith aSqliteJournalStore.- name = 'sqlite'¶
- property path: pathlib.Path¶