Multi-Agent Conversation using CrewAI
Summary
TLDR大家好,我的新书《初学者指南:使用LLM构建生成性应用程序》已经在亚马逊上架,并且已经成为了畅销书。在视频中,我将讨论一个非常有趣的生成性AI框架——CRE AI,这是一个多代理对话框架。在这种框架中,我们可以根据问题陈述创建多个代理,例如产品经理、技术内容撰写者或工程专家。然后,我们将任务分配给这些代理集合,他们通过内部对话来提出最终解决方案,形成一个虚拟团队。CRE AI是一个非常激动人心的包,我最近在使用它,并且结果非常好。首先,我们将讨论CRE AI的不同组件,包括代理、目标、背景故事、任务定义以及集合和过程。接下来,我将展示如何使用Hugging Face Hub API加载LLM,并创建不同的代理来解决问题。我们还将看到如何通过顺序方法或层次方法来分配任务,并最终实例化一个团队并启动任务。CRE AI在处理复杂任务时表现出色,可以创建一个虚拟团队,而无需实际雇佣人员,只需擅长提示即可。
Takeaways
- 📚 作者发布了一本名为《初学者指南:使用LLM构建生成式应用程序》的新书,目前在亚马逊上已成为畅销书。
- 🤖 介绍了一个名为CRE AI的多代理对话框架,它允许用户根据问题创建多个代理(Agents)来共同解决问题。
- 🌟 代理可以有不同的角色,例如产品经理、技术内容撰写者或工程师,每个代理都有自己的目标和背景故事。
- 🔧 使用CRE AI框架时,可以通过pip安装creai包,并使用Hugging Face Hub API加载LLM模型。
- 🛠️ 通过定义代理的角色、目标和任务,可以创建一个虚拟团队来处理复杂的任务。
- 📈 介绍了两种使用CRE AI的方法:顺序方法和层级方法。顺序方法中,每个代理依次完成任务;层级方法中,代理可以委托其他代理完成任务。
- 📝 举例说明了如何使用CRE AI创建两个任务:一个由研究分析师完成的分析报告,和一个由内容策略师基于报告撰写的博客文章。
- 📊 展示了CRE AI如何通过代理间的对话和互动来生成最终的解决方案,例如列出主要的机器学习算法和撰写相关博客文章。
- 🎯 强调了CRE AI在处理复杂任务时的能力,以及如何通过精心设计的提示来实现无需实际团队即可完成任务的优势。
- 🚀 提及了CRE AI在未来的应用潜力,包括产品设计和技术开发讨论等更多复杂场景。
- 💡 整个演示展示了CRE AI如何作为一个强大的工具,通过多代理合作来提高工作效率和创造力。
Q & A
新书的名称是什么?
-新书的名称是《初学者指南:使用LLM构建生成性应用程序》。
新书在哪个平台发布并且表现如何?
-新书在亚马逊(Amazon)发布,并且已经成为了畅销书,目前在亚马逊畅销书排行榜上排名第三。
CRE AI是什么?
-CRE AI是一个多代理对话框架,允许用户根据问题陈述创建多个代理,这些代理可以是产品经理、技术内容撰写者或工程师等角色,并通过内部对话产生解决方案。
在CRE AI中,一个代理需要哪些组件来定义?
-一个代理需要角色(role)、目标(goal)、背景故事(backstory)、任务(task)以及是否允许委托(allow delegation)等组件来定义。
如何安装CRE AI?
-通过pip命令安装CRE AI,具体命令为`pip install creai`。
在CRE AI中,什么是序列化方法和层次化方法?
-序列化方法是给每个代理分配一个任务,然后按顺序执行。层次化方法则是允许一个代理委托任务给其他代理来完成,形成一个代理层级结构。
在CRE AI中,如何创建一个任务?
-创建任务需要指定任务列表、预期输出、代理角色等信息。例如,可以创建一个任务让研究分析师列出主要的机器学习算法,然后基于这些算法的洞察,由技术内容策略师发展出一个引人入胜的博客文章。
CRE AI如何帮助解决复杂任务?
-CRE AI通过模拟一个虚拟团队,每个代理扮演不同的角色,通过内部对话和任务分配来解决复杂任务,而无需实际雇佣人员。
在CRE AI中,如何使用Hugging Face Hub API加载语言模型?
-在CRE AI中,可以使用Hugging Face Hub API加载语言模型,例如使用`gamma 2 billion`模型,但需要提供有效的API令牌。
CRE AI的输出结果是如何展现的?
-CRE AI的输出结果是通过代理之间的对话和任务完成情况来展现的。例如,研究分析师代理可能会列出主要的机器学习算法,然后技术内容策略师代理会使用这些信息来撰写博客文章。
CRE AI可以用于哪些类型的任务?
-CRE AI可以用于需要多个角色或专业领域知识来解决的复杂任务,如产品设计、技术讨论、内容创作等。
如何启动CRE AI中的代理团队?
-通过实例化一个团队(crew),包含所需的代理、任务和过程,然后调用`crew.kickoff`方法来启动代理团队的工作流程。
Outlines
📚 新书发布与CRE AI框架介绍
本段首先宣布了作者的新书《Pocket Beginner's Guide to Building Gen Applications Using LLM》在亚马逊上发布,并且已经成为畅销书。接着,作者介绍了一个名为CRE AI的多代理对话框架。这个框架允许用户根据问题陈述创建多个代理,例如产品经理、技术内容撰写者或工程专家。这些代理将通过内部对话来共同解决问题。CRE AI是一个令人兴奋的包,作者最近使用它并取得了良好结果。接下来,作者详细介绍了CRE AI的不同组件,包括代理(Agent)、目标(Goal)、背景故事(Backstory)和任务(Task)。此外,还展示了如何使用Python的pip安装CRE AI,并通过Hugging Face的Hub API加载了一个名为Gamma 2 Billion的LLM模型。最后,作者创建了两个代理:一个高级研究分析师和一个技术内容策略师,并为它们分配了任务,说明了CRE AI的两种工作方式:顺序方法和层次方法。
🤖 CRE AI框架的应用实例
在第二段中,作者继续展示了如何使用CRE AI框架。首先定义了两个代理和两个任务,其中第二个任务使用了第一个任务的输出。然后,作者实例化了一个团队(Crew),该团队由研究分析师和作家组成,并启动了任务。输出显示了CRE AI如何通过内部的提示和对话过程来生成内容。第一个任务是列出主要的机器学习算法,由高级研究分析师完成。第二个任务是利用第一个任务的输出来扩展博客文章。最终,技术内容策略师使用算法的提示来撰写完整的博客文章。作者强调了CRE AI在处理复杂任务方面的潜力,并且可以创建一个虚拟团队,而无需实际雇佣人员,只需通过精心设计的提示即可实现。作者还提到,将在后续的例子中展示如何使用CRE AI结合多个代理来进行产品设计和讨论。
Mindmap
Keywords
💡Generative AI
💡CRE AI
💡Multi-agent Framework
💡Sequential Approach
💡Hierarchical Approach
💡Agent
💡Task
💡LLM (Large Language Model)
💡Crew
💡Prompting
💡Blog Post
Highlights
新书《Pocket Beginner's Guide to Building Gen Applications Using LLM》在亚马逊上发布并成为畅销书。
介绍了一个有趣的生成性AI框架CRE AI,这是一个多代理对话框架。
多代理框架可以根据问题陈述创建多个代理,如产品经理、技术内容撰写者、工程师等。
CRE AI允许创建虚拟团队,通过代理之间的对话来解决问题。
CRE AI的不同组件包括代理、角色、目标、背景故事、任务定义等。
使用pip安装CRE AI,并使用Hugging Face Hub API加载语言模型。
演示了如何创建不同的代理,如高级研究员和科技内容策略师。
展示了如何为代理分配任务,并说明了任务的顺序和层次结构方法。
CRE AI可以采用顺序方法,每个代理依次完成任务。
CRE AI也可以采用层次方法,允许代理委托任务给其他代理。
通过CRE AI,可以构建一个完整的公司场景,包括产品经理、开发者、技术领导等角色。
CRE AI在复杂任务中表现出色,可以创建虚拟团队而无需实际招聘人员。
CRE AI通过精心设计的提示和流程,可以自动处理任务。
展示了如何使用CRE AI进行产品设计和讨论,最终形成产品结构。
CRE AI的结果非常令人满意,可以在未来的示例中看到其在AMA中的应用。
CRE AI是一个令人兴奋的包,作者最近使用它并取得了良好的结果。
CRE AI可以处理复杂的任务,如产品管理和技术讨论,最终形成完整的解决方案。
CRE AI通过代理之间的对话和合作,能够生成有深度和广度的分析报告和博客文章。
Transcripts
so hi everyone my new book lanch in your
pocket beginner's guide to building gen
applications using llm is out now on
Amazon the book is already a best seller
as you can see it is trending on hash
three on Amazon best sellers so go grab
your copies and find the link in the
description below thank so hi everyone
today I will be talking about a very
interesting generative AI framework that
is cre AI which is a multi-agent
conversational framework so what do we
mean by a multi-agent framework in such
a framework we can create a number of
Agents depending upon our problem
statement like for example an agent can
be a product manager other agent can be
a tech content writer the third person
can be a great with engineering and
eventually then we will be giving a task
to these collection of agents and then
they having conversation within
themselves would be coming out with the
final solution so this is how it it can
be taken as a virtual team for which
you're giving a task and eventually they
are coming up with a Solutions on their
own so crei is a very exciting package I
was recently working with it and the
results are pretty good so let's get
started so first of all are talking
about the different components of crei
one is Agent where you give the what
role that particular agent would be
playing uh the goal of that agent and
his backstory if it is required task
would Define which what task you want to
have crew would be a collection of
agents and task and process we will
discussing a little late so let's let's
get started first of all you need to pip
install creai uh once you're done with
that so in this case I'm using a hugging
phas Hub API for loading the llm the um
llm that I'm using is gamma 2 billion
model as you can see here just for
demonstration purpose I have removed my
API token but if you have an open API
key that would be great this works even
with AMA as well so that I will
demonstrating later so here you can see
that I loaded my LM object the rest of
the code is quite easy to understand so
we will be creating the different agents
we want to have to solve the problem the
first agent that I'm calling out is a
senior research analyst as you can see
there are a few things that you need to
mention role the goal of the
agent his backstory verbos allow
delegation I will talking a little late
which is related to the process and the
llm that you're providing so here I have
created an agent that is researcher and
the second agent that is a tech content
strategist right here you can see that
the goal is to compel to write
compelling content on Tech advancements
you are renowned content strategist and
again I'm providing with the llm and
allowed allegation equals to false so uh
basically the the entire flow in cre can
follow two can follow two approaches one
is a sequential approach where you give
a problem statement and eventually the
agents would be giving their inputs one
by one so if for example as I'll will be
showing you I'm creating a task list
down major ml algorithms expected output
is full analysis report and short bullet
points and agent equals to researcher so
this particular task is assigned to the
first agent researcher and then the
second task that I'm creating is using
the insights provided from the first
task develop an engaging blog that
highlights the most significant ml
algorithms and write a full blog post so
basically in the first task I would be
getting short bullet points and in the
second task I'm expecting a full block
post that would be expanded on the short
bullet points for which I'm hiring the
second agent that is a writer so in case
of as I told you there are two
approaches in cway that is sequential
and hierarchal in case of sequential uh
we would be assigning one task to each
of the agent if you and eventually the
subsequent agent the second task the
agent in the second task can use the
insights from the first task so
basically the output of the first task
can be used as a context in the second
task and likewise if you move ahead in
if you go to the third task the output
from the first and second task can be
used in the third task so there is a
sequential approach the other is a
hierarchical approach where what you can
do you won't be mentioning um different
tasks you would be mentioning a single
task and eventually uh you would be
making this particular flag allow
delegation equals to true so by allowing
delegation we mean that this particular
agent can hire the other agents present
to get the task done so for example if
it would have been allowed delegation
equals to false and process would have
been hierarchical in that case this
particular agent could have delegated a
task of writing the content strategy of
writing a blog post to senior research
analyst to get me the bullet points for
the blog So eventually it would be like
a entire company scene where the product
manager is talking to the developer
providing them with task eventually the
tech lead is asking the developer to
develop something and eventually
delegation can happen but in this
particular example we are following a
sequential approach where a task will be
done by one person and it you can't
delegate it to the other agents so here
you can see that we have defined two
agents we have defined to separate task
and in the second task uh we would be
taking the output from the first task
that the short bullet points to expand
onto the blog now we are finally
instantiating a crew the crew would
consist of the agents researcher and
writer task task one and two and the
veros and then finally we would be
calling out crew. kickoff so if you look
at into the output that we have got it's
very interesting so once you see the
first task that we have got is list down
major ml algorithms as we mentioned here
list on major ml
algorithms and the working agent is
senior research analyst So eventually
you can see how the prompts looks like
internally and uh going through a back
and forth process eventually the
research content uh the the senior
research analyst has come up with these
points
finish chain supervised learning
algorithms unsupervised learning
algorithms and reinforcement learning
algorithms three pointers and it has
mentioned some algorithms within it okay
in these particular domains these are
the algorithms used now the tech content
strategist would be using this input
supervise and super reinforcement
learning pointers to expand onto the
final block post and here you can see
that the entire thought process that is
going behind the scen that is not
visible to us now eventually if you look
into the final output that has come up
unveiling the mysteries of machine
learning algorithms as you can see it is
able to give uh the title to the blog it
is written a introduction then expanded
onto the pointers given and this is
how the final output looks like so here
you can see that how cre AI can be so
good with complex task and where you can
have eventually have a virtual team you
don't need to hire anyone just be good
with prompting and the rest of the
things would be taken care by 3i this is
was a very very uh easy task that I
assigned but eventually in the coming
examples that I will be showing with AMA
I'll be showing you how an entire
product design and technicalities
discussion and finally the final
structure can be uh can come out using
crei using a combination of multiple
agents thank you so much
Посмотреть больше похожих видео
The RIGHT WAY To Build AI Agents with CrewAI (BONUS: 100% Local)
快速上手了解智能合約(NFT標準) | TON Blockchain, TEP62
Self Reflecting Agents - Autogen Producing Amazing Production Level Results (Real Business Use Case)
Build Todo List in SwiftUI with MVVM architecture | Todo List #0
Artificial Intelligence Explained Simply in 1 Minute! ✨
GPT-4o AI Agents: Easily Create Medical Research Agents (Praison AI)
5.0 / 5 (0 votes)