translation/translated/documents/course/03-agent-memory/23-testing-working-memory.md

26 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# 测试工作记忆
让我们测试智能体的工作记忆能力:
1. 使用上述配置更新您的智能体代码
2. 使用 `npm run dev` 重启开发服务器
3. 在 http://localhost:4111/ 打开 playground
4. 选择您的 "MemoryAgent"
5. 进行揭示个人信息的对话:
- "Hi, my name is Jordan"
- "I live in Toronto, Canada"
- "I prefer casual communication"
- "I'm interested in artificial intelligence and music production"
- "What do you know about me so far?"
您的智能体应该能够从其工作记忆中回忆所有这些信息,即使对话已经转向其他话题。
6. 继续包含新话题的对话,然后再次询问:
- "Let's talk about the latest AI developments"
- (进行关于 AI 的对话)
- "What was my name again and where do I live?"
智能体仍应记住此信息,因为它存储在工作记忆中,而不仅仅在对话历史记录中。
此测试展示了工作记忆如何允许您的智能体在不同话题和对话轮次中保持关于用户的持久信息。与只包含最近消息的对话历史记录不同,工作记忆提供了一种结构化方式来存储和检索关于用户的重要信息,无论它何时被提到。