# 内内:真实

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

`api.agents.create({ runtime: "local", memory: true })`

一种选项将代理商变成会话: 第一次运行前的标识符、 账户上的对话、 设备上的日记 以及需要两者的特性 。

Status: id before the first run · off by default · id implies it

## 身份识别特征立即存在 {#id}

```javascript
const agent = api.agents.create({ runtime: "local", machine: pc, model, memory: true });
agent.id;        // "6704f1c2a9b3d4e5f6a7b8c9" — before anything has run
```

由账户使用的形状的软件包生成, 界面可以进入对话, 保持在 URL,或在第一个消息发送前保存引用。 `id` 至 `agents.get()` 意 内 意 意 意 意 意 意 `memory: true`.

## 写下什么,什么时候写 {#written}

| 暂停 | 书面 |
| --- | --- |
| 您的消息已被接受 | 状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况 `running`和讯息。 |
| 每一步骤之后 | 助理信息 每个工具电话都记录一个 |
| 运行结束 | 状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况状况 `idle`,以及使用。 |
| 上下文压缩 | 这份摘要 以及日记中的紧凑状态 |

每个工具记录都带有名称、一个短目标、一条路径、一个查询、一个关键——它是否成功、它的成本和花费多长时间,它从未返回什么。

## A标题,列表标题 {#title}

第一个用户信息, 缩略到 70 个字符, 成为会话的标题。 是什么 [agents.list()](/zh/sdk/ref/agents/list) 显示。

## 没有它 {#without}

|  | 内存: 假( 默认) | 内内:真实 |
| --- | --- | --- |
| 过程结束后的谈话 | 已经 远 | 保留 |
| `agent.id` | `null` | 集集集集集集集集 |
| `getHistory()` | 记忆中的东西 | 取自账户 |
| 检查站和检查站 `rewind()` | 无可用 | 可用可用 |
| `history` 传递到 `run()` | 播下对话的种子 | 一旦届会有它自己的 |

失去记忆后,你仍然可以 自己通过路过,自己和自己 保持对话 `history` 对应对 `run()` ——这是正确的形状 当谈话属于你 自己的数据库,而不是我们的数据库。

## 费用 {#cost}

记录很小,日记在设备、工作空间或主目录上,见 [日记](/zh/sdk/agent/sessions/journal).

- [恢复执行](/zh/sdk/agent/sessions/resuming): 又捡起来了
- [getHistory()](/zh/sdk/ref/local-agent/get-history): 读回谈话。

```python
agent = api.agents.create(runtime="local", machine=pc, model=model, memory=True)
agent.id   # set before anything has run
```
