# Overview

Canonical URL: https://developers.iagenify.com/sdk/ref/assistant-session/
Language: en

What create() and get() hand back: a conversation you can keep asking, with its configuration attached.

Status: 3 methods · 1 property · memory on by default

You never construct one. It comes from [api.models.create()](/sdk/ref/models/create) for a new conversation, or [api.models.get(id)](/sdk/ref/models/get) for one you are resuming.

## The surface {#surface}

| Member | Does |
| --- | --- |
| generate({ inputs, outputs }) | Asks. This is the one that spends. |
| getHistory() | Reads what was said, without adding to it. |
| destroy() | Deletes the session and its messages. |
| data | The configuration, as a plain object. |

```javascript
const assistant = await api.models.create({ model: "gemini-3.5-flash" });

assistant.id;         // keep this — it is all you need to come back
assistant.model;
assistant.settings;
assistant.schema;
assistant.memory;     // true unless you asked otherwise
assistant.title;      // named by the first message
assistant.createdAt;
assistant.updatedAt;
```

## The shape of using one {#lifecycle}

```javascript
// Open, and remember which conversation this is
const assistant = await api.models.create({ model: "gemini-3.5-flash" });
await db.save({ userId, sessionId: assistant.id });

// Ask, as many times as the conversation needs
await assistant.generate({ inputs: [{ type: "text", content: "…" }] });

// Later, anywhere, any process
const again = await api.models.get(await db.load(userId));

// And when it is over
await again.destroy();
```

> **The object is a handle, not the conversation**
>
> The conversation is on the server. Two handles to the same id are the same conversation, and nothing is lost by throwing one away.

## What you cannot change {#no-settings}

The model, the settings and the schema are fixed when the session is created. There is no method to change them — to answer differently, open another session. That is deliberate: a conversation whose rules changed halfway is one whose history no longer explains its answers.

- [generate()](/sdk/ref/assistant-session/generate): Asking, what comes back, and what it costs.
- [api.models.create()](/sdk/ref/models/create): Where a session's behaviour is decided.

```python
assistant = api.models.create(model="gemini-3.5-flash")

assistant.id           # keep this — it is all you need to come back
assistant.model
assistant.settings
assistant.schema
assistant.memory       # True unless you asked otherwise
assistant.title        # named by the first message
assistant.created_at
assistant.updated_at
```

```python
# Open, and remember which conversation this is
assistant = api.models.create(model="gemini-3.5-flash")
db.save(user_id=user_id, session_id=assistant.id)

# Ask, as many times as the conversation needs
assistant.generate(inputs=[{"type": "text", "content": "…"}])

# Later, anywhere, any process
again = api.models.get(db.load(user_id))

# And when it is over
again.destroy()
```
