In-memory global state

As of 0.9.10

Use of in-memory global state via tool calling must be allowed by enabling the session configuration allow_global_state.

get_global_state

Get the values for one or more keys within a namespace in the global state available across sessions and turns, including the monotonically increasing revision number for the namespace

Parameters

Parameter Type Required Description
namespace String Yes A namespace is a container of key/value pairs
keys Array of Strings Yes An array of one or more keys for which to retrieve the values. Unknown keys will return a null value.

set_global_state

Set (or update) the value for one or more keys within a namespace in the global state available across sessions and turns.

A monotonically increasing revision counter per namespace is updated for every change to a key in that namespace.

Parameters

Parameter Type Required Description
namespace String Yes A namespace is a container of key/value pairs
keys Array of Strings Yes An array of one or more keys with corresponding value entries in the values parameter
values Array of Strings Yes An array of one or more values corresponding to entries in ‘keys’ parameter