Files
chatgpt-on-wechat/docs/tools/memory.mdx
2026-02-27 16:03:47 +08:00

39 lines
1009 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: memory - 记忆
description: 搜索和读取长期记忆
---
# memory
记忆工具包含两个子工具:`memory_search`(搜索记忆)和 `memory_get`(读取记忆文件)。
## 依赖
无额外依赖,默认可用。由 Agent Core 的记忆系统管理。
## memory_search
搜索历史记忆,支持关键词和向量混合检索。
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `query` | string | 是 | 搜索查询 |
## memory_get
读取特定记忆文件的内容。
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `path` | string | 是 | 记忆文件的相对路径(如 `MEMORY.md`、`memory/2026-01-01.md` |
| `start_line` | integer | 否 | 起始行号 |
| `end_line` | integer | 否 | 结束行号 |
## 工作方式
Agent 会在以下场景自动调用记忆工具:
- 用户分享重要信息时 → 存储到记忆
- 需要参考历史信息时 → 搜索相关记忆
- 对话达到一定长度时 → 提取摘要存储