Thread
A thread is one agent's working line: its status, its record and its budget.
It goes with a second word. A session is what a person opens: an Ask or a project. A session is the thing with a title and an owner. A thread is the thing that runs.
Why it exists
A person thinks in sessions: "my Oak Street project", "the question I asked yesterday". The platform runs threads: one agent, one conversation, one place to stop and carry on from. Keeping the two apart lets a session hold several agents at work, each in a thread of its own with its own record and budget, without the person having to care.
The words are LangGraph's, which the runtime is built on, so what these pages call a thread is a thread there too.
An example
Session Oak Street refinance a project, owned by J. Rivera
Thread the project's own the agent that runs the project Waiting
Thread Deal summary a piece of work Done
Thread Credit memo a piece of work Working
1 user.message Open the summary for the Oak Street request.
2 llm.tool read_file references/application.pdf
3 tool.call read_file ok, kept as source E1
4 llm.tool send_message to the borrower
5 policy.decision Approve emails to people outside: approval needed
6 user.approval Approved by J. Rivera
7 tool.call send_message ok, kept as source E2
8 llm.answer The summary is handed in.
9 llm.verification 12 claims: 12 verified
How it works
Sessions and threads
| Session | Thread | |
|---|---|---|
| What it is | What a person opens | One agent's working line |
| Kinds | An Ask, a project | A session's own, a piece of work's, a monitor's check |
| Has | A title, an owner, who may see it | A status, a record, a budget |
| Made by | The Tenant API, when a person opens it | The runtime, when there is something to run |
A session has one thread of its own. Each piece of work it opens is another thread under that one. An agent that opens work for another agent adds a thread under its own, the same way.
Who a thread acts for
A thread has no owner of its own. It acts for its session's owner, and a piece of work's thread acts for the owner of the session it sits under. Every call it makes carries a short-lived token that names that person and the agent acting.
Mode
| Mode | What it means |
|---|---|
| Auto | Work is opened and handed in without asking first. Policies still ask where they say so |
| Manual | A person approves each change made to the work, and each hand-in |
The mode can be switched at any time. An org sets the mode new work begins in.
Budget
A thread has a budget: the input and output tokens it may spend over its whole life. An agent can also limit its model calls, tool calls or seconds of work.
- Input read from the provider's cache is not counted against it.
- Past the budget, the thread stops and asks the person it acts for whether to continue.
- Each continue adds half of the first budget.
Carrying on
A thread's state is kept as it goes. When a person answers a wait, or a runtime is replaced, the thread carries on from where it was.
States
A thread's. A session has none of its own: closing or stopping one changes its thread.
| State | Meaning |
|---|---|
| Queued | Waiting to be picked up |
| Working | An agent is working |
| Waiting | It waits for a person, or for another thread |
| Done | Finished |
| Failed | It could not go on |
| Stopped | It ended before it was done: by a person, on an error, or on its budget |
| Archived | Put away |
What always holds
- A thread acts for exactly one person.
- A thread is never seen more widely than its session.
- A budget nobody can measure is not spent. A model call that does not report what it used stops the thread.
- Nothing a thread starts runs outside what a person could see and stop.