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

# Multi-turn session

> Keep context across turns; persist and resume by id.

`client.run(...)` is one-shot — each call is an independent conversation. Open a
**session** to keep context across turns: every `run` on it reuses one
conversation, so the agent remembers earlier turns.

```python theme={null}
from cosmon_agent_sdk import Client

with Client() as client:
    with client.session(agent="solidworks") as chat:
        chat.run("Mesh bracket.sldprt").text()
        chat.run("Now double the load and re-run").text()   # remembers the mesh
        saved = chat.id                                      # persists after close

    with client.session(id=saved) as chat:                   # resume later
        print(chat.run("What load did we end up with?").text())
        chat.delete()                                        # remove it entirely
```

Leaving the `with` block ends the session; the conversation **persists**
server-side (hidden from the app) until you `delete()` it — or open it with
`ephemeral=True` to delete on close. `client.chats()` lists what your scripts
left behind.

<Card title="Guide: multi-turn sessions" icon="book-open" href="/sdk/guide#multi-turn-sessions">
  Entry agent vs. following a handoff, persistence, and cleanup.
</Card>
