local backend keeps sessions in process memory. It needs no external service and never touches disk — when the process exits, sessions are gone. It is the default backend of ShortTermMemory.
When to use
- Local development and debugging;
- Unit tests, example scripts, and other ephemeral scenarios;
- When sessions don’t need to survive across processes or restarts.
Usage
chat_01, confirming that the session was created and read back. This example does not call a model. For conversations, pass the same stm to Runner(short_term_memory=stm, agent=agent) and keep the app, user, and session identifiers consistent
Because local is the default, the following select in-memory storage; separate instances do not share sessions:
If the
Runner receives no short_term_memory or session_service, it automatically creates a local instance as a fallback, so running an agent locally needs no extra configuration.Parameters
local has no backend-specific settings. Use the common ShortTermMemory parameters below; most have no effect on local.
ShortTermMemory constructor parameters (local)
Environment variables
Thelocal backend reads no environment variables.