org.llm4s.agent.graph.spi

Members list

Type members

Classlikes

@Experimental
final class CheckpointStore extends AutoCloseable

An open checkpoint store, as a CheckpointerBackend returns it: the Checkpointer to build a GraphRuntime over, and the means to close what the backend opened for it (a file, a connection pool).

An open checkpoint store, as a CheckpointerBackend returns it: the Checkpointer to build a GraphRuntime over, and the means to close what the backend opened for it (a file, a connection pool).

Close it when the application stops, after every runtime over it has finished: close() releases the backend's resources once, and later calls do nothing. Calls to the checkpointer after close fail as the store documents.

Value parameters

kind

the llm4s.agent.checkpointer.kind the store was opened for

Attributes

Companion
object
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
@Experimental

A checkpoint store's contribution to CheckpointerConfigLoader.open (design 4.54): how a CheckpointerSettings block becomes an open CheckpointStore.

A checkpoint store's contribution to CheckpointerConfigLoader.open (design 4.54): how a CheckpointerSettings block becomes an open CheckpointStore.

llm4s.agent.checkpointer.kind names the store an application runs on, and the loader hands the backend registered for that kind its own block, llm4s.agent.checkpointer.<kind>, flattened to strings. llm4s-agent builds the memory store itself; every other store module registers its backend, so choosing a store is adding its dependency and setting kind, with no code:

kind module
memory llm4s-agent (built in)
sqlite llm4s-agent-checkpoint-sqlite
postgres llm4s-agent-checkpoint-postgres

Implementations must be a plain class with a public no-arg constructor, '''not''' a Scala object: java.util.ServiceLoader instantiates the named class. Declare it in META-INF/services/org.llm4s.agent.graph.spi.CheckpointerBackend, and ship the block's defaults and its ${?VAR} bindings in the module's own reference.conf. A backend can also be registered explicitly with CheckpointerBackends.of or CheckpointerBackends.withBackend, which is the answer for a shaded jar whose services files did not survive.

final class MyStoreBackend extends CheckpointerBackend:
 val kind = "mystore"
 def open(settings: CheckpointerSettings): Result[CheckpointStore] =
   for
     url     <- settings.string("url")
     timeout <- settings.duration("callTimeout", 5.seconds)
     store   <- MyStore.open(url, timeout)
   yield CheckpointStore(kind, store, () => store.close())

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
@Experimental
final class CheckpointerBackends

The checkpoint store backends CheckpointerConfigLoader.open can dispatch to, keyed by kind.

The checkpoint store backends CheckpointerConfigLoader.open can dispatch to, keyed by kind.

Usually obtained from CheckpointerBackends.discover, which reads META-INF/services/org.llm4s.agent.graph.spi.CheckpointerBackend entries off the classpath. The memory kind is always available, an InMemoryCheckpointer on the system clock, unless a registered backend claims it. When two backends claim one kind the later registration wins, so an explicit withBackend replaces a discovered one.

Value parameters

discovered

whether this set came from classpath discovery rather than explicit registration

failures

one line per service entry that could not be loaded, for diagnosing a missing backend; empty when discovery was clean or did not run

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
@Experimental
final class CheckpointerSettings

What a CheckpointerBackend opens its store from: the selected kind and that kind's own block, llm4s.agent.checkpointer.<kind>, flattened to strings keyed by their path inside the block (busyTimeout, pool.size).

What a CheckpointerBackend opens its store from: the selected kind and that kind's own block, llm4s.agent.checkpointer.<kind>, flattened to strings keyed by their path inside the block (busyTimeout, pool.size).

The typed readers turn a missing or malformed value into a ConfigurationError that names the full key, never the value, which may be a password. toString lists only the keys, for the same reason.

Value parameters

extras

the kind's block; empty when the configuration has none

kind

the selected kind, lower-cased

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type