1
00:00:00,120 --> 00:00:03,640
And moving on to the third piece of sage advice from me.
接下来是我的第三条明智建议。

2
00:00:03,680 --> 00:00:08,280
It is to favor workflows over autonomy to start with.
首先是支持工作流程而不是自治。

3
00:00:08,400 --> 00:00:14,000
So when you're embarking on a new agent solution, it's tempting to rush into a fully autonomous solution.
因此，当您开始采用新的代理解决方案时，很容易急于采用完全自主的解决方案。

4
00:00:14,160 --> 00:00:20,680
It's better to start by building something which is using simple workflows to take things step by step.
最好从构建一些使用简单工作流程逐步完成的东西开始。

5
00:00:20,920 --> 00:00:24,640
Now, when you're working with open AI agents SDK, there are a number of different ways to do this.
现在，当您使用开放式 AI 代理 SDK 时，可以通过多种不同的方法来实现此目的。

6
00:00:24,680 --> 00:00:30,160
You remember, you can use tools as a way to have one agent call out to another, and you can also use
您还记得，您可以使用工具让一个代理呼叫另一个代理，您也可以使用

7
00:00:30,160 --> 00:00:33,880
handoffs as a way that an agent can pass control to a different one.
切换是代理将控制权传递给另一个代理的一种方式。

8
00:00:34,040 --> 00:00:38,040
But actually I would suggest starting using a third approach.
但实际上我建议开始使用第三种方法。

9
00:00:38,080 --> 00:00:39,480
You might wonder what's the third approach?
您可能想知道第三种方法是什么？

10
00:00:39,480 --> 00:00:40,560
I don't remember that.
我不记得了。

11
00:00:40,600 --> 00:00:44,040
Well, this is actually what we did with our deep research agent.
嗯，这实际上就是我们对深度研究代理所做的事情。

12
00:00:44,080 --> 00:00:51,200
The third approach is simply to use Python code to make each agent call in isolation.
第三种方法是简单地使用 Python 代码来隔离每个代理调用。

13
00:00:51,240 --> 00:00:59,320
Call runner run, make a call to an agent, get an output, and then call runner run again and do things
调用 runner run，调用代理，获取输出，然后再次调用 runner run 并执行操作

14
00:00:59,360 --> 00:01:06,110
step by step in this organized way with Python code later, you can turn this into Hand-offs or tools,
稍后用Python代码按照这种有组织的方式一步一步地，你可以把它变成Hand-offs或工具，

15
00:01:06,110 --> 00:01:11,710
and you can add autonomy and give more activities to one agent, more responsibility.
您可以增加自主权，并为一名代理提供更多活动、更多责任。

16
00:01:11,710 --> 00:01:16,790
But start simple with hard coded or Python coded workflows.
但从简单的硬编码或 Python 编码工作流程开始。

17
00:01:17,230 --> 00:01:22,750
So my fourth piece of advice is super important, particularly for people from a software engineering
所以我的第四条建议非常重要，特别是对于软件工程人员来说

18
00:01:22,750 --> 00:01:28,710
background such as myself, it's common to come into building agent solutions with a blank sheet of
像我这样的背景，通常会用一张白纸来构建代理解决方案

19
00:01:28,710 --> 00:01:32,950
paper and draw some big agent architecture diagram.
纸并画一些大的代理架构图。

20
00:01:33,070 --> 00:01:35,990
And in my view, that's not the best approach.
在我看来，这不是最好的方法。

21
00:01:36,110 --> 00:01:38,030
It's better to work on these things.
最好在这些事情上努力。

22
00:01:38,030 --> 00:01:39,110
Bottoms up.
自下而上。

23
00:01:39,350 --> 00:01:41,270
Start with a simple agent.
从一个简单的代理开始。

24
00:01:41,310 --> 00:01:48,750
Take a small part of your problem and solve it well with one simple agent, one LM call and work on
只用一个简单的代理、一次 LM 调用就可以解决问题的一小部分，然后继续努力

25
00:01:48,790 --> 00:01:54,430
that until you've got that working well, and then add another agent and work bottoms up, building
直到你的工作顺利为止，然后添加另一个代理并自下而上地工作，构建

26
00:01:54,430 --> 00:01:57,630
your platform as you discover what works well and what doesn't.
当您发现什么有效、什么无效时，您就会了解您的平台。

27
00:01:57,830 --> 00:02:00,350
Now, sometimes it's good to actually approach it from both angles.
现在，有时从两个角度来实际处理它是很好的。

28
00:02:00,350 --> 00:02:05,630
Do a bit of top down and a bit of bottoms up, but out of the two I would favor bottoms up in the case
做一点自上而下和一点自下而上，但在这两种情况下，我更喜欢自下而上

29
00:02:05,630 --> 00:02:11,750
of a genetic workflows, because you need to first discover what's going to perform well with your LMS.
遗传工作流程的一部分，因为您需要首先发现什么可以在您的 LMS 中表现良好。

30
00:02:12,230 --> 00:02:19,270
And the next one is very similar, which is to say, it's best to always start simple and then make
和下一个非常相似，也就是说，最好总是从简单开始，然后使

31
00:02:19,270 --> 00:02:22,350
your platform more complicated when the simple solution is working.
当简单的解决方案有效时，您的平台会变得更加复杂。

32
00:02:22,430 --> 00:02:28,030
I can't tell you how many people have sent me these massive, great solutions, hundreds of lines of
我无法告诉你有多少人向我发送了这些大量的、出色的解决方案，数百行代码

33
00:02:28,030 --> 00:02:30,630
code, and it's not giving them the outcome that they want.
代码，但它没有给他们想要的结果。

34
00:02:30,670 --> 00:02:32,390
And they're saying, I don't know, it's broken.
他们说，我不知道，它坏了。

35
00:02:32,390 --> 00:02:33,870
Why help improve this?
为什么要帮助改善这一点？

36
00:02:33,870 --> 00:02:34,470
Fix it?
修复它吗？

37
00:02:34,790 --> 00:02:36,350
And the answer is it doesn't work that way.
答案是事实并非如此。

38
00:02:36,350 --> 00:02:37,190
You can't do that.
你不能那样做。

39
00:02:37,190 --> 00:02:38,070
It's too hard.
太难了。

40
00:02:38,230 --> 00:02:43,750
You have to start small and simple, solve a simple problem and do it really well, and then gradually
你必须从小而简单的开始，解决一个简单的问题并做得很好，然后逐渐

41
00:02:43,750 --> 00:02:48,430
expand and with each of the building blocks, as you solve each problem, you put them together and
扩展每个构建块，当您解决每个问题时，您将它们组合在一起并

42
00:02:48,430 --> 00:02:51,710
you see the bigger agent workflow working well.
您会看到更大的代理工作流程运行良好。

43
00:02:51,750 --> 00:02:57,230
But that's the right approach, because if you build everything and get complex and the answer doesn't
但这是正确的方法，因为如果你构建了所有东西并变得复杂，而答案却并非如此

44
00:02:57,230 --> 00:03:00,350
match what you're looking for, it's impossible to know where to look.
匹配你正在寻找的东西，你不可能知道去哪里寻找。

45
00:03:00,550 --> 00:03:03,310
And so the simple key start simple.
所以简单的钥匙开始很简单。

46
00:03:03,670 --> 00:03:10,580
And a sort of opposite point to that, interestingly, is I recommend, when starting out, begin by
有趣的是，与此相反的是，我建议在开始时从

47
00:03:10,580 --> 00:03:18,500
using the highest end models to start with with with small data sets, such as using the GPT four one
使用最高端的模型从小数据集开始，例如使用 GPT 四一

48
00:03:18,540 --> 00:03:22,700
or using Claude for right now, Claude for sonnet, maybe not Claude for opus.
或者现在使用克劳德（Claude），十四行诗（十四行诗），也许不是作品（作品）。

49
00:03:22,700 --> 00:03:27,260
That might be a little bit too too expensive, but start with the expensive ones so that you can make
这可能有点太贵了，但是从昂贵的开始，这样你就可以

50
00:03:27,300 --> 00:03:30,300
sure that in theory, what you're trying to accomplish will work.
确保从理论上讲，您想要完成的事情会起作用。

51
00:03:30,340 --> 00:03:35,580
And then once you've got that working, you can then look to move to cheaper models like Claude for
一旦你做到了这一点，你就可以考虑转向像 Claude 这样更便宜的型号

52
00:03:35,580 --> 00:03:39,900
sonnet or GPT for one mini, or maybe GPT for one nano.
一台 mini 可以使用 sonnet 或 GPT，或者一台 nano 可以使用 GPT。

53
00:03:39,900 --> 00:03:45,140
And as you make your prompts more and more instructive and precise, you may be able to achieve similar
当你让你的提示变得越来越有指导性和精确性时，你也许能够实现类似的目标

54
00:03:45,140 --> 00:03:47,660
performance with lighter models.
较轻型号的性能。

55
00:03:47,660 --> 00:03:53,980
But as you start with your simple solutions, start with the high powered models so you can prove out
但是，当您从简单的解决方案开始时，请从高性能模型开始，这样您就可以证明

56
00:03:53,980 --> 00:03:55,420
what works and what doesn't.
什么有效，什么无效。

57
00:03:55,700 --> 00:03:57,740
And then the next piece of advice for you.
然后是给你的下一条建议。

58
00:03:57,900 --> 00:04:03,660
This is a subtle one, so I see a lot of people getting caught up in trying to figure out different
这是一个微妙的问题，所以我看到很多人都试图找出不同的方法

59
00:04:03,700 --> 00:04:08,220
types of memory, which is a construct that I feel is like overworked.
类型的记忆，我觉得这是一种过度劳累的结构。

60
00:04:08,260 --> 00:04:13,620
There's like short term memory, some people call it, which is usually just looking at the conversation
有些人称之为短期记忆，通常只是看对话

61
00:04:13,620 --> 00:04:14,180
so far.
迄今为止。

62
00:04:14,260 --> 00:04:20,020
And then there's longer term memory, which is usually other words for for looking up like a rag retrieval
然后是长期记忆，通常是像检索抹布一样查找的其他词

63
00:04:20,020 --> 00:04:24,620
in a database or using the kind of knowledge graph that we used in the trading project.
在数据库中或使用我们在交易项目中使用的知识图谱。

64
00:04:24,780 --> 00:04:30,860
The thing to keep in mind is that all of these different memory techniques are, in fact, just different
需要记住的是，所有这些不同的记忆技巧实际上只是不同的

65
00:04:30,860 --> 00:04:35,340
ways of finding relevant context and shoving it in the prompt.
找到相关上下文并将其放入提示中的方法。

66
00:04:35,340 --> 00:04:38,620
It's all about what goes in the prompt at the end of the day.
这一切都与一天结束时提示中的内容有关。

67
00:04:38,740 --> 00:04:44,540
And so keep a clear mind about that and make sure that that whilst you might use various tools and techniques
因此，请保持清醒的头脑，并确保在您可能使用各种工具和技术的同时

68
00:04:44,540 --> 00:04:49,300
for memory at, at the end of the day, all you're doing is trying to find the right relevant material
为了记忆，在一天结束时，你所做的就是试图找到正确的相关材料

69
00:04:49,300 --> 00:04:50,060
for the prompts.
以获得提示。

70
00:04:50,060 --> 00:04:55,060
So look at the prompts, see what's being included there, look at the tools you're using and see what
因此，请查看提示，查看其中包含的内容，查看您正在使用的工具，看看有什么

71
00:04:55,060 --> 00:04:56,660
information is being retrieved.
正在检索信息。

72
00:04:56,660 --> 00:05:02,460
And make sure that you're giving the LLM the right context to be able to answer its question.
并确保您为法学硕士提供了正确的背景，以便能够回答其问题。

73
00:05:02,460 --> 00:05:07,980
And so rather than getting too bogged down in what kinds of memory you're using, focus on what kind
因此，不要太纠结于您正在使用哪种内存，而应该关注哪种内存

74
00:05:07,980 --> 00:05:11,260
of information does the LM need to answer the question?
LM 需要多少信息来回答这个问题？

75
00:05:11,260 --> 00:05:14,580
And are you providing that information in the prompts?
您是否在提示中提供了该信息？

76
00:05:14,900 --> 00:05:15,220
Okay.
好的。

77
00:05:15,260 --> 00:05:18,220
And I'm almost done with this preachy advice for you.
我差不多已经给你讲完了这个说教建议。

78
00:05:18,220 --> 00:05:19,700
Let's go to number eight.
我们来看第八点。

79
00:05:20,140 --> 00:05:26,260
It's very similar point again, which is that look, most of the difficulties that you come up against
又是非常相似的一点，就是看起来，你遇到的大多数困难

80
00:05:26,300 --> 00:05:32,780
working with agent systems and with LMS generally are fixed by better prompting and by experimenting
使用代理系统和学习管理系统通常可以通过更好的提示和实验来解决

81
00:05:32,780 --> 00:05:33,420
with your prompts.
根据您的提示。

82
00:05:33,420 --> 00:05:38,140
People often are message me and say, can I use fine tuning for this?
人们经常给我留言说，我可以为此使用微调吗？

83
00:05:38,180 --> 00:05:39,500
Can I use a different encoder?
我可以使用不同的编码器吗？

84
00:05:39,500 --> 00:05:40,700
LM for my rag?
LM 给我的抹布？

85
00:05:40,740 --> 00:05:45,740
All sorts of sophisticated stuff, when often the right answer is to just focus on the prompts, make
各种复杂的东西，通常正确的答案是只关注提示，

86
00:05:45,740 --> 00:05:49,220
something a bit simpler, a bit more directive, a bit more instructive.
一些更简单、更有指导性、更有启发性的东西。

87
00:05:49,380 --> 00:05:54,540
If it's outputting one thing, then try and tell it not to give it some examples of what a good output
如果它输出一件事，那么尝试告诉它不要给它一些关于什么是好的输出的例子

88
00:05:54,540 --> 00:05:55,300
looks like.
看起来像。

89
00:05:55,340 --> 00:05:59,180
You can get so far just by working on your prompts.
您只需按照提示进行操作即可完成此任务。

90
00:05:59,980 --> 00:06:04,500
And a similar point again is also look at the traces.
而同样的一点又是看痕迹。

91
00:06:04,500 --> 00:06:10,300
Of course, this is a great discipline to get into, even if your agents seem to be working well and
当然，即使你的代理人看起来工作得很好并且

92
00:06:10,300 --> 00:06:12,250
they're giving the answers that you expect.
他们正在给出您期望的答案。

93
00:06:12,290 --> 00:06:17,970
You should still be disciplined to go and check that everything is just as you want in the traces,
你仍然应该遵守纪律去检查痕迹中的一切是否都如你所愿，

94
00:06:17,970 --> 00:06:20,170
just in case there's extra tool call happening.
以防万一发生额外的工具调用。

95
00:06:20,170 --> 00:06:22,170
There's some weird stuff happening now.
现在发生了一些奇怪的事情。

96
00:06:22,210 --> 00:06:26,490
I'm often guilty of not going back and looking at the traces, particularly if things seem to be working,
我常常因为没有回去查看痕迹而感到内疚，尤其是当事情看起来正常的时候，

97
00:06:26,490 --> 00:06:30,970
and then often when I do, I then discover that there is something in there, there is a gotcha that
然后经常当我这样做时，我会发现里面有一些东西，有一个陷阱

98
00:06:30,970 --> 00:06:31,690
I can fix.
我可以修复。

99
00:06:31,730 --> 00:06:37,610
And so it is so important, even if I don't take my own advice on this always you should you should
所以这非常重要，即使我不接受我自己的建议，你也应该这样做

100
00:06:37,610 --> 00:06:40,130
go in and check, check the traces.
进去检查一下，检查一下痕迹。

101
00:06:40,170 --> 00:06:41,050
Always.
总是。

102
00:06:41,090 --> 00:06:45,850
As you're building your agent system, make sure things are behaving the way that you expect.
当您构建代理系统时，请确保一切按照您期望的方式运行。

103
00:06:46,250 --> 00:06:49,930
And I've left the most important piece of advice to the very end.
我把最重要的建议留到了最后。

104
00:06:49,970 --> 00:06:51,530
And here it is.
就是这样。

105
00:06:51,970 --> 00:06:58,490
Look, being an AI engineer, being an LM engineer involves wearing two hats, a software engineering
看，作为一名 AI 工程师，作为一名 LM 工程师涉及两顶帽子，一顶软件工程

106
00:06:58,490 --> 00:07:01,370
hat, and a data scientists hat.
帽子和数据科学家帽子。

107
00:07:01,530 --> 00:07:06,770
And when you're beginning your project, when you're at the starting point of building a new system,
当你开始你的项目时，当你处于构建新系统的起点时，

108
00:07:06,930 --> 00:07:13,520
you need to be taking firmly off the software engineering hat and putting on that scientist hat and
你需要坚定地摘下软件工程的帽子，戴上科学家的帽子

109
00:07:13,520 --> 00:07:14,960
be a scientist.
成为一名科学家。

110
00:07:14,960 --> 00:07:18,800
That means be comfortable with experimentation and R&amp;D.
这意味着要乐于进行实验和研发。

111
00:07:19,040 --> 00:07:21,520
People often come to me and say, which?
人们经常来找我问，哪一个？

112
00:07:21,520 --> 00:07:23,840
Which model should I pick A, B, or C?
我应该选择 A、B 或 C 中的哪个型号？

113
00:07:23,880 --> 00:07:25,440
Which technique should I use?
我应该使用哪种技术？

114
00:07:25,440 --> 00:07:26,080
This, this or this?
这个，这个还是这个？

115
00:07:26,080 --> 00:07:27,400
Which tool should I use?
我应该使用哪个工具？

116
00:07:27,600 --> 00:07:30,800
And the answer is you should try them all.
答案是你应该尝试所有这些。

117
00:07:30,840 --> 00:07:31,640
Try them.
尝试一下。

118
00:07:31,640 --> 00:07:32,880
Experiment.
实验。

119
00:07:32,920 --> 00:07:39,440
Look at your overall business metric that you're using to gauge success, and use that to judge which
查看用于衡量成功的整体业务指标，并用它来判断哪些

120
00:07:39,440 --> 00:07:44,440
of the different techniques is working better for you, and embrace the experimentation.
不同的技术对你来说效果更好，并接受实验。

121
00:07:44,440 --> 00:07:45,680
It's absolutely key.
这绝对是关键。

122
00:07:45,720 --> 00:07:47,160
I've put a whole guide about this.
我已经为此准备了完整的指南。

123
00:07:47,200 --> 00:07:48,760
If you look in the guides, you'll see one.
如果您查看指南，您会看到一个。

124
00:07:48,760 --> 00:07:51,800
I think it's one of the last ones is about how to build your own projects.
我认为最后的问题之一是关于如何构建自己的项目。

125
00:07:51,800 --> 00:07:53,280
And I talk a lot about this.
我对此谈了很多。

126
00:07:53,280 --> 00:07:55,640
There's no shortcut to R&amp;D.
研发没有捷径。

127
00:07:55,920 --> 00:08:02,520
Embrace being a scientist and researching and exploring and understanding what works well.
拥抱成为一名科学家，研究、探索和理解什么是有效的。

128
00:08:02,560 --> 00:08:08,920
I often have an instinct about the right way to go and build something, but it turns out my instinct
我经常有一种关于构建某些东西的正确方法的本能，但事实证明我的本能

129
00:08:08,920 --> 00:08:10,080
is often wrong.
经常是错误的。

130
00:08:10,160 --> 00:08:15,280
So don't trust my instinct, but instead experiment and discover for yourself.
所以不要相信我的直觉，而是自己尝试和发现。
