Session State

Persist and update a conversation’s task list with Planner.

This walkthrough follows Demo OS at the reviewed revision, which pins Agno 2.8.1. Use the application’s checked-in requirements.

Planner stores tasks in session_state and exposes tools for capture, status updates, deletion, listing, agendas, and daily planning. The Python variable is still named taskboard, while its registered ID and display name are planner and Planner.

The initial state in agents/taskboard/agent.py is:

session_state = {
    "tasks": [],
    "categories": ["general", "work", "personal"],
}

The Agent receives that mapping with enable_agentic_state=True and add_session_state_to_context=True. Its configured database persists session state, and the state is available to the model’s system context.

Session state vs memory vs dependencies

MechanismScope in this demo
Session stateThe task list associated with one session ID
User memoryPreferences that can be used across conversations
DependenciesValues supplied or resolved for a run
KnowledgeSearchable source material in its configured content/vector stores

The database session row is keyed by session_id; user_id is an associated identity used by authorization. Reusing a session ID for another user does not create an independent row.

CRUD via tools

The shipped add_task tool receives a RunContext, then updates its session state. Task records include a string ID such as T-001, title, priority, effort, category, status, due date, and blocked reason. New tasks start at todo.

update_task_status accepts a string task ID and a status such as in_progress, blocked, waiting, done, or cancelled. The source also supplies agenda, plan_my_day, and get_summary; it is more than a four-operation list editor.

The demo derives new IDs from the current list length. Removing a task and adding another can reuse an existing ID. Use this as a session-state demonstration and replace that ID strategy before relying on it for a durable task system.

When to use session state

Use it for mutable conversation data. With a database, returning to the same session later restores its state. A new session does not automatically inherit that task list; user memory and past-session search are separate configured capabilities.

See it in action

Select Planner after starting Demo OS:

Add a high-priority work task to review the release notes tomorrow.
Show my agenda.
Help me plan the next hour.

Inspect the saved session state, continue the same session, and compare it with a newly created conversation.

Next

agents/taskboard/agent.py · agents/taskboard/tools.py

Run Demo OS · Current AgentOS documentation