参考Google Agents白皮书:
什么是Agent?
In its most fundamental form, a Generative AI agent can be defined as an application that
attempts to achieve a goal by observing the world and acting upon it using the tools that it
has at its disposal.
Agent的架构和组件?
Agent中的模型?
The model used by an agent can be one
or multiple LM’s of any size (small / large) that are capable of following instruction based
reasoning and logic frameworks, like ReAct, Chain-of-Thought, or Tree-of-Thoughts.
Tools 工具
Tools can take a variety of forms and have varying
depths of complexity, but typically align with common web API methods like GET, POST,
PATCH, and DELETE.
编排层
The orchestration layer describes a cyclical process that governs how the agent takes in
information, performs some internal reasoning, and uses that reasoning to inform its next
action or decision.
ReAct
React(Reasoning and Acting)框架是一种旨在通过逻辑推理和行动序列的构建,使大型语言模型(LLM)能够达成特定目标的方法。这一框架的核心思想是赋予机器模型类似人类的推理和行动能力,从而在各种任务和环境中实现更高效、更智能的解决方案。以下是React框架的一些关键点:
-
基础概念:
- React框架由Shunyu Yao等人在ICLR 2023会议上提出,旨在结合推理(Reasoning)和行动(Acting)。
- 通过生成“Thoughts”(思考),模型可以评估其行为的合理性,增加决策的可解释性和可信度。
-
工作原理:
- React框架的核心在于将推理和行动结合起来,通过以下三个关键概念实现:
- Thought(思考): 由LLM模型生成,帮助衡量LLM要采取的行为是否合理。
- Action(行动): 根据生成的“Thought”,模型执行具体的行动。
- Observation(观察): 行动后的结果被观察,以便调整后续的“Thought”。
- React框架的核心在于将推理和行动结合起来,通过以下三个关键概念实现:
-
优势:
- 推理和行动相结合:React让模型能够根据不同的任务需求,同时进行推理和行动,提高模型的性能和灵活性。
- 与外部环境交互:React让模型能够与外部环境(如维基百科API)交互,获取更多的知识,提高任务解决的准确性和可靠性。
- 可解释性和可信度:React的推理步骤和行动可以被人类理解和检查,提高模型的可解释性和可信度。
-
具体应用:
- 在处理复杂问题时,React框架通过逐步推理和行动,确保模型能够有效地解决问题。例如,在处理虚拟机热迁移失败的问题时,模型首先生成“Thought”,即需要查询虚拟机的热迁移记录,然后执行相应的查询操作,并根据结果调整后续的“Thought”。
总结来说,React框架通过结合推理和行动,使模型能够更灵活、更可靠地解决复杂问题,并且提高了模型的可解释性和可信度。