Sessions and conversation threads
Keep Core run coordination distinct from application-owned durable conversation history.
Use sessions to serialize related runs
Core SessionRuntime groups runs and reserves a session's active-run identity before dispatch. Its SessionStore tracks coordination state; it is not a product conversation repository.
import {
createSessionRuntime,
InMemorySessionStore,
} from "@smoothie-framework/runtime/agent/session";
// agent is an application-owned Agent.
const sessions = createSessionRuntime({
agent,
sessionStore: new InMemorySessionStore(),
});In-memory storage is for local development. Choose a durable implementation for persisted sessions and recover exact orphaned reservations only under exclusive host ownership.
Persist application transcripts separately
agent-threads defines ThreadRepository for owner-scoped input, output and outcomes. It also supplies admission and queued/steering input coordination. The host owns its repository implementation, schemas, retention and authorization.
Persist accepted application input before inference dispatch. SessionRuntime's awaited beforeDispatch callback can provide that barrier. A failure there must not be treated as an accepted run.
Joined execution and publication belong to Application execution ownership. Selecting transcript history for a model remains a separate context decision.