Skip to content

Commit 26295be

Browse files
committed
fix memory docs
1 parent 66c72b3 commit 26295be

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/content/docs/blades/tutorials/02-memory.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ reference: ["https://github.com/go-kratos/blades/tree/main/examples/tools-memory
66

77
In multi-turn and multiple sessions, an Agent often needs to "remember what happened before": such as user preferences, historical conclusions, previously confirmed facts, etc. Blades provides Memory capabilities for storing and retrieving information across multiple Sessions, allowing the Agent to "recall" context in new conversations, thereby reducing repetitive questioning and improving consistency.
88

9-
## What problem does Memory solve?
9+
### What problem does Memory solve?
1010

1111
- Session / State addresses the organization and temporary data management "within the current conversation thread" (the tutorial is covered in the previous chapter).
1212
- Memory is oriented towards "historical information across multiple sessions," which can be retrieved to assist in current responses. It can be understood as the Agent's "retrievable archive/knowledge base."
1313

14-
## Enabling the Agent with Memory Retrieval Capabilities
14+
### Enabling the Agent with Memory Retrieval Capabilities
1515
The Memory usage process in Blades can be summarized in 4 steps:
1616
1. Create a MemoryStore (memory library)
1717
2. Create a MemoryTool (enabling the Agent to actively retrieve memories)
1818
3. Inject the MemoryTool into the Agent (WithTools), then run the conversation
1919

20-
## Creating a Memory Database
20+
### Creating a Memory Database
2121

2222
NewInMemoryStore() creates an in-memory version of MemoryStore, suitable for examples and local development.
2323

2424
```go
2525
memoryStore := memory.NewInMemoryStore()
2626
```
2727

28-
## Creating an Agent and Adding Memory Tools
28+
### Creating an Agent and Adding Memory Tools
2929

3030
In the Agent configuration, add `memory tools` (the example uses blades.WithTools(memoryTool)), and prompt the model in the Instruction to "use the Memory tool when necessary to query memory content."
3131

@@ -73,4 +73,4 @@ func main() {
7373
}
7474
log.Println(output.Text())
7575
}
76-
```
76+
```

src/content/docs/zh-cn/blades/tutorials/02-memory.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ reference: ["https://github.com/go-kratos/blades/tree/main/examples/tools-memory
66

77
在多轮、多次会话中,Agent 往往需要“记住以前发生过什么”:例如用户偏好、历史结论、曾确认过的事实等。Blades 提供 Memory 能力,用于跨多个 Session 进行信息存储与检索,让 Agent 在新对话里也能“回忆”上下文,从而减少重复提问、提升一致性。
88

9-
## Memory 解决什么问题?
9+
### Memory 解决什么问题?
1010

1111
- Session / State 解决的是“当前对话线程内”的组织与临时数据管理(教程在上一章展开)。
1212
- Memory 面向的是“跨多个 session 的历史信息”,可被检索出来辅助当前回答,可理解为 Agent 的“可检索档案库/知识库”
1313

14-
## 让 Agent 具备记忆检索能力
14+
### 让 Agent 具备记忆检索能力
1515
Blades 的 Memory 使用流程可以概括为 4 步:
1616
1. 创建 MemoryStore(记忆库)
1717
2. 创建 MemoryTool(让 Agent 能主动检索记忆)
1818
3. 把 MemoryTool 注入 Agent(WithTools),再运行对话
1919

20-
## 创建记忆数据库
20+
### 创建记忆数据库
2121

2222
NewInMemoryStore() 会创建一个内存版的 MemoryStore,适合示例与本地开发。
2323

2424
```go
2525
memoryStore := memory.NewInMemoryStore()
2626
```
2727

28-
## 创建 Agent 并添加记忆工具
28+
### 创建 Agent 并添加记忆工具
2929

3030
在创建 Agent 配置 `记忆工具`(示例使用 blades.WithTools(memoryTool)),并在 Instruction 里提示模型“必要时使用 Memory 工具进行查询记忆内容”。
3131

0 commit comments

Comments
 (0)