Skip to content
OpenEightDeveloper docs
Docs / Agent runtime / Threads and checkpoints
SDK integration

Threads and checkpoints

Save a conversation between calls so your Agent can pick up where it left off.

On this pageKeep conversation state between calls

Keep conversation state between calls

A thread groups related messages and agent state into one conversation. For example, a support agent can remember an order mentioned in the first message when the customer asks a follow-up question.

A checkpoint is a saved snapshot of the agent’s graph state, including its conversation messages. A checkpointer (also called a saver) stores those snapshots, for example in SQLite. Reusing an authorized thread lets a managed Python agent read its saved state on the next call.

Use checkpoints when later calls need earlier context. Independent one-shot requests do not need a thread. Saving graph state does not prove that a refund, email or other external action completed.

Thread lifetime

This example uses a thread ID that belongs to one open Agent session. SQLite keeps the messages on disk after the session ends. If the conversation must survive a restart, use an application-authorized thread from the first call.

Install a supported SQLite checkpointer

pip install 'openeight[langchain-durable]'

Send two messages on the same thread

This snippet runs inside your application. Supply your configured model, test tools without external effects, and openeight_config. Get the connection configuration →

The resource factory opens SQLite on the SDK’s event loop and keeps the connection open until the Agent finishes the work it has accepted. Use an explicit agent context for the whole conversation.

PythonYour application · same-session conversation
from contextlib import asynccontextmanager
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver
from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer
from openeight.managed import ManagedResources
from openeight.langchain import create_agent

@asynccontextmanager
async def resources():
    async with AsyncSqliteSaver.from_conn_string("checkpoints.sqlite") as saver:
        saver.serde = JsonPlusSerializer(pickle_fallback=False)
        yield ManagedResources(checkpointer=saver)

with create_agent(
    model=model,
    tools=tools,
    openeight=openeight_config,
    resources=resources,
) as agent:
    thread_id = agent.new_thread()
    config = {"configurable": {"thread_id": thread_id}}

    first = agent.invoke(
        {"messages": [("user", "Remember order ORD-1041. Take no action.")]},
        config=config,
    )
    follow_up = agent.invoke(
        {"messages": [("user", "Which order did I mention?")]},
        config=config,
    )
    print(follow_up)
    agent.release_thread(thread_id)

Expected result: the second call receives the earlier conversation state, so the model can answer with ORD-1041. Both calls use the same thread ID; a newly issued thread starts a separate conversation. Inspect the returned messages to check your model’s answer.

Use only IDs issued by this entered agent. Calls on one thread must run sequentially. Release the thread after the conversation finishes; release invalidates that ID for this owner without deleting saved database rows.

Continue after a session closes

For managed Python threads that must outlive an agent session, configure OpenEightConfig.checkpoints with an application-owned CheckpointAccess adapter. Pass the thread ID in configurable.thread_id on each call. The SDK rejects new_thread() and release_thread() in this mode. Your application authenticates the caller, authorizes the exact thread and namespace, retains enrollment and execution records, and holds an exclusive guard shared by every writer.

Qualified SQLite and PostgreSQL savers can store native graph state. The supported enrollment path uses one process; distributed writers and expiring leases are unsupported. Continuation selects the latest saved state. Adopting an existing native history requires explicit authorization, quiescent state and reconciliation of earlier external effects.

Reconcile effects before retrying

Checkpoints preserve graph state; they do not provide business-effect recovery or long-approval scheduling. If an action or stored execution is uncertain, reconcile the original attempt before retrying. MCP with checkpointing is unsupported.

Need help integrating threads and checkpoints?

Tell us your framework, SQLite or PostgreSQL choice, and whether conversations need to survive a restart. We’ll help you choose the thread-access and persistence approach. Keep credentials and private application data out of your message.

OpenEight / Developer docsPython SDK 0.0.1

Search documentation

Build with OpenEightBuild or connect an agent, configure its controls, and inspect its activity.
Build your first agentDefine a model and tools, create an agent with OpenEight, configure policies, and run it.
Connect an existing agentKeep your existing model, tools, and agent logic. Add the OpenEight Python SDK where your agent calls tools so a policy can allow a call, block it, or pause it for approval.
Refund walkthroughSee how OpenEight checks a refund before the tool runs. USD refunds through $100 can proceed. Larger USD refunds and refunds in other currencies wait for a reviewer. All receipts in this walkthrough are simulated.
Integrate LangChainConnect your existing LangChain agent to OpenEight and verify its first governed tool call.
Integrate Deep AgentsConnect your existing Deep Agents agent to OpenEight and verify its first governed tool call.
Custom integrationsUse OpenEight with an Agent that calls tools directly or uses another framework.
Observe without enforcementConnect your Agent’s OpenTelemetry exporter to see Runs and tool activity in OpenEight. Tool calls proceed without policy checks or approval requests.
How governance worksBefore your Agent runs a governed tool, OpenEight checks the request against its active policies.
Prepare tools for governanceCheck how OpenEight classifies your Agent’s tools and confirm the intent Assist will use to draft policies.
Create policies with AssistAssist drafts rules and test cases from a policy intent. Review what the rules allow, deny or hold for approval before activating them.
Handle approvalsReview a pending tool call and decide whether the Agent may continue.
Inspect decisionsSee how your policies applied to a tool call and find out whether it executed.
Inspect runs and eventsOpen a Run to see which tools your Agent called, how long they took, and what status the Agent reported.
Configure model pricingModel rates apply across every Workspace in your organization. OpenEight uses them to calculate spend from recorded usage.
Set Agent budgetsSet cost and token limits for an Agent.
Send approval notifications to SlackSend approval requests to a Slack channel so reviewers can open them in the OpenEight Console.
Export and verify evidenceExport a Workspace evidence bundle, establish trust in its signing key, and verify recorded evidence offline with the OpenEight CLI.
TroubleshootingDiagnose SDK startup, tool publication, approval, and delivery issues.
Calls and sessionsChoose when to open a session and how to manage resources across calls.
Stream results and clean upRead incremental agent results and release resources when a reader stops early.
Threads and checkpointsSave a conversation between calls so your Agent can pick up where it left off.
Delivery and shutdown checksFlush buffered work and inspect delivery before shutdown.
Compatibility and installationFind your integration, supported runtime and SDK version.
ConfigurationConfigure connection settings, approval waiting and content capture.
Constructors and executionCreate an agent and choose its invocation methods.
LangChain optionsLook up structured output, configurable models and LangChain execution limits.
Deep Agents optionsConfigure root and child tools, filesystem permissions and MCP sources.
Tool publication and readinessPublish tool schemas, find acknowledged versions and check policy readiness.
Approval waiting and replayA managed Agent can wait in the running process or return a waiting thread for your code to resume. With a direct Python client, your code polls and replays the request.
Python API signaturesLook up parameters, defaults and return types for OpenEight Python SDK 0.0.1.