- 手把手带你从0到1实现大模型agent by @acedar-C大 https://www.bilibili.com/video/BV1Sz421m7Rr?spm_id_from=333.788.videopod.episodes&vd_source=17bc3f952f3aa47048893d0a5a16767c&p=2
- https://github.com/Yazooliu/agent_from_0t1/tree/main by @Yazooliu
首先我通过get.('speak')拿到当前Agent要说的东西,
但是Agent需要多轮思考再给我final_answer。
所以需要agent_scratch来思考总结多轮思考了什么,observation就是get.('speak')
一个简单的例子:
Round 1:
Thoughts: 我需要先查找用户信息。
Action: search_user
Observation: 找到了用户 Alice,她有3个订单。
Round 2:
Thoughts: 接下来我应该筛选出未完成的订单。
Action: filter_pending_orders
Observation: 找到2个未完成订单。
Round 3:
Thoughts: 我需要发送邮件提醒她。
Action: send_email
Observation: 邮件已成功发送。
功能:
记忆中间过程,帮助 Agent 记住之前干了什么
提供反思能力,让 Agent 能反思自己的计划是否有效
Prompt 组成部分,可以拼进下一轮的 Prompt 中,引导 LLM 产出更有连贯性的动作