And moving on to the third piece of sage advice from me. 接下来是我的第三条明智建议。
It is to favor workflows over autonomy to start with. 首先是支持工作流程而不是自治。
So when you're embarking on a new agent solution, it's tempting to rush into a fully autonomous solution. 因此，当您开始采用新的代理解决方案时，很容易急于采用完全自主的解决方案。
It's better to start by building something which is using simple workflows to take things step by step. 最好从构建一些使用简单工作流程逐步完成的东西开始。
Now, when you're working with open AI agents SDK, there are a number of different ways to do this. 现在，当您使用开放式 AI 代理 SDK 时，可以通过多种不同的方法来实现此目的。
You remember, you can use tools as a way to have one agent call out to another, and you can also use 您还记得，您可以使用工具让一个代理呼叫另一个代理，您也可以使用
handoffs as a way that an agent can pass control to a different one. 切换是代理将控制权传递给另一个代理的一种方式。
But actually I would suggest starting using a third approach. 但实际上我建议开始使用第三种方法。
You might wonder what's the third approach? 您可能想知道第三种方法是什么？
I don't remember that. 我不记得了。
Well, this is actually what we did with our deep research agent. 嗯，这实际上就是我们对深度研究代理所做的事情。
The third approach is simply to use Python code to make each agent call in isolation. 第三种方法是简单地使用 Python 代码来隔离每个代理调用。
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 并执行操作
step by step in this organized way with Python code later, you can turn this into Hand-offs or tools, 稍后用Python代码按照这种有组织的方式一步一步地，你可以把它变成Hand-offs或工具，
and you can add autonomy and give more activities to one agent, more responsibility. 您可以增加自主权，并为一名代理提供更多活动、更多责任。
But start simple with hard coded or Python coded workflows. 但从简单的硬编码或 Python 编码工作流程开始。
So my fourth piece of advice is super important, particularly for people from a software engineering 所以我的第四条建议非常重要，特别是对于软件工程人员来说
background such as myself, it's common to come into building agent solutions with a blank sheet of 像我这样的背景，通常会用一张白纸来构建代理解决方案
paper and draw some big agent architecture diagram. 纸并画一些大的代理架构图。
And in my view, that's not the best approach. 在我看来，这不是最好的方法。
It's better to work on these things. 最好在这些事情上努力。
Bottoms up. 自下而上。
Start with a simple agent. 从一个简单的代理开始。
Take a small part of your problem and solve it well with one simple agent, one LM call and work on 只用一个简单的代理、一次 LM 调用就可以解决问题的一小部分，然后继续努力
that until you've got that working well, and then add another agent and work bottoms up, building 直到你的工作顺利为止，然后添加另一个代理并自下而上地工作，构建
your platform as you discover what works well and what doesn't. 当您发现什么有效、什么无效时，您就会了解您的平台。
Now, sometimes it's good to actually approach it from both angles. 现在，有时从两个角度来实际处理它是很好的。
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 做一点自上而下和一点自下而上，但在这两种情况下，我更喜欢自下而上
of a genetic workflows, because you need to first discover what's going to perform well with your LMS. 遗传工作流程的一部分，因为您需要首先发现什么可以在您的 LMS 中表现良好。
And the next one is very similar, which is to say, it's best to always start simple and then make 和下一个非常相似，也就是说，最好总是从简单开始，然后使
your platform more complicated when the simple solution is working. 当简单的解决方案有效时，您的平台会变得更加复杂。
I can't tell you how many people have sent me these massive, great solutions, hundreds of lines of 我无法告诉你有多少人向我发送了这些大量的、出色的解决方案，数百行代码
code, and it's not giving them the outcome that they want. 代码，但它没有给他们想要的结果。
And they're saying, I don't know, it's broken. 他们说，我不知道，它坏了。
Why help improve this? 为什么要帮助改善这一点？
Fix it? 修复它吗？
And the answer is it doesn't work that way. 答案是事实并非如此。
You can't do that. 你不能那样做。
It's too hard. 太难了。
You have to start small and simple, solve a simple problem and do it really well, and then gradually 你必须从小而简单的开始，解决一个简单的问题并做得很好，然后逐渐
expand and with each of the building blocks, as you solve each problem, you put them together and 扩展每个构建块，当您解决每个问题时，您将它们组合在一起并
you see the bigger agent workflow working well. 您会看到更大的代理工作流程运行良好。
But that's the right approach, because if you build everything and get complex and the answer doesn't 但这是正确的方法，因为如果你构建了所有东西并变得复杂，而答案却并非如此
match what you're looking for, it's impossible to know where to look. 匹配你正在寻找的东西，你不可能知道去哪里寻找。
And so the simple key start simple. 所以简单的钥匙开始很简单。
And a sort of opposite point to that, interestingly, is I recommend, when starting out, begin by 有趣的是，与此相反的是，我建议在开始时从
using the highest end models to start with with with small data sets, such as using the GPT four one 使用最高端的模型从小数据集开始，例如使用 GPT 四一
or using Claude for right now, Claude for sonnet, maybe not Claude for opus. 或者现在使用克劳德（Claude），十四行诗（十四行诗），也许不是作品（作品）。
That might be a little bit too too expensive, but start with the expensive ones so that you can make 这可能有点太贵了，但是从昂贵的开始，这样你就可以
sure that in theory, what you're trying to accomplish will work. 确保从理论上讲，您想要完成的事情会起作用。
And then once you've got that working, you can then look to move to cheaper models like Claude for 一旦你做到了这一点，你就可以考虑转向像 Claude 这样更便宜的型号
sonnet or GPT for one mini, or maybe GPT for one nano. 一台 mini 可以使用 sonnet 或 GPT，或者一台 nano 可以使用 GPT。
And as you make your prompts more and more instructive and precise, you may be able to achieve similar 当你让你的提示变得越来越有指导性和精确性时，你也许能够实现类似的目标
performance with lighter models. 较轻型号的性能。
But as you start with your simple solutions, start with the high powered models so you can prove out 但是，当您从简单的解决方案开始时，请从高性能模型开始，这样您就可以证明
what works and what doesn't. 什么有效，什么无效。
And then the next piece of advice for you. 然后是给你的下一条建议。
This is a subtle one, so I see a lot of people getting caught up in trying to figure out different 这是一个微妙的问题，所以我看到很多人都试图找出不同的方法
types of memory, which is a construct that I feel is like overworked. 类型的记忆，我觉得这是一种过度劳累的结构。
There's like short term memory, some people call it, which is usually just looking at the conversation 有些人称之为短期记忆，通常只是看对话
so far. 迄今为止。
And then there's longer term memory, which is usually other words for for looking up like a rag retrieval 然后是长期记忆，通常是像检索抹布一样查找的其他词
in a database or using the kind of knowledge graph that we used in the trading project. 在数据库中或使用我们在交易项目中使用的知识图谱。
The thing to keep in mind is that all of these different memory techniques are, in fact, just different 需要记住的是，所有这些不同的记忆技巧实际上只是不同的
ways of finding relevant context and shoving it in the prompt. 找到相关上下文并将其放入提示中的方法。
It's all about what goes in the prompt at the end of the day. 这一切都与一天结束时提示中的内容有关。
And so keep a clear mind about that and make sure that that whilst you might use various tools and techniques 因此，请保持清醒的头脑，并确保在您可能使用各种工具和技术的同时
for memory at, at the end of the day, all you're doing is trying to find the right relevant material 为了记忆，在一天结束时，你所做的就是试图找到正确的相关材料
for the prompts. 以获得提示。
So look at the prompts, see what's being included there, look at the tools you're using and see what 因此，请查看提示，查看其中包含的内容，查看您正在使用的工具，看看有什么
information is being retrieved. 正在检索信息。
And make sure that you're giving the LLM the right context to be able to answer its question. 并确保您为法学硕士提供了正确的背景，以便能够回答其问题。
And so rather than getting too bogged down in what kinds of memory you're using, focus on what kind 因此，不要太纠结于您正在使用哪种内存，而应该关注哪种内存
of information does the LM need to answer the question? LM 需要多少信息来回答这个问题？
And are you providing that information in the prompts? 您是否在提示中提供了该信息？
Okay. 好的。
And I'm almost done with this preachy advice for you. 我差不多已经给你讲完了这个说教建议。
Let's go to number eight. 我们来看第八点。
It's very similar point again, which is that look, most of the difficulties that you come up against 又是非常相似的一点，就是看起来，你遇到的大多数困难
working with agent systems and with LMS generally are fixed by better prompting and by experimenting 使用代理系统和学习管理系统通常可以通过更好的提示和实验来解决
with your prompts. 根据您的提示。
People often are message me and say, can I use fine tuning for this? 人们经常给我留言说，我可以为此使用微调吗？
Can I use a different encoder? 我可以使用不同的编码器吗？
LM for my rag? LM 给我的抹布？
All sorts of sophisticated stuff, when often the right answer is to just focus on the prompts, make 各种复杂的东西，通常正确的答案是只关注提示，
something a bit simpler, a bit more directive, a bit more instructive. 一些更简单、更有指导性、更有启发性的东西。
If it's outputting one thing, then try and tell it not to give it some examples of what a good output 如果它输出一件事，那么尝试告诉它不要给它一些关于什么是好的输出的例子
looks like. 看起来像。
You can get so far just by working on your prompts. 您只需按照提示进行操作即可完成此任务。
And a similar point again is also look at the traces. 而同样的一点又是看痕迹。
Of course, this is a great discipline to get into, even if your agents seem to be working well and 当然，即使你的代理人看起来工作得很好并且
they're giving the answers that you expect. 他们正在给出您期望的答案。
You should still be disciplined to go and check that everything is just as you want in the traces, 你仍然应该遵守纪律去检查痕迹中的一切是否都如你所愿，
just in case there's extra tool call happening. 以防万一发生额外的工具调用。
There's some weird stuff happening now. 现在发生了一些奇怪的事情。
I'm often guilty of not going back and looking at the traces, particularly if things seem to be working, 我常常因为没有回去查看痕迹而感到内疚，尤其是当事情看起来正常的时候，
and then often when I do, I then discover that there is something in there, there is a gotcha that 然后经常当我这样做时，我会发现里面有一些东西，有一个陷阱
I can fix. 我可以修复。
And so it is so important, even if I don't take my own advice on this always you should you should 所以这非常重要，即使我不接受我自己的建议，你也应该这样做
go in and check, check the traces. 进去检查一下，检查一下痕迹。
Always. 总是。
As you're building your agent system, make sure things are behaving the way that you expect. 当您构建代理系统时，请确保一切按照您期望的方式运行。
And I've left the most important piece of advice to the very end. 我把最重要的建议留到了最后。
And here it is. 就是这样。
Look, being an AI engineer, being an LM engineer involves wearing two hats, a software engineering 看，作为一名 AI 工程师，作为一名 LM 工程师涉及两顶帽子，一顶软件工程
hat, and a data scientists hat. 帽子和数据科学家帽子。
And when you're beginning your project, when you're at the starting point of building a new system, 当你开始你的项目时，当你处于构建新系统的起点时，
you need to be taking firmly off the software engineering hat and putting on that scientist hat and 你需要坚定地摘下软件工程的帽子，戴上科学家的帽子
be a scientist. 成为一名科学家。
That means be comfortable with experimentation and R&D. 这意味着要乐于进行实验和研发。
People often come to me and say, which? 人们经常来找我问，哪一个？
Which model should I pick A, B, or C? 我应该选择 A、B 或 C 中的哪个型号？
Which technique should I use? 我应该使用哪种技术？
This, this or this? 这个，这个还是这个？
Which tool should I use? 我应该使用哪个工具？
And the answer is you should try them all. 答案是你应该尝试所有这些。
Try them. 尝试一下。
Experiment. 实验。
Look at your overall business metric that you're using to gauge success, and use that to judge which 查看用于衡量成功的整体业务指标，并用它来判断哪些
of the different techniques is working better for you, and embrace the experimentation. 不同的技术对你来说效果更好，并接受实验。
It's absolutely key. 这绝对是关键。
I've put a whole guide about this. 我已经为此准备了完整的指南。
If you look in the guides, you'll see one. 如果您查看指南，您会看到一个。
I think it's one of the last ones is about how to build your own projects. 我认为最后的问题之一是关于如何构建自己的项目。
And I talk a lot about this. 我对此谈了很多。
There's no shortcut to R&D. 研发没有捷径。
Embrace being a scientist and researching and exploring and understanding what works well. 拥抱成为一名科学家，研究、探索和理解什么是有效的。
I often have an instinct about the right way to go and build something, but it turns out my instinct 我经常有一种关于构建某些东西的正确方法的本能，但事实证明我的本能
is often wrong. 经常是错误的。
So don't trust my instinct, but instead experiment and discover for yourself. 所以不要相信我的直觉，而是自己尝试和发现。