Python API¶
This reference is generated from the source docstrings with mkdocstrings. It starts with the supported public surface, then documents the schema models and the advanced sub-modules.
Public surface¶
The supported, stable API exported from the top-level skeino package:
create_app
¶
create_app(
*,
graphs: Mapping[str, GraphInput],
settings: SkeinoSettings,
) -> FastAPI
Build a FastAPI application that exposes the skeino HTTP surface.
graphs maps assistant id → either a precompiled :class:CompiledStateGraph
or a builder (checkpointer) -> CompiledStateGraph (sync or async). When
a builder is supplied, skeino resolves a checkpointer via
:func:skeino.persistence.open_checkpointer and passes it in.
Source code in src/skeino/app.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
from_langgraph_json
¶
from_langgraph_json(
manifest_path: str | Path,
*,
settings: SkeinoSettings | None = None,
) -> FastAPI
Build a skeino-backed FastAPI app from a langgraph.json manifest.
Parameters¶
manifest_path:
Path to the langgraph.json file.
settings:
Optional :class:SkeinoSettings whose explicit fields override anything
derived from the manifest. Useful for setting server options that
langgraph.json does not describe.
Source code in src/skeino/langgraph_json.py
SkeinoSettings
pydantic-model
¶
Bases: BaseModel
Configuration record passed to :func:skeino.create_app.
Settings live in your code (typed, validated, version-controlled). For
deployments that read from environment variables, use pydantic-settings
in your project and pass the resulting object into SkeinoSettings.
Config:
arbitrary_types_allowed:Truefrozen:True
Fields:
-
checkpointer_scheme(str) -
checkpointer_uri(str | None) -
checkpointer_options(dict[str, object]) -
allow_ephemeral_metadata(bool) -
default_assistant_id(str | None) -
supported_assistant_ids(frozenset[str] | None) -
assistant_name(str | None) -
assistant_description(str | None) -
assistant_namespace(str) -
server_title(str) -
server_description(str) -
server_version(str) -
welcome_message(str | None) -
cors_origins(list[str]) -
cors_methods(list[str]) -
cors_headers(list[str])
checkpointer_scheme
pydantic-field
¶
Persistence backend: 'memory' (default), 'postgres', 'sqlite', 'mongodb', 'redis', or a custom registered scheme. The scheme alone decides the backend; both the checkpointer and (where a native implementation exists) the metadata store follow it.
checkpointer_uri
pydantic-field
¶
Connection string/path for the selected scheme — e.g. 'postgresql://…', a SQLite path or ':memory:', or 'mongodb://…'. Ignored for the 'memory' scheme. DB backends are optional extras (skeino[postgres] / skeino[sqlite] / skeino[mongodb]).
allow_ephemeral_metadata
pydantic-field
¶
Permit a durable checkpointer to run with the in-memory metadata store (for schemes without a native metadata backend, e.g. redis or a custom checkpointer). Off by default so the split-brain (durable graph state, ephemeral thread/run list) fails loudly at startup.
default_assistant_id
pydantic-field
¶
Assistant id to use when the consumer registers a single graph without specifying one. Falls back to the first key of the graphs map.
GraphRegistry
¶
Immutable mapping of assistant id to compiled graph.
Validate the input mapping and freeze the default selection.
Source code in src/skeino/registry.py
Schemas¶
The Pydantic request/response models behind the HTTP API.
Common types¶
common
¶
Shared type aliases and the checkpoint selector model.
CheckpointConfigModel
pydantic-model
¶
Bases: BaseModel
Checkpoint selector for thread state or run resumption.
Fields:
-
thread_id(str | None) -
checkpoint_ns(str | None) -
checkpoint_id(str | None) -
checkpoint_map(dict[str, JsonValue] | None)
Threads¶
threads
¶
Schemas for thread creation, search, state, and history endpoints.
ThreadTtlConfig
pydantic-model
¶
Bases: BaseModel
Time-to-live settings for a thread.
Fields:
ThreadTtlInfo
pydantic-model
¶
Bases: BaseModel
TTL information returned for a thread.
Fields:
-
strategy(Literal['delete', 'keep_latest']) -
ttl_minutes(float) -
expires_at(str)
ThreadSuperstepUpdate
pydantic-model
¶
Bases: BaseModel
Initial state update applied during thread creation.
Fields:
-
values(dict[str, JsonValue] | list[JsonValue] | None) -
command(CommandModel | None) -
as_node(str)
values
pydantic-field
¶
State values to write as part of this update.
command
pydantic-field
¶
command: CommandModel | None = None
Command to apply instead of (or alongside) values.
ThreadSuperstep
pydantic-model
¶
Bases: BaseModel
A superstep container for thread bootstrap updates.
Fields:
-
updates(list[ThreadSuperstepUpdate])
updates
pydantic-field
¶
updates: list[ThreadSuperstepUpdate]
Ordered state updates applied as one superstep.
ThreadCreateRequest
pydantic-model
¶
Bases: BaseModel
Payload for creating a thread.
Fields:
-
thread_id(UUID | None) -
metadata(dict[str, JsonValue]) -
if_exists(ThreadIfExists) -
ttl(ThreadTtlConfig | None) -
supersteps(list[ThreadSuperstep])
thread_id
pydantic-field
¶
Optional explicit thread id; generated if omitted.
if_exists
pydantic-field
¶
Behaviour when the id already exists: raise (409) or do_nothing.
ttl
pydantic-field
¶
ttl: ThreadTtlConfig | None = None
Optional time-to-live configuration for the thread.
supersteps
pydantic-field
¶
supersteps: list[ThreadSuperstep]
Optional initial state updates to seed the thread on creation.
ThreadPatchRequest
pydantic-model
¶
Bases: BaseModel
Mutable fields updatable on an existing thread.
metadata is optional so an empty body is a no-op; send
{"metadata": {}} to intentionally clear a thread's metadata.
Fields:
-
metadata(dict[str, JsonValue] | None)
metadata
pydantic-field
¶
New metadata; omit for a no-op, send {} to clear existing metadata.
ThreadStateUpdateRequest
pydantic-model
¶
Bases: BaseModel
Manually write/patch a thread's state (human-in-the-loop edit).
Fields:
-
values(dict[str, JsonValue] | list[JsonValue] | None) -
as_node(str | None) -
checkpoint(CheckpointConfigModel | None)
values
pydantic-field
¶
State values to write into the new checkpoint.
checkpoint
pydantic-field
¶
checkpoint: CheckpointConfigModel | None = None
Checkpoint to branch the update from; latest if omitted.
ThreadModel
pydantic-model
¶
Bases: BaseModel
LangGraph-compatible thread representation.
Fields:
-
thread_id(UUID) -
created_at(str) -
updated_at(str) -
state_updated_at(str | None) -
metadata(dict[str, JsonValue]) -
config(dict[str, JsonValue]) -
status(ThreadStatus) -
values(dict[str, JsonValue] | None) -
interrupts(JsonValue) -
ttl(ThreadTtlInfo | None) -
extracted(dict[str, JsonValue] | None)
updated_at
pydantic-field
¶
ISO-8601 timestamp when the thread row was last updated.
state_updated_at
pydantic-field
¶
ISO-8601 timestamp when the thread's state last changed.
values
pydantic-field
¶
Latest checkpoint state values, if any.
extracted
pydantic-field
¶
Fields extracted from state per the search request's extract.
ThreadSearchRequest
pydantic-model
¶
Bases: BaseModel
Payload for listing or searching threads.
Fields:
-
ids(list[UUID] | None) -
metadata(dict[str, JsonValue] | None) -
values(dict[str, JsonValue] | None) -
status(ThreadStatus | None) -
limit(int) -
offset(int) -
sort_by(Literal['thread_id', 'status', 'created_at', 'updated_at', 'state_updated_at'] | None) -
sort_order(Literal['asc', 'desc'] | None) -
select(list[Literal['thread_id', 'created_at', 'updated_at', 'state_updated_at', 'metadata', 'config', 'status', 'values', 'interrupts']] | None) -
extract(dict[str, str] | None)
metadata
pydantic-field
¶
Filter by exact metadata key/value matches.
values
pydantic-field
¶
Filter by exact state-value matches.
sort_by
pydantic-field
¶
sort_by: (
Literal[
"thread_id",
"status",
"created_at",
"updated_at",
"state_updated_at",
]
| None
) = None
Field to sort by.
select
pydantic-field
¶
select: (
list[
Literal[
"thread_id",
"created_at",
"updated_at",
"state_updated_at",
"metadata",
"config",
"status",
"values",
"interrupts",
]
]
| None
) = None
Subset of fields to return per thread.
extract
pydantic-field
¶
Map of output key to state path, extracted into each result's extracted.
InterruptModel
pydantic-model
¶
ThreadTaskModel
pydantic-model
¶
Bases: BaseModel
Serialized pending task entry.
Fields:
-
id(str) -
name(str) -
error(str | None) -
interrupts(list[InterruptModel]) -
checkpoint(CheckpointConfigModel | None) -
state(dict[str, JsonValue] | None)
checkpoint
pydantic-field
¶
checkpoint: CheckpointConfigModel | None = None
Checkpoint associated with the task, if any.
ThreadStateModel
pydantic-model
¶
Bases: BaseModel
Latest checkpointed state for a thread.
Fields:
-
values(dict[str, JsonValue] | list[JsonValue]) -
next(list[str]) -
tasks(list[ThreadTaskModel]) -
checkpoint(CheckpointConfigModel) -
metadata(dict[str, JsonValue]) -
created_at(str | None) -
parent_checkpoint(dict[str, JsonValue] | None) -
interrupts(list[InterruptModel])
ThreadStateSearchRequest
pydantic-model
¶
Bases: BaseModel
Payload for retrieving thread history.
Fields:
-
limit(int) -
before(CheckpointConfigModel | None) -
metadata(dict[str, JsonValue] | None) -
checkpoint(CheckpointConfigModel | None)
before
pydantic-field
¶
before: CheckpointConfigModel | None = None
Return checkpoints recorded before this one.
metadata
pydantic-field
¶
Filter checkpoints by metadata key/value matches.
checkpoint
pydantic-field
¶
checkpoint: CheckpointConfigModel | None = None
Restrict history to this checkpoint's namespace.
Runs¶
runs
¶
Schemas for run creation, command payloads, and run responses.
CommandModel
pydantic-model
¶
RunCreateRequest
pydantic-model
¶
Bases: BaseModel
Payload for creating a run on an existing thread.
Fields:
-
assistant_id(str) -
checkpoint(CheckpointConfigModel | None) -
input(JsonValue) -
command(CommandModel | None) -
metadata(dict[str, JsonValue]) -
config(dict[str, JsonValue]) -
context(dict[str, JsonValue]) -
webhook(str | None) -
interrupt_before(Literal['*'] | list[str] | None) -
interrupt_after(Literal['*'] | list[str] | None) -
stream_mode(StreamMode | list[StreamMode]) -
stream_subgraphs(bool) -
stream_resumable(bool) -
on_disconnect(Literal['cancel', 'continue']) -
feedback_keys(list[str]) -
multitask_strategy(MultitaskStrategy) -
if_not_exists(RunIfNotExists) -
after_seconds(float | None) -
checkpoint_during(bool) -
durability(Literal['sync', 'async', 'exit'])
checkpoint
pydantic-field
¶
checkpoint: CheckpointConfigModel | None = None
Resume from a specific checkpoint.
input
pydantic-field
¶
New state to merge in; messages is converted to LangChain messages.
command
pydantic-field
¶
command: CommandModel | None = None
Resume an interrupted graph (update/resume/goto). Takes precedence over input when both are given.
context
pydantic-field
¶
Context passed through to the graph invocation.
webhook
pydantic-field
¶
LangGraph Platform option accepted by the schema but rejected at runtime as out of scope for v1.
interrupt_before
pydantic-field
¶
Nodes to interrupt before; "*" for all.
interrupt_after
pydantic-field
¶
Nodes to interrupt after; "*" for all.
stream_mode
pydantic-field
¶
Streaming mode(s) for the run; defaults to ["values"].
stream_subgraphs
pydantic-field
¶
Whether to include subgraph events in the stream.
stream_resumable
pydantic-field
¶
Whether the stream can be resumed after disconnect.
on_disconnect
pydantic-field
¶
What to do with the run if the stream client disconnects.
multitask_strategy
pydantic-field
¶
Behaviour when the thread is busy (enqueue/reject/rollback/interrupt).
if_not_exists
pydantic-field
¶
Use "create" to auto-create a missing thread, "reject" to 404.
after_seconds
pydantic-field
¶
LangGraph Platform scheduled-run option accepted by the schema but rejected at runtime as out of scope for v1.
checkpoint_during
pydantic-field
¶
Whether to persist checkpoints during the run.
durability
pydantic-field
¶
When checkpoints are written relative to graph steps.
RunModel
pydantic-model
¶
Bases: BaseModel
LangGraph-compatible run metadata.
Fields:
-
run_id(UUID) -
thread_id(UUID) -
assistant_id(str) -
created_at(str) -
updated_at(str) -
status(RunStatus) -
metadata(dict[str, JsonValue]) -
kwargs(dict[str, JsonValue]) -
multitask_strategy(MultitaskStrategy)
Assistants¶
assistants
¶
Schemas for assistants and graph schema introspection.
AssistantSearchRequest
pydantic-model
¶
Bases: BaseModel
Payload for listing assistants.
Fields:
-
metadata(dict[str, JsonValue] | None) -
graph_id(str | None) -
name(str | None) -
limit(int) -
offset(int) -
sort_by(Literal['assistant_id', 'created_at', 'updated_at', 'name', 'graph_id'] | None) -
sort_order(Literal['asc', 'desc'] | None) -
select(list[Literal['assistant_id', 'graph_id', 'name', 'description', 'config', 'context', 'created_at', 'updated_at', 'metadata', 'version']] | None)
metadata
pydantic-field
¶
Filter by exact metadata key/value matches.
sort_by
pydantic-field
¶
sort_by: (
Literal[
"assistant_id",
"created_at",
"updated_at",
"name",
"graph_id",
]
| None
) = None
Field to sort by.
select
pydantic-field
¶
select: (
list[
Literal[
"assistant_id",
"graph_id",
"name",
"description",
"config",
"context",
"created_at",
"updated_at",
"metadata",
"version",
]
]
| None
) = None
Subset of fields to return per assistant.
AssistantModel
pydantic-model
¶
Bases: BaseModel
LangGraph-compatible assistant representation.
Fields:
-
assistant_id(UUID) -
graph_id(str) -
config(dict[str, JsonValue]) -
context(dict[str, JsonValue]) -
created_at(str) -
updated_at(str) -
metadata(dict[str, JsonValue]) -
version(int) -
name(str | None) -
description(str | None)
GraphSchemaModel
pydantic-model
¶
Bases: BaseModel
Schema description returned for an assistant.
Fields:
-
graph_id(str) -
input_schema(dict[str, JsonValue] | None) -
output_schema(dict[str, JsonValue] | None) -
state_schema(dict[str, JsonValue]) -
config_schema(dict[str, JsonValue] | None) -
context_schema(dict[str, JsonValue] | None)
Server¶
server
¶
Persistence¶
Advanced
These are importable for advanced use (e.g. registering a custom checkpointer) but are not part of the stability contract. See Persistence & checkpointers and Write a custom checkpointer.
persistence
¶
Persistence layer: metadata store, checkpointer registry, enrichment.
MetadataStoreProtocol
¶
Bases: Protocol
Async CRUD surface for thread and run metadata.
setup
async
¶
create_thread
async
¶
create_thread(
thread_id: str,
*,
metadata: dict[str, JsonValue],
config: dict[str, JsonValue],
ttl: ThreadTtlConfig | None,
if_exists: ThreadIfExists,
) -> ThreadRow
Insert a thread row and return the stored record.
Source code in src/skeino/persistence/base.py
update_thread
async
¶
update_thread(
thread_id: str,
*,
status_value: ThreadStatus | None = None,
config: dict[str, JsonValue] | None = None,
metadata: dict[str, JsonValue] | None = None,
mark_state_updated: bool = False,
) -> None
Update mutable metadata for a thread.
Source code in src/skeino/persistence/base.py
search_thread_rows
async
¶
search_thread_rows(
request: ThreadSearchRequest,
) -> list[ThreadRow]
delete_thread
async
¶
create_run
async
¶
create_run(
run_id: str,
thread_id: str,
assistant_id: str,
metadata: dict[str, JsonValue],
kwargs: dict[str, JsonValue],
multitask_strategy: MultitaskStrategy,
) -> RunRow
Insert a run row and return it.
Source code in src/skeino/persistence/base.py
update_run_status
async
¶
RunRow
¶
Bases: TypedDict
Uniform run row shape every metadata store returns.
ThreadRow
¶
Bases: TypedDict
Uniform thread row shape every metadata store returns.
CheckpointerSpec
dataclass
¶
Declarative request for a checkpointer instance.
InMemoryMetadataStore
¶
Dict-backed thread + run metadata store.
Initialise empty thread and run maps.
Source code in src/skeino/persistence/in_memory_store.py
setup
async
¶
create_thread
async
¶
create_thread(
thread_id: str,
*,
metadata: dict[str, JsonValue],
config: dict[str, JsonValue],
ttl: ThreadTtlConfig | None,
if_exists: ThreadIfExists,
) -> ThreadRow
Insert a thread row and return it.
Source code in src/skeino/persistence/in_memory_store.py
update_thread
async
¶
update_thread(
thread_id: str,
*,
status_value: ThreadStatus | None = None,
config: dict[str, JsonValue] | None = None,
metadata: dict[str, JsonValue] | None = None,
mark_state_updated: bool = False,
) -> None
Update mutable thread fields.
Source code in src/skeino/persistence/in_memory_store.py
search_thread_rows
async
¶
search_thread_rows(
request: ThreadSearchRequest,
) -> list[ThreadRow]
List thread rows respecting basic filter / pagination flags.
Source code in src/skeino/persistence/in_memory_store.py
delete_thread
async
¶
Delete a thread and its run rows.
Source code in src/skeino/persistence/in_memory_store.py
create_run
async
¶
create_run(
run_id: str,
thread_id: str,
assistant_id: str,
metadata: dict[str, JsonValue],
kwargs: dict[str, JsonValue],
multitask_strategy: MultitaskStrategy,
) -> RunRow
Insert a run row and return it.
Source code in src/skeino/persistence/in_memory_store.py
update_run_status
async
¶
Update a run's status field.
Source code in src/skeino/persistence/in_memory_store.py
fetch_run_row
async
¶
fetch_run_row(thread_id: str, run_id: str) -> RunRow | None
Return a run row scoped to thread_id.
Source code in src/skeino/persistence/in_memory_store.py
list_run_rows
async
¶
list_run_rows(
thread_id: str,
*,
limit: int,
offset: int,
status_value: RunStatus | None,
) -> list[RunRow]
List runs for a thread sorted newest-first.
Source code in src/skeino/persistence/in_memory_store.py
MetadataStore
¶
Persist thread and run metadata alongside LangGraph checkpoints.
Store the PostgreSQL connection string used for metadata operations.
Source code in src/skeino/persistence/metadata_store.py
setup
async
¶
Create the metadata tables if they do not already exist.
Source code in src/skeino/persistence/metadata_store.py
fetch_thread_row
async
¶
fetch_thread_row(thread_id: str) -> ThreadRow | None
Return the stored metadata row for a thread.
Source code in src/skeino/persistence/metadata_store.py
create_thread
async
¶
create_thread(
thread_id: str,
*,
metadata: dict[str, JsonValue],
config: dict[str, JsonValue],
ttl: ThreadTtlConfig | None,
if_exists: ThreadIfExists,
) -> ThreadRow
Insert a thread row and return the stored record.
Source code in src/skeino/persistence/metadata_store.py
update_thread
async
¶
update_thread(
thread_id: str,
*,
status_value: ThreadStatus | None = None,
config: dict[str, JsonValue] | None = None,
metadata: dict[str, JsonValue] | None = None,
mark_state_updated: bool = False,
) -> None
Update mutable metadata for a thread.
Source code in src/skeino/persistence/metadata_store.py
delete_thread
async
¶
Delete a thread row and its run rows.
Source code in src/skeino/persistence/metadata_store.py
search_thread_rows
async
¶
search_thread_rows(
request: ThreadSearchRequest,
) -> list[ThreadRow]
Return stored thread rows before graph-state enrichment.
Source code in src/skeino/persistence/metadata_store.py
create_run
async
¶
create_run(
run_id: str,
thread_id: str,
assistant_id: str,
metadata: dict[str, JsonValue],
kwargs: dict[str, JsonValue],
multitask_strategy: MultitaskStrategy,
) -> RunRow
Insert a run row and return it.
Source code in src/skeino/persistence/metadata_store.py
update_run_status
async
¶
Update the persisted run status.
Source code in src/skeino/persistence/metadata_store.py
fetch_run_row
async
¶
fetch_run_row(thread_id: str, run_id: str) -> RunRow | None
Return a single run row for a thread.
Source code in src/skeino/persistence/metadata_store.py
list_run_rows
async
¶
list_run_rows(
thread_id: str,
*,
limit: int,
offset: int,
status_value: RunStatus | None,
) -> list[RunRow]
List run rows for a thread.
Source code in src/skeino/persistence/metadata_store.py
MongoMetadataStore
¶
MongoDB-backed thread + run metadata store (MetadataStoreProtocol).
Store the URI; db_name defaults to the URI's path, else "skeino".
Source code in src/skeino/persistence/mongo_store.py
setup
async
¶
Open the motor client (lazily) and ensure indexes.
Source code in src/skeino/persistence/mongo_store.py
aclose
async
¶
fetch_thread_row
async
¶
fetch_thread_row(thread_id: str) -> ThreadRow | None
Return the stored row for thread_id (or None).
Source code in src/skeino/persistence/mongo_store.py
create_thread
async
¶
create_thread(
thread_id: str,
*,
metadata: dict[str, JsonValue],
config: dict[str, JsonValue],
ttl: ThreadTtlConfig | None,
if_exists: ThreadIfExists,
) -> ThreadRow
Insert a thread document and return its row.
Source code in src/skeino/persistence/mongo_store.py
update_thread
async
¶
update_thread(
thread_id: str,
*,
status_value: ThreadStatus | None = None,
config: dict[str, JsonValue] | None = None,
metadata: dict[str, JsonValue] | None = None,
mark_state_updated: bool = False,
) -> None
Update mutable thread fields.
Source code in src/skeino/persistence/mongo_store.py
search_thread_rows
async
¶
search_thread_rows(
request: ThreadSearchRequest,
) -> list[ThreadRow]
Return stored thread rows (filtered by ids/status, sorted, paginated).
Source code in src/skeino/persistence/mongo_store.py
delete_thread
async
¶
Delete a thread and its run documents.
create_run
async
¶
create_run(
run_id: str,
thread_id: str,
assistant_id: str,
metadata: dict[str, JsonValue],
kwargs: dict[str, JsonValue],
multitask_strategy: MultitaskStrategy,
) -> RunRow
Insert a run document and return its row.
Source code in src/skeino/persistence/mongo_store.py
update_run_status
async
¶
Update a run's status field.
Source code in src/skeino/persistence/mongo_store.py
fetch_run_row
async
¶
fetch_run_row(thread_id: str, run_id: str) -> RunRow | None
Return a run row scoped to thread_id.
Source code in src/skeino/persistence/mongo_store.py
list_run_rows
async
¶
list_run_rows(
thread_id: str,
*,
limit: int,
offset: int,
status_value: RunStatus | None,
) -> list[RunRow]
List runs for a thread sorted newest-first.
Source code in src/skeino/persistence/mongo_store.py
SqliteMetadataStore
¶
SQLite-backed thread + run metadata store satisfying MetadataStoreProtocol.
Store the SQLite path/URI (a file path, :memory:, or sqlite://).
Source code in src/skeino/persistence/sqlite_store.py
setup
async
¶
Open the connection (lazily importing aiosqlite) and create tables.
Source code in src/skeino/persistence/sqlite_store.py
aclose
async
¶
fetch_thread_row
async
¶
fetch_thread_row(thread_id: str) -> ThreadRow | None
Return the stored row for thread_id (or None).
Source code in src/skeino/persistence/sqlite_store.py
create_thread
async
¶
create_thread(
thread_id: str,
*,
metadata: dict[str, JsonValue],
config: dict[str, JsonValue],
ttl: ThreadTtlConfig | None,
if_exists: ThreadIfExists,
) -> ThreadRow
Insert a thread row and return it.
Source code in src/skeino/persistence/sqlite_store.py
update_thread
async
¶
update_thread(
thread_id: str,
*,
status_value: ThreadStatus | None = None,
config: dict[str, JsonValue] | None = None,
metadata: dict[str, JsonValue] | None = None,
mark_state_updated: bool = False,
) -> None
Update mutable thread fields.
Source code in src/skeino/persistence/sqlite_store.py
search_thread_rows
async
¶
search_thread_rows(
request: ThreadSearchRequest,
) -> list[ThreadRow]
Return stored thread rows (filtered by ids/status, sorted, paginated).
Source code in src/skeino/persistence/sqlite_store.py
delete_thread
async
¶
Delete a thread and its run rows.
Source code in src/skeino/persistence/sqlite_store.py
create_run
async
¶
create_run(
run_id: str,
thread_id: str,
assistant_id: str,
metadata: dict[str, JsonValue],
kwargs: dict[str, JsonValue],
multitask_strategy: MultitaskStrategy,
) -> RunRow
Insert a run row and return it.
Source code in src/skeino/persistence/sqlite_store.py
update_run_status
async
¶
Update a run's status field.
Source code in src/skeino/persistence/sqlite_store.py
fetch_run_row
async
¶
fetch_run_row(thread_id: str, run_id: str) -> RunRow | None
Return a run row scoped to thread_id.
Source code in src/skeino/persistence/sqlite_store.py
list_run_rows
async
¶
list_run_rows(
thread_id: str,
*,
limit: int,
offset: int,
status_value: RunStatus | None,
) -> list[RunRow]
List runs for a thread sorted newest-first.
Source code in src/skeino/persistence/sqlite_store.py
open_checkpointer
async
¶
open_checkpointer(
uri: str | None = None,
*,
scheme: str | None = None,
setup_schema: bool = True,
options: dict[str, Any] | None = None,
) -> AsyncIterator[BaseCheckpointSaver]
Yield a checkpointer instance, releasing its resources on exit.
Resolution: an explicit scheme wins; otherwise it is derived from the
uri; falling back to memory when both are absent.
Source code in src/skeino/persistence/checkpointer.py
register_checkpointer
¶
Register a checkpointer builder for one or more URI schemes.
Source code in src/skeino/persistence/checkpointer.py
Streaming¶
streaming
¶
Streaming layer: SSE encoding, retry, graph dispatch.
Streamer
¶
Dispatch graph streams across the supported LangGraph stream modes.
Capture the graph and resolve its declared output keys for filtering.
Source code in src/skeino/streaming/runner.py
stream
async
¶
stream(
runnable_input: Any,
config: dict[str, Any],
request: RunCreateRequest,
stream_modes: list[str],
) -> AsyncIterator[tuple[str, dict[str, JsonValue]]]
Yield (event_name, payload) tuples for one streaming run.
Source code in src/skeino/streaming/runner.py
is_retriable_stream_error
¶
Return True for transient errors worth retrying during graph streaming.