What is a Session?
A Session represents a single execution attempt of an agent. It answers questions like:- Did my agent run?
- Is it running, waiting, completed, or failed?
- What state did it produce?
- Is it waiting for human input?
- What happened during this run?
- a conversation
- a workflow
- a background job
- a LangChain run
OpenSink never executes your agent. It only stores what happened during execution.
Why Sessions exist
Once agents move beyond experiments, teams need:Resumability
Pause execution, wait for input, and resume without losing state.
Visibility
See what agents are doing, when they ran, and what they produced.
Control
Safely introduce human approval without rebuilding infrastructure.
Durability
Persist state outside memory, processes, and prompts.
Session lifecycle
A Session progresses through a small, intentional state machine:Session state
Each Session contains a state object. This state:- is controlled entirely by the agent
- persists across pauses and restarts
- is not interpreted by OpenSink
State is not memory injection. It is durable system state owned by the agent.
Requesting input (human-in-the-loop)
Agents can pause execution and request input. This is how OpenSink enables:- approvals
- confirmations
- parameter selection
- safe execution
Example request
- the Session enters
waiting_for_input - OpenSink renders a UI from the schema
- execution stops
Resuming execution
When input is submitted:- OpenSink stores the response
- OpenSink calls your agent’s execution endpoint
- your agent loads the Session
- execution continues from state
- branch logic
- decide outcomes
- execute steps
Execution contract
Each agent exposes one execution endpoint:Example: Trading agent
Risk, Money, and Trading
A trading agent that:
- reads market news
- proposes trades
- waits for approval
- executes safely
- resumable execution
- approval checkpoints
- auditability
What Sessions intentionally do not do
❌ Orchestrate steps❌ Execute jobs
❌ Inject memory
❌ Define workflows
❌ Replace agent frameworks Sessions stay simple so your agents stay powerful.
When to use Sessions
Use Sessions when:- agents run in the real world
- humans must approve actions
- execution must be resumable
- failures must be visible

