# Overview

Canonical URL: https://developers.iagenify.com/sdk/agent/sessions/
Language: en

An agent with memory keeps its conversation beyond the process. The account holds what was said and what was used; the device holds the detail — and tool results never leave the device.

Status: memory: true · hybrid storage · reopen from anywhere

A run without `memory` lives in the object and disappears with it. With `memory: true` the agent is a session: it has an identifier from the moment it is created, and the conversation survives a restart.

## The split, which is the whole design {#split}

| Kept | Where | So that |
| --- | --- | --- |
| The messages, and each tool call's name, short target, success, credits and duration | On the account | Any device can reopen the conversation and show what happened. |
| **The content of tool results** | On the device only | What a file contains, what a database returned, what a page said — none of it is stored by the platform. |

> **This is why reopening elsewhere is partial by design**
>
> On the device that ran it, the journal gives a complete resume. From another device, the conversation and the list of tools used come back, without what the tools returned. That is not a limitation to be fixed — it is what keeps a session from being a copy of your files.

## Using one {#using}

```javascript
const agent = api.agents.create({
  runtime: "local", machine: pc, model: "gemini-3.5-flash",
  memory: true,
});

agent.id;                       // already set, before the first run
await agent.run({ inputs: "Read the notes and list what is unfinished." });

// Another process, later
const again = api.agents.get(agent.id, { machine: pc });
await again.run({ inputs: "Now do the first one." });
```

## Finding them again {#listing}

```javascript
const sessions = await api.agents.list({ limit: 30 });   // most recent first
```

## What a session unlocks {#what-else}

- [Checkpoints](/sdk/agent/checkpoints) — rewinding to an earlier message needs a session.
- [Compaction](/sdk/agent/context/compaction) that survives a restart.
- `recall` — searching earlier conversations of the account.
- A title, taken from the first message, for showing in a list.

## Ending one {#ending}

```javascript
await agent.destroy();   // the account's copy, the device journal, and its checkpoints
```

A refusal from the account is raised rather than swallowed: a session that still exists must not be reported as gone. A session that was never written answers as destroyed, which is the outcome asked for.

- [memory: true](/sdk/agent/sessions/memory): What turning it on changes.
- [The device journal](/sdk/agent/sessions/journal): Where the detail lives.
- [Resuming](/sdk/agent/sessions/resuming): Reopening here, and reopening elsewhere.

```python
agent = api.agents.create(
    runtime="local", machine=pc, model="gemini-3.5-flash",
    memory=True,
)

agent.id                        # already set, before the first run
agent.run(inputs="Read the notes and list what is unfinished.")

# Another process, later
again = api.agents.get(agent.id, machine=pc)
again.run(inputs="Now do the first one.")
```

```python
sessions = api.agents.list(limit=30)   # most recent first
```

```python
agent.destroy()   # the device journal and its checkpoints
```
