And now for my next trick. 现在我的下一个技巧。
And our last trick for today. 这是我们今天的最后一个技巧。
I'm going to switch it to store it in SQL instead. 我将把它改为存储在 SQL 中。
Our memory is going to be in a SQL database. 我们的内存将存储在 SQL 数据库中。
And again this is impressive stuff. 这又是令人印象深刻的事情。
It's great that it's so simple and easy to switch to using SQL. 切换到使用 SQL 是如此简单和容易，这真是太棒了。
We just import uh, this SQL Lite saver instead. 我们只需导入这个 SQL Lite 保护程序即可。
And uh we're going to write to a memory DB. 呃，我们将写入内存数据库。
We connect that way. 我们就这样联系起来。
Uh, we come in and it's just exactly the same code. 呃，我们进来了，代码完全一样。
But we're of course putting in the SQL memory instead of the memory before. 但我们当然是放入 SQL 内存而不是之前的内存。
I mean, it's just different name of a variable, but it's the exactly the same approach, uh, as we 我的意思是，这只是变量的名称不同，但它的方法完全相同，呃，就像我们一样
had before. 以前有过。
Nothing different there at all. 那里完全没有什么不同。
There we go. 我们开始吧。
I'm going to make the thread ID a different ID because since it's SQL, it's kind of remember from my, 我将把线程 ID 设置为不同的 ID，因为它是 SQL，所以它是我的记忆，
my, my tests. 我的，我的测试。
Uh, but uh, then we can come in and we can say hi there and see. 呃，但是呃，然后我们可以进来，我们可以在那里打个招呼，看看。
How can I assist you today? 今天我能为您提供什么帮助？
Uh, what's my name? 呃，我叫什么名字？
And I don't have access. 而且我没有访问权限。
Uh, my name is Ed. 呃，我叫艾德。
Nice to meet you, Ed. 很高兴认识你，艾德。
How can I assist you today? 今天我能为您提供什么帮助？
All right, so with that, uh, we can now go back here, and this time, we can just recreate the whole 好吧，那么，呃，我们现在可以回到这里，这一次，我们可以重新创建整个
thing from scratch. 事情从头开始。
It's like I could. 好像我可以。
I could restart my kernel. 我可以重新启动我的内核。
I should restart my kernel. 我应该重新启动我的内核。
Why don't I do that? 我为什么不这样做呢？
You'll have to bear with me. 你得忍受我。
We will clear. 我们会清除。
We will restart kernel, clear all outputs. 我们将重新启动内核，清除所有输出。
We'll go all the way back up to the top, run our imports. 我们将一路回到顶部，运行我们的导入。
We will load the dot env. 我们将加载点环境。
Just check. 检查一下。
I guess I should load in the tools again because we're going to use these do this, do this. 我想我应该再次加载这些工具，因为我们将使用这些工具来做这个，做这个。
Get the pushover message me. 给我发消息。
My phone's on silent. 我的手机处于静音状态。
Bring them together. 把他们聚集在一起。
Get our state object because we reuse that at various points. 获取我们的状态对象，因为我们在不同的点重用它。
And now from this point onwards, I think now we can now go back here. 现在从现在开始，我想我们现在可以回到这里了。
So we're completely fresh. 所以我们完全新鲜。
Uh, so now we're going to recreate this. 呃，现在我们要重新创建这个。
We are going to rebuild our graph builder. 我们将重建我们的图表生成器。
There it is. 就在那里。
And here we go. 我们开始吧。
And hi there. 你好。
Hello again editor. 编辑您好。
Ha there you have it. 哈，你有它。
Restart the kernel. 重新启动内核。
Uh, completely bring everything fresh. 呃，完全给一切带来新鲜感。
And of course, it knows who I am. 当然，它知道我是谁。
And it knows that because you can see right here in this directory, there's a bunch of database objects. 它知道，因为您可以在这个目录中看到，有一堆数据库对象。
It's storing it in a SQLite database. 它将其存储在 SQLite 数据库中。
And so we have persistent memory with changing like one word uh from, from my code. 所以我们有持久的记忆，就像我的代码中的一个词一样。
And I think that is really impressive. 我认为这确实令人印象深刻。
And I realized just before we, we closed this, I should also show that the tools are working and in 我意识到就在我们关闭这个之前，我还应该表明这些工具正在工作并且在
action. 行动。
So after saying this, I should let's do the same thing. 所以说完这句话后，我应该做同样的事情。
Um. 一。
Please send me a push notification with the current USD GBP exchange rates. 请向我发送包含当前美元英镑汇率的推送通知。
Let's let it do its thing. 让我们让它做它该做的事。
Off it goes. 关了就走了。
And I just got a push notification and it says 0.78. 我刚刚收到一条推送通知，上面写着 0.78。
Ha ha ha! 哈哈哈！
There we go. 我们开始吧。
So, uh. 所以，呃。
Success. 成功。
Uh, I think, um, maybe, uh. 呃，我想，嗯，也许，呃。
Interesting. 有趣的。
Uh, what what if I say I can? 呃，如果我说我可以呢？
I'm trying to think about how we can use memory as well. 我也在尝试思考我们如何使用内存。
Can you send that? 你能发送那个吗？
Can you send that push notification again, please? 您能再次发送该推送通知吗？
Let's try that. 让我们试试吧。
There we go. 我们开始吧。
I got another push notification with the same thing. 我又收到了同样内容的推送通知。
So there, there. 那么那里，那里。
I had to think for a moment. 我不得不思考一下。
There's a demonstration of both memory and tool calling in one shot with the right answer. 演示了内存和工具一次调用正确答案的过程。
Success. 成功。
And you can see the various calls happening down there. 您可以看到下面发生的各种呼叫。
So that then is a wrap on this. 那么这就是这个的总结。
Um, and uh, it might be nice for us just to bring that up in Lang Smith just to see those calls. 嗯，呃，如果我们能在 Lang Smith 中提及这一点，看看这些电话，可能会很好。
And so here we are in Lang Smith looking at that most recent request. 因此，我们在兰史密斯正在研究最近的请求。
And it's good to see that, as I was hoping to see it did use the tool to send the push notification. 很高兴看到这一点，因为我希望看到它确实使用该工具发送推送通知。
It didn't bother doing the search again because it had that in its memory. 它没有费心再次进行搜索，因为它已经在内存中了。
And you can see at the bottom here that it sends that push notification, and it then confirms back 您可以在底部看到它发送推送通知，然后确认回来
there that it did it as just as we saw in the chat. 就像我们在聊天中看到的那样。
And you can see all of the history that it's got up above it. 你可以看到它上面的所有历史。
So you can see in Lang Smith that true to its word, everything is working. 因此，您可以在朗史密斯身上看到，正如其所言，一切都在发挥作用。
The memory is working, the tool call is working. 内存正在工作，工具调用正在工作。
Uh, and it knew that it already knew the exchange rate. 呃，它知道它已经知道汇率了。
Uh, so I'd say that that is a success. 呃，所以我想说这是成功的。
And to wrap up, let me show you one more time this great picture, which now I hope is lands nicely 最后，让我再向您展示这张精彩的照片，我希望它能顺利落地
with you. 与你。
We define our graph. 我们定义我们的图表。
We run each super step with each interaction, and these red lines are showing the checkpointing that's 我们在每次交互中运行每个超级步骤，这些红线显示了检查点
happening so that we can resume at any point. 发生这样我们就可以随时恢复。
We can replay the state as it was. 我们可以按原样重放该状态。
Then we can time travel back, and we can persist this in a database so that it maintains knowledge 然后我们可以时间旅行回来，我们可以将其保存在数据库中，以便它维护知识
of the conversation. 的谈话。
And it's keyed off this thread ID. 并且它已关闭该线程 ID。
And with that that concludes day three. 第三天就这样结束了。
And it was a meaty day. 这真是多肉的一天。
We covered a lot of ground. 我们涵盖了很多领域。
And I hope that you're building some of the same enthusiasms that I'm that I'm growing. 我希望你也能像我一样，培养出一些同样的热情。
As we get into this. 当我们进入这个话题时。
For Landgraf, and seeing seeing the strengths, seeing how resilient, how robust it is, uh, and 对于 Landgraf 来说，看到它的优势，看到它有多么有弹性，有多么强大，呃，
this, this discipline that it puts around the process. 这个，它围绕流程制定的纪律。
But that's enough of the, of the, of the learning and the concepts. 但学习和概念就足够了。
Next time we launch into our project, our project called sidekick. 下次我们启动我们的项目时，我们的项目称为 sidekick。
And it's a really great one. 这真的很棒。
I can't wait to show it to you. 我迫不及待地想向你展示它。
See you then. 到时候见。