> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# session • AI Agent SDK

> Session persistence module for PraisonAI Agents.

# session

<Badge color="blue">AI Agent</Badge>

Session persistence module for PraisonAI Agents.

Provides automatic session persistence with zero configuration.
When a session\_id is configured on an Agent, conversation history
is automatically persisted to disk and restored on subsequent runs.

The session\_id is set through the Agent's memory configuration; Agent itself
has no top-level session\_id parameter.

Usage:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, MemoryConfig

# With session persistence (auto-enabled)
agent = Agent(
    name="Assistant",
    memory=MemoryConfig(session_id="my-session-123"),
)
agent.start("Hello")

# Later, new process - history is restored
agent = Agent(
    name="Assistant",
    memory=MemoryConfig(session_id="my-session-123"),
)
agent.start("What did I say before?")  # Remembers!

# The plain-dict spelling is equivalent:
#   Agent(name="Assistant", memory={"session_id": "my-session-123"})
```

Default storage: \~/.praisonai/sessions/\{session\_id}.json

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import session
```

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Session Management" icon="clock" href="/docs/docs/concepts/session-management" />

  <Card title="Sessions Feature" icon="folder" href="/docs/docs/features/sessions" />

  <Card title="Session Persistence" icon="database" href="/docs/docs/features/session-persistence" />
</CardGroup>
