All primitives

Agents

Session Storage for Agents

Give your AI agent a memory of its work. Session Storage preserves relevant context, working state, and progress between interactions.

The idea

Pick up the work, not just the conversation.

Imagine building an AI travel planner. You tell it, “I want to visit Japan for two weeks in April,” then add that you prefer small towns and traditional architecture.

Later, you return and ask, “Can you update my itinerary?” Without stored context, the agent may not know which itinerary you mean. Session Storage lets it continue with the relevant context and progress already in hand.

Application blip

AI Travel Planner

Session active

Conversation

Japan · April

4 saved messages
You
Plan a trip to Japan.
AI Travel Planner
What kind of places do you enjoy?
You
Small towns and traditional architecture.
AI Travel Planner
I’ll focus on places like Takayama and Kanazawa.

Close the session, resume it, then ask about the saved itinerary.

Saved context
Structured memory the agent can reuse.
Active
Destination
Japan
Timeline
Two weeks in April
Preferences
Small towns · Traditional architecture
Places chosen
Takayama · Kanazawa
The conversation and these details travel together when the session resumes.

Demo only: session state lives in this page's memory. A production agent would persist session data in server-side storage so it survives a page refresh.

Behind the scenes

A session carries its state forward.

  1. Conversation
  2. Session state
  3. Persistent storage
  4. Restored context

The agent saves meaningful context and checkpoints to persistent storage, then restores that state when the session resumes.

What could you build?

  • Personal assistants
  • Multi-step AI workflows
  • Research agents
  • Customer support agents

Implementation notes

  • Give each session a stable ID and owner.
  • Persist checkpoints after meaningful steps.
  • Resume from stored state, not chat text alone.
  • Define retention and deletion rules for sensitive context.

Implementing it

With a coding agent

Ask your agent to remember its work

Agent setup (mock link)

Copy this prompt, fill in the bracketed details, and paste it into your coding agent. It describes the goal, what to remember, and the guardrails.

Bracketed text marks details only you can fill in. 808 / 6,000 characters.

Fill in:AGENT NAME OR PURPOSEUSER OR TASKSTEPS WORTH SAVINGSTATE TO REMEMBERSENSITIVE CONTEXTIMPORTANT RESUME, CHECKPOINT, AND ACCESS CASES

Strong prompt · 76/100

Traditional SDK / API

Create a travel-planning session

TypeScript
const session = await ultrahost.sessions.create({
  agent: "travel-planner",
  subject: user.id,
  metadata: { destination: "Japan" },
})

Key takeaway

Session Storage lets an agent continue where it left off instead of starting from scratch.

Next primitive

File Server