Agent Response | LangSmith Evaluation - Part 24

LangChain
18 Jun 202414:05

Summary

TLDRランスが言語モデルのエージェント評価に関するシリーズを続け、ツール呼び出しの概念と、それを評価する方法を解説。ツール呼び出しは、モデルが特定のツールを呼び出すためのペイロードを返すことを意味。ラングラフを使用してエージェントを構築し、ツールの選択とペイロードをループで使用する方法を紹介。評価方法として最終応答、単一ツール呼び出し、または複数のツール呼び出しの評価を提案。SQLデータベースを使用したエージェントの例を通じて、評価手法を具体化し、異なるアーキテクチャのエージェントを比較する。

Takeaways

  • 🧠 代理(Agent)とは、ツール呼び出し(Tool Calling)、メモリ(Memory)、計画(Planning)などのコアコンポーネントを持つものである。
  • 🔧 ツール呼び出しは、LLM(Large Language Model)がツールのペイロードを返し、それを使って何らかの操作を行う機能である。
  • 📚 Lanceは、Lang Smithの評価シリーズの中で、代理の評価方法について詳しく説明していく予定である。
  • 🛠️ 代理はツール呼び出しを使用し、通常はループ内でこれを使用して、タスクを遂行する。
  • 📈 Lang graphを使用して代理を構築し、ノードとエッジを使って代理の構造を表現することができる。
  • 🔎 評価には、最終応答の品質、単一ステップでのツールの選択、または多ステップでのツール呼び出しの評価など、異なるアプローチがある。
  • 📝 評価の際には、最終応答のみを確認するシンプルな方法から、ステップごとのツール呼び出しの詳細を確認するより複雑な方法まで存在する。
  • 🗂️ Lanceは、Chinook DBというSQLデータベースを使用して、SQLエージェントを作成し、その動作を説明した。
  • 🔑 評価プロセスでは、データセットの作成、評価器の定義、そして評価の実行が行われ、結果を分析する。
  • 📊 評価結果は、正解率や応答の正誤を示すスコアを使って可視化され、異なるアーキテクチャの代理を比較することができる。
  • 🛑 エージェントの改善点は、クエリの正確性や結果の妥当性など、データベースとの相互作用を通じて特定される。

Q & A

  • ランスが紹介するエージェントとは何ですか?

    -ランスが紹介するエージェントは、ツールを呼び出す機能を持つ、言語モデルを拡張したものです。ツールの選択とその引数を返し、ユーザーの入力に基づいてツールを呼び出すことができます。

  • ツールコールとはどのような概念ですか?

    -ツールコールは、言語モデル(LLM)が特定のツールのペイロードを返すことで、そのツールを実行するプロセスを指します。LLMは文字列から文字列へのマッピングを行い、ツールの選択と引数を推定します。

  • Magic functionツールの例は何をしていますか?

    -Magic functionツールは、入力された数値に2を加算するという単純な操作を行います。これはツールコールの例として使われ、LLMがこのツールを呼び出す方法を示しています。

  • Lang chainでエージェントを構築する際に重要な要素は何ですか?

    -Lang chainでエージェントを構築する際には、ノードとエッジを用いてグラフ構造を作り、LLMとツールを繋ぐことが重要です。また、ツール条件ノードやツールノードを使用して、LLMの応答を解析し、適切なツールを呼び出します。

  • エージェントの評価方法にはどのような種類がありますか?

    -エージェントの評価方法には、最終応答の評価、単一のツールコールの評価、複数のツールコールの評価などがあります。それぞれの方法は、エージェントの異なる側面を評価するのに使われます。

  • SQLエージェントの例ではどのようにデータセットを作成しましたか?

    -SQLエージェントの例では、入力と出力のペアを持つデータセットを作成し、SQLデータベースとその回答に基づいて評価を行います。データセットは、質問とそれに対応する答えで構成されています。

  • 評価プロセスで使用される参照回答とは何ですか?

    -参照回答は、エージェントの応答と比較される正解の回答です。評価では、エージェントの応答が参照回答と一致するかどうかを確認し、精度を測定します。

  • マルチステップ応答のSQLエージェントとは何ですか?

    -マルチステップ応答のSQLエージェントは、ツールの呼び出しパスをより明示的にエンコードし、特定の順序でツールを呼び出すエージェントです。これにより、より具体的なアーキテクチャを持つエージェントが開発され、評価セットで高い精度を達成することができました。

  • 評価セットでのSQLエージェントの改善点は何ですか?

    -評価セットでのSQLエージェントの改善点は、より明示的なアーキテクチャを導入することで、正解率が初期モデルから67%に向上したことです。これは、ツールの呼び出しステップを細かく制御することで達成されています。

  • Lang chainの評価ツールを使って何をすることができますか?

    -Lang chainの評価ツールを使って、エージェントの最終応答やツールコールの正確性を評価し、異なるエージェントアーキテクチャの性能を比較することができます。

Outlines

00:00

🤖 エージェントの基礎と評価方法

ランスは、Lang chainのシリーズを通じてエージェントの評価について解説しています。エージェントとは何か、どのように評価するかを説明し、ツールコールの概念を紹介しています。ツールコールは、LLMが特定のツールのペイロードを返すことであり、これを通じてツールの選択とその引数を推定します。Lang graphを使用してエージェントの構造を示し、ツールコールをループで使用する例を説明しています。評価方法として、最終的な応答、単一のツールコール、または複数のツールコールの評価の3つの異なるアプローチを提案しています。

05:01

🔍 エージェントの応答評価とSQLエージェントの構築

ランスは、SQLデータベースを使用するエージェントの構築方法と応答評価のプロセスを解説しています。Chinook DBを使用して、SQLツールを作成し、Lang graphでエージェントの状態とランタイムを定義しています。評価では、入力と参照回答に基づいて、エージェントの応答を比較しています。データセットの作成、評価の実行、結果の分析を通じて、エージェントの性能を評価しています。

10:02

📈 エージェントのマルチステップ応答評価

ランスは、エージェントのマルチステップ応答評価について説明しています。SQLエージェントの例を使って、より明示的なツール使用パスを定義し、その効果を評価しています。評価セットを使用して、初期のエージェントとマルチステップ応答エージェントの性能を比較し、より明確なアーキテクチャが改善をもたらしたことを示しています。

Mindmap

Keywords

💡エージェント(Agent)

エージェントとは、ユーザーの入力に基づいてツールを呼び出す機能を持つプログラムのことです。このビデオでは、エージェントがどのようにしてツールを選び、そのツールにどのような引数を渡すかを説明しています。例えば、「Magic function」というツールが3を入力として5を返す例が挙げられています。これは、ビデオの主題であるエージェントの評価方法を理解する上で核心的な概念です。

💡ツールコール(Tool Calling)

ツールコールは、LLM(Large Language Model)が特定のツールを呼び出す機能を指します。ビデオでは、LLMが「Magic function」のようなツール名と引数を返すことで、ツールコールが行われることが示されています。これは、エージェントがどのようにしてユーザーの入力に応じて適切なツールを選択し、実行するかを理解する上で重要なキーワードです。

💡ラングラフ(Lang Graph)

ラングラフは、ビデオで使用されているツールで、エージェントを構築するために使用されています。ラングラフはノードとエッジからなるグラフ構造であり、エージェントの構造化された表現を可能にします。ビデオでは、ラングラフを使用して、SQLエージェントの例を構築し、そのプロセスを説明しています。

💡評価(Evaluation)

評価とは、エージェントの性能を測定するプロセスを指します。ビデオでは、最終的な応答、単一のツールコール、または複数のツールコールの評価方法について説明しています。例えば、SQLエージェントがデータベースから正しい結果を返すかどうかを評価する例があります。これは、エージェントの効果を定量的に測定し、改善するための方法を理解する上で重要な概念です。

💡LLM(Large Language Model)

LLMとは、大規模な言語モデルの略で、ビデオで使用されている基盤技術の一つです。LLMは文字列を文字列に変換する機能を持ち、ツールコールの際にツールの選択と引数を提供します。ビデオでは、「Magic function」の例を通じて、LLMがどのようにツールコールに関与するかを説明しています。

💡デコレーター(Decorator)

デコレーターは、Python言語で使用される機能で、関数やクラスに新たな振る舞いを追加するために使用されます。ビデオでは、デコレーターを使用して「tool」として機能するものを定義し、LLMにツールコールを可能にしています。これは、ツールコールを実装する際に重要な技術的な概念です。

💡SQLデータベース

SQLデータベースは、構造化されたデータを管理するためのシステムで、ビデオで使用されるツールの1つです。ビデオでは、SQLエージェントがSQLデータベースとどのように相互作用し、質問に答えるかを説明しています。例えば、データベースから特定の情報を抽出するためのクエリの実行が挙げられます。

💡データセット(Dataset)

データセットとは、分析や学習に使用されるデータの集合を指します。ビデオでは、SQLエージェントの評価のためにデータセットを作成し、そのデータセットを使用してエージェントの応答を評価しています。データセットには、質問と期待される答えのペアが含まれています。

💡マルチステップ応答(Multi-step Response)

マルチステップ応答は、エージェントが複数のツールを呼び出して最終的な応答を形成するプロセスを指します。ビデオでは、SQLエージェントが複数のステップを経てデータベースからの情報を収集し、ユーザーに応答するプロセスを説明しています。これは、より複雑なタスクをこなすエージェントの動作を理解する上で重要な概念です。

💡カスタムツール(Custom Tool)

カスタムツールとは、特定のニーズに合わせて作成されたツールのことを指します。ビデオでは、SQLエージェントが使用する「check query tool」や「check result tool」のようなカスタムツールを紹介しています。これらのツールは、SQLクエリの正しさや結果の妥当性を確認する役割を果たしています。

Highlights

Lance从Lang chain介绍了Lang Smith评估系列的继续,专注于代理评估。

解释了代理(agent)的基本定义和评估方法。

提到了Lilian Wang的博客文章,该文章分解了代理的核心组件:工具调用、记忆、规划。

通过一个简单的例子解释了工具调用(tool calling)的概念。

介绍了如何使用Lang graph构建代理,并展示了节点和边缘的使用。

展示了代理如何在循环中使用工具调用,以及如何与Lang graph交互。

讨论了评估代理的三种不同方法:最终响应评估、单一工具调用评估和多个工具调用评估。

展示了如何使用Lang graph创建SQL代理,并解释了其工作流程。

描述了SQL代理如何与SQL数据库交互,并使用自定义工具来检查查询的正确性和结果的有效性。

介绍了如何使用Lang graph定义代理状态和代理助手。

展示了如何使用Lang graph的图来表示代理的逻辑流程。

讨论了如何对代理进行响应评估,并展示了使用Lang chain进行数据集创建和评估的过程。

通过实验比较了不同代理架构的性能,展示了显式架构相对于基线模型的改进。

提供了一个改进的SQL代理示例,该代理显式地编码了预期的工具调用路径。

展示了如何使用Lang graph进行多步骤响应评估,并比较了不同代理架构的效果。

强调了使用评估来指导代理开发和优化的重要性。

提供了Lang graph和Lang chain的链接,供用户深入了解代理构建和评估工具。

Transcripts

play00:00

hey this is Lance from Lang chain we're

play00:02

continuing our Lang Smith evaluation

play00:04

series now talking through agent

play00:05

evaluation this is one of the most

play00:07

requested topics that we've heard so I

play00:09

want to walk through this carefully

play00:10

explaining first what an agent actually

play00:12

is and then how to think about

play00:13

evaluating it and we'll probably walk

play00:15

through the different approaches for

play00:16

evaluation in three different videos so

play00:19

here's the starting point what is an

play00:21

agent there's a great blog post from

play00:22

Lilian Wang that kind of breaks down the

play00:24

core components tool calling memory

play00:27

planning all right so that's step one

play00:30

now how to think about what is this

play00:32

thing called tool calling here's a

play00:34

really simple explanation of it all

play00:36

you're doing is you're having an

play00:38

llm basically return to you the payload

play00:42

of a tool that it can use okay so that's

play00:45

all it's going on let's give an example

play00:47

here I have an llm I'm going to define a

play00:50

tool called Magic function and all it

play00:53

does is takes an input adds two okay so

play00:55

in L with this nice little decorator

play00:57

called tool and allows you to basically

play01:00

convert this into what we call structure

play01:01

tool and you can bind it to llms at

play01:03

support tool calling and here's the key

play01:05

point when you bind it to the LM the llm

play01:09

then given an input so what is Magic

play01:11

function 3 it can recognize hey I need

play01:14

to invoke this tool and here's the key

play01:17

point this is often the most confusing

play01:19

part it just returns to you two things

play01:22

the tool to tool to call and the payload

play01:26

or the arguments to run the tool now it

play01:28

doesn't have the ability to match

play01:29

magically run that for you right again

play01:31

it's an llm it's string to string but

play01:33

what it gives you is a tool selection

play01:36

and a payload that's all you need to

play01:38

really know that's all that tool calling

play01:39

is so this could be really anything this

play01:41

could be a really complex tool it's a

play01:43

simple tool that's a key Point you're

play01:45

getting the tool name and the tool

play01:47

arguments out and it's inferring those

play01:49

from the user input so that's like step

play01:51

one right and now agents use this

play01:55

particular tool calling step typically

play01:57

in a loop so Lang graph a really nice

play02:00

way to build agents not the only way but

play02:02

let me show you an example like here's

play02:04

how this whole thing would work here's

play02:06

my agent I've stru I structure this in

play02:08

Lang graph in Lang graph you have nodes

play02:10

and edges so I have two different nodes

play02:13

my first node is my assistant that's my

play02:14

llm it sees my input just like before it

play02:17

has tools bound and it returns remember

play02:20

all it can return is just like a string

play02:22

in terms of like a raw response or a

play02:25

tool message which is essentially

play02:26

another string with like here's the tool

play02:29

I want to use here's the tool invocation

play02:32

we have this um we have basically what

play02:35

we call a tools condition node that will

play02:36

automatically look at the LM response

play02:38

for you and determine is it just a

play02:40

string response out or is it a tool call

play02:44

and if it's a tool call then basically

play02:46

all it happens is it takes that tool

play02:47

called payload it passes to this other

play02:49

node called The Tool node which

play02:51

basically has our two tools it looks up

play02:53

the right tool based on the specified

play02:54

name it passes the specified input to

play02:56

the tool and you get the tool response

play02:58

out and we send that back to the LM now

play03:01

this keeps running until LM has decided

play03:03

okay I'm not going to call a tool

play03:04

anymore I'm just going to respond

play03:05

directly and then the tool conditions no

play03:08

just returns so in this particular case

play03:10

let's walk through it one Loop what's

play03:12

Magic function 3 llm says okay that

play03:15

looks like a tool call I need to use my

play03:16

tool magic function Returns the tool

play03:19

call with the magic function name and

play03:21

the argument tool node gets that tool

play03:23

node says okay run magic function runs

play03:25

it with this input three you get the

play03:28

result five out it passes that back to

play03:30

LM as a tool message hey the tool output

play03:32

is five LM looks at that and says okay

play03:35

Returns the string the result is five

play03:37

that's all that happens super super

play03:39

simple basic agent explanation

play03:42

right so here's the interesting thing

play03:45

how do you think about evaluating this

play03:47

thing well here's the way we've broken

play03:49

it down this is our conceptual guide and

play03:51

um there's like kind of three different

play03:53

really intuitive ways to think about

play03:54

this first is final response this is

play03:57

just like end to end is it doing what we

play03:59

want to do so in this case the final

play04:01

response would be like looking at does

play04:03

it return five I don't care how many

play04:05

Loops it goes through does it return

play04:06

five and you know if you think about

play04:08

that's just a string to string

play04:09

comparison typically we can use existing

play04:12

evaluators like we use for rag answer

play04:13

response easy stuff right so you're just

play04:16

looking at end to-end response you don't

play04:17

care anything about the agent process

play04:19

okay so that's kind of like one way to

play04:21

do it now another way to do evaluation

play04:24

is like digging in a little bit like

play04:25

looking at a single step of the agent

play04:27

like here's a good example if I pass

play04:29

this input does it actually like you

play04:33

know want it does actually invoke the

play04:34

right tools it like make the right

play04:36

decision so for this my output would be

play04:40

like my evaluation output we'll talk

play04:41

about this in detail later will be like

play04:44

the tool name okay so you could just

play04:45

evaluate that you could say okay if I

play04:48

have this prompt I expect this tool to

play04:50

be called and just do an evaluation

play04:51

there so that's like evaluating one step

play04:53

of an agent right and then you can also

play04:55

think about doing kind of the same idea

play04:57

but for many steps and so let's say this

play04:58

is more complex agent it has to invoke

play05:01

like both of these tools right you could

play05:03

have your reference be like you know fun

play05:06

magic function then web search Okay um

play05:10

and um you know and then in case your

play05:12

evaluation would basically look for

play05:15

there's a couple ways you could do

play05:16

custom evaluator there you could look at

play05:17

the exact sequence of tool calls you

play05:19

could look at any sequence of tool calls

play05:21

you could look at like you know if it's

play05:23

close count it you know better versus

play05:25

far in terms of like the trajectory

play05:26

taken anyway we'll talk about all that

play05:28

later but the intuition is simply

play05:30

evaluating a whole selection of

play05:31

different tool calls so again evaluate

play05:34

final response evaluate a single tool

play05:36

call or evaluate many tool calls that's

play05:39

like the simple minded way to think

play05:40

about at least three ways to look at

play05:42

agent evaluation now let's go ahead

play05:44

after that Preamble let's go to the

play05:46

first one so here's a notebook i' I've

play05:48

defined an agent um so I'm using this

play05:51

chinuk DB this is a popular SQL database

play05:54

um and so I'm going to build a SQL agent

play05:58

okay it's going to be using chinuk DB

play06:00

um here's like the flow again just looks

play06:02

exactly like we just saw except in this

play06:04

case my tool is SQL database um so

play06:08

here's where I'm just basically going to

play06:09

pull in uh this is our existing SQL tool

play06:12

okay this's a whole bunch of SQL tools

play06:14

for working with SQL databases I'm going

play06:16

to find one or two custom tools this

play06:18

like check query tool this is going to

play06:20

basically check if the quer is correct

play06:23

um I'm going to add one other like check

play06:25

result tool this will check if like the

play06:27

result from DB is like not empty does it

play06:29

make sense so anyway there we go I I've

play06:33

defined some

play06:34

tools now with Lang graph you defined

play06:36

agent State and um if you want more

play06:38

details on L graph I'm going to link a

play06:40

few videos to talk all about Lang graph

play06:41

agents that's kind of outside the scope

play06:43

of here but this is assuming you kind of

play06:45

know how to build an agent okay because

play06:46

you're doing evaluation so this is my

play06:48

agent State now here is just where I'm

play06:51

like basically defining my agent what

play06:53

you might call the agent runnable or

play06:54

agent assistant this is basically my SQL

play06:57

prompt okay so this is basically telling

play06:59

telling the agent what you're going to

play07:01

do uh you're you know you're going to be

play07:03

interacting with sqle database you're

play07:04

going to be you know quering it looking

play07:06

at the response uh and then answering

play07:09

you know answering the user question and

play07:10

again there's a whole bunch of detail

play07:12

you can read The Notebook independently

play07:15

um a couple graph utilities don't worry

play07:16

too much about this um and boom let's

play07:19

look at our graph cool so here's our

play07:21

agent graph just like we saw before and

play07:23

again this is just like a you know a

play07:25

line graph representation what we

play07:26

actually showed over here uh this EX

play07:29

exactly the same thing I have an

play07:31

assistant node I have a tool node I

play07:32

bounce between the tool and the loop

play07:34

until basically the assistant returns a

play07:36

string saying here's my answer that's

play07:38

all we're doing

play07:39

Simple uh okay so here's a couple

play07:42

different questions um let's just make

play07:44

sure I can invoke this thing and that it

play07:45

actually works um and my config is not

play07:48

defined um let's see yep so we're going

play07:53

to go ahead need to pull that up here

play07:55

boom let's try that and that'll work

play07:58

cool

play08:00

uh so we can see that our agent is

play08:02

running and it is running there we go so

play08:07

we get an answer and that's fine so the

play08:09

agent works okay cool and we can also

play08:12

stream outputs um but let's not worry

play08:15

about that for now let's move on to the

play08:16

eval piece so now we have an agent we

play08:18

build in L graph we know it works

play08:21

cool now let's talk through that respons

play08:23

eval again this is looking at the output

play08:25

or response of our agent no problem so

play08:28

first things first let's build data set

play08:30

just like we've done a million times um

play08:32

I'm going to go open up lsmith boom and

play08:37

let's log in here

play08:40

nice all right very good let's go ahead

play08:44

and open up let's make sure I'm the

play08:45

right tenant so I'm in my Lang chain

play08:47

tenant let's look at data set so

play08:49

actually I've actually already created

play08:50

this data set I don't want to create it

play08:51

again but I'll just show you what it

play08:54

looks like SQL agent response there's my

play08:56

data set here are my examples so

play08:59

basically input up a pair just like

play09:00

we've seen in the past right uh question

play09:03

answer just like for rag eval same thing

play09:05

but in this case we need an agent's

play09:06

going to be doing all the work under the

play09:07

hood but again our evaluation approach

play09:10

can follow exactly what we've done with

play09:11

rag in the past right here's our

play09:13

examples so we created a data set with

play09:15

input output pairs question answer now

play09:17

these answers of course come from our

play09:18

SQL database so we need an agent to

play09:20

again interact with the database and uh

play09:22

do all the work for us so we're just

play09:24

going to find a chain this is basically

play09:26

just going to invoke our graph with an

play09:28

example from our dat data set so again

play09:30

if you go look at our data set the data

play09:32

set is keyed with our inputs are this

play09:35

key input so again we grab our example

play09:38

key input that'll return basically the

play09:40

question Plum that into our agent no

play09:44

problem easy now okay now here's what's

play09:46

interesting our evaluator this is just

play09:48

like we did in the past for a rag same

play09:50

thing we're going to be doing a string

play09:51

to- string comparison between a

play09:52

reference answer and our agent answer so

play09:56

this is literally the same thing we've

play09:57

done in the past now we kick our reel so

play10:00

again let's look what we're passing

play10:02

we're passing in our little function

play10:04

here that's basically just going to run

play10:06

our agent on each input okay so that's

play10:10

that uh our data set we defined our

play10:13

evaluator we defined right here this is

play10:15

the same as basically a rag evaluator

play10:17

you know it's going to look at our

play10:18

reference answer relative to our agent

play10:19

answer cool so we kick off evaluation

play10:21

here um that runs we can go over and

play10:24

look so I can go ahead and actually just

play10:27

I'll show you where I am so I'm in my um

play10:31

our data set that's defined here I look

play10:34

at my most recent experiment so here we

play10:36

are so again we' kind of seen this

play10:39

before uh this is basically a you know

play10:42

one zero is the answer correct or not

play10:45

scoring um we can actually just look at

play10:47

some of these runs and kind of break

play10:49

them out um so you know reference output

play10:53

Les has 14 albums the r zien has 14

play10:55

albums this is obviously correct that's

play10:57

great we can look at some that are

play10:58

incorrect uh the most purchased uh track

play11:02

of 2013 was hot girl um and this has

play11:05

some issue this is probably a problem

play11:06

with the query so again this is what we

play11:08

could dig into um and you can look

play11:11

through accordingly so in any case this

play11:13

is like the the simplest type of

play11:14

valuation you might think of it's it's

play11:17

actually the same as other types like

play11:18

rag evaluation we've already talked

play11:19

about where you're basically comparing

play11:21

the output or what's returned by the

play11:22

agent to a reference and you don't care

play11:24

anything about what's happening under

play11:25

the hood okay so this is just like an

play11:27

example of endan eval on a simple test

play11:29

case on a SQL

play11:31

agent I'm just going to extend our

play11:34

response evaluation slightly here so

play11:37

initially remember our agent looks like

play11:39

this we start it goes to the assistant

play11:41

node the assistant picks one of several

play11:43

tools to use the tool is invoked we go

play11:47

back we continue that in a loop until we

play11:48

finish right now when we talk about

play11:51

laying out agents you can also St to

play11:52

think about laying out those steps you

play11:55

want the agent to take or those tool

play11:56

nodes those tool calls very explicitly

play11:59

as independent nodes so here's actually

play12:02

a separate SQL agent that we've kind of

play12:04

just devised just kind of hacking on it

play12:05

a little bit and what we do here is

play12:08

instead of running this uh kind of just

play12:11

as a simple Loop where the assistant

play12:13

kind of makes the decision at each step

play12:15

as to which tool to use we encode the

play12:18

path of tools that we want the agent to

play12:20

use very

play12:22

explicitly and so basically it follows

play12:24

what we did previously your first tool

play12:26

call which is basically list tables you

play12:28

get the scheme

play12:30

um you generate a query you you check

play12:33

the query for correctness you execute it

play12:35

and you go back and if there's an error

play12:37

in execution then you try again so it's

play12:40

same kind of idea except we're just

play12:42

making a little bit more specific so

play12:44

what's cool is with our now eval set to

play12:46

find I can actually go and I've just run

play12:48

this notebook and this is checked in

play12:49

I'll of course share the link here bunch

play12:51

of code this is again showing the the um

play12:54

the kind of flow of the

play12:56

agent um we going ahead and ran response

play13:00

evaluation on that same eval set um

play13:04

again this is kind of the same eval we

play13:05

just went through with our updated agent

play13:08

so we can kick off evaluation here I'm

play13:10

going to name this evaluation SQL agent

play13:12

mult multi-step response um so that runs

play13:16

and we can go over to L graph we can

play13:17

look at our data set we can see here's

play13:19

our two experiments this is our initial

play13:20

agent it got around 53% correct I ran

play13:23

three

play13:24

repetitions um and we can see that our

play13:26

newer agent SQL uh agent multi SE

play13:29

response gets to around 67% again across

play13:31

the three repetitions so this is pretty

play13:33

cool we can open this up we can go to

play13:35

comparison view um and this is great so

play13:38

we can actually see you know we do uh

play13:40

two improvements and one regression

play13:42

relative to the Baseline the Baseline

play13:44

being our initial model and our uh what

play13:48

we're comparing is of course the

play13:49

multi-step agent so in any case good

play13:51

example of how you can um you know use

play13:55

evaluation to compare different agent

play13:56

architectures and in this particular

play13:58

case you can see that a more uh explicit

play14:00

architecture does a little bit better on

play14:01

EV set thanks

Rate This

5.0 / 5 (0 votes)

Related Tags
ランゲージチェーンエージェント評価ツール呼び出しループ構造データベースSQL評価方法グラフデバッグAIツール開発ガイド
Do you need a summary in English?