# Agentic AI Engineering: Complete 4-Hour Workshop feat. MCP, CrewAI and OpenAI Agents SDK

https://www.youtube.com/watch?v=LSk5KaEGVk4
Translation: de

[00:00] All right, ladies and gentlemen, the moment you've been waiting for.
  Alles klar, meine Damen und Herren, der Moment, auf den Sie gewartet haben.

[00:02] Please welcome John to the stage.
  Bitte begrüßen Sie John auf der Bühne.

[00:08] Thank you so much for the introduction, Sheamus.
  Vielen Dank für die Einführung, Sheamus.

[00:11] And it's nice to see a packed house for this agentic AI conference or Agentic AI workshop.
  Und es ist schön, ein volles Haus für diese Agentic-AI-Konferenz oder diesen Agentic-AI-Workshop zu sehen.

[00:16] It isn't necessarily an Agentic AI conference, but it does feel like it a lot of the time, doesn't it?
  Es ist nicht unbedingt eine Agentic-AI-Konferenz, aber es fühlt sich die meiste Zeit so an, nicht wahr?

[00:23] We're going to start off in module one with defining agents and then you love coding exercises.
  Wir beginnen in Modul eins mit der Definition von Agenten, und da Sie Programmierübungen lieben,

[00:30] So Ed will lead a coding exercise um uh in the second half of this module in which you will recreate deep research.
  wird Ed in der zweiten Hälfte dieses Moduls eine Programmierübung leiten, in der Sie Deep Research nachbauen werden.

[00:38] OpenAI's deep research.
  OpenAIs Deep Research.

[00:41] You'll recreate that using the OpenAI agents SDK.
  Sie werden das mithilfe des OpenAI Agents SDK nachbauen.

[00:43] In module two, we'll talk about design principles for building effective agentic systems and Ed will lead a coding session where you will create an engineering team of agents using crew AI.
  In Modul zwei sprechen wir über Designprinzipien für den Aufbau effektiver agentischer Systeme, und Ed wird eine Programmiersitzung leiten, in der Sie mithilfe von Crew AI ein Ingenieurteam aus Agenten erstellen werden.

[00:59] And then finally
  Und dann schließlich

[01:03] In the third module, we'll talk about how to be developing agents.
  Im dritten Modul werden wir darüber sprechen, wie man Agenten entwickelt.

[01:08] We'll talk about MCP from Anthropic, which people are really excited about today.
  Wir werden über MCP von Anthropic sprechen, von dem die Leute heute wirklich begeistert sind.

[01:13] It seems to be one of the hottest topics in data science right now.
  Es scheint derzeit eines der heißesten Themen in der Datenwissenschaft zu sein.

[01:15] You will develop alongside Ed an autonomous, uh, a set of autonomous traders.
  Sie werden zusammen mit Ed eine autonome, äh, eine Reihe von autonomen Händlern entwickeln.

[01:22] So you'll actually use the engineering team from module 2 to code up autonomous traders that will, uh, act on simulated financial market data.
  Sie werden also tatsächlich das Engineering-Team aus Modul 2 nutzen, um autonome Händler zu programmieren, die, äh, auf Basis simulierter Finanzmarktdaten agieren.

[01:30] And, uh, we should point out right now that we are not financial advisers, and, uh, any, uh, advice that your agents provide you on financial transactions, uh, Ed and I are not liable for those.
  Und, äh, wir sollten gleich darauf hinweisen, dass wir keine Finanzberater sind, und, äh, für jegliche, äh, Ratschläge, die Ihre Agenten Ihnen zu Finanztransaktionen geben, äh, sind Ed und ich nicht haftbar.

[01:44] Uh, you did it with your agent.
  Äh, Sie haben es mit Ihrem Agenten getan.

[01:46] Sue your agent.
  Verklagen Sie Ihren Agenten.

[01:46] Okay.
  Okay.

[01:48] All right, so let's start off with module one on defining agents.
  Alles klar, fangen wir also mit Modul eins zur Definition von Agenten an.

[01:51] So it is a tricky thing.
  Es ist also eine knifflige Sache.

[01:53] I just came from the keynote next door, and it was pointed out that this, there really isn't a clear definition, but for the purpose of being able to talk about this in a...
  Ich komme gerade von der Keynote nebenan, und es wurde darauf hingewiesen, dass es hierfür wirklich keine klare Definition gibt, aber um darüber sprechen zu können, in einem...

[02:05] In a session like this on agentic AI, we are going to give you a definition, and this one actually comes from Anthropic.
  In einer Sitzung wie dieser über agentische KI werden wir Ihnen eine Definition geben, und diese stammt tatsächlich von Anthropic.

[02:12] AI agents are programs where large language model outputs control the workflow.
  KI-Agenten sind Programme, bei denen die Ausgaben großer Sprachmodelle den Arbeitsablauf steuern.

[02:19] So hopefully that sounds kind of intuitively sensible to you.
  Hoffentlich klingt das für Sie einigermaßen intuitiv sinnvoll.

[02:23] In practice, this describes an AI solution to some kind of problem that involves any or all of the following.
  In der Praxis beschreibt dies eine KI-Lösung für eine Art von Problem, das eines oder alles der Folgenden beinhaltet.

[02:33] Multiple LLM calls.
  Mehrere LLM-Aufrufe.

[02:35] LLM with the ability to use tools, and I'm going to talk about what tools mean.
  LLM mit der Fähigkeit, Werkzeuge zu verwenden, und ich werde darüber sprechen, was Werkzeuge bedeuten.

[02:41] There's an environment where LLMs can interact or agents can interact together.
  Es gibt eine Umgebung, in der LLMs interagieren oder Agenten zusammenarbeiten können.

[02:48] There's a planner that coordinates activities, and critically, this is what makes it agentic.
  Es gibt einen Planer, der Aktivitäten koordiniert, und das ist entscheidend, was es agentisch macht.

[02:53] It has autonomy.
  Es besitzt Autonomie.

[02:57] So it may have some guard rails, but you're not dictating exactly everything that should happen.
  Es mag also einige Leitplanken geben, aber Sie schreiben nicht genau alles vor, was passieren soll.

[03:01] The agent has some autonomy to figure things out on its own.
  Der Agent hat eine gewisse Autonomie, um Dinge selbst herauszufinden.

[03:03] So again.
  Also noch einmal.

[03:05] Any or all of these could be common in an agentic system.
  Jedes oder alle dieser Dinge könnten in einem agentischen System üblich sein.

[03:10] All right.
  Alles klar.

[03:10] Who knows this guy?
  Wer kennt diesen Typen?

[03:11] Andrew Ing.
  Andrew Ing.

[03:12] All right.
  Alles klar.

[03:12] Yeah.
  Ja.

[03:13] Basically everyone knows who he is.
  Im Grunde weiß jeder, wer er ist.

[03:15] So, Andrew Ing was recently on my podcast in episode number 841.
  Also, Andrew Ing war kürzlich in meinem Podcast in Folge Nummer 841.

[03:20] And Andrew Ing believes that there's unprecedented opportunity in 2025, this year, to derive business value by focusing on building AI applications that use agentic workflows.
  Und Andrew Ing glaubt, dass es im Jahr 2025, also diesem Jahr, eine beispiellose Gelegenheit gibt, geschäftlichen Mehrwert zu erzielen, indem man sich auf den Aufbau von KI-Anwendungen konzentriert, die agentische Arbeitsabläufe nutzen.

[03:34] Specifically, the anecdotal evidence at my consultancy, Y Carrot, suggests that he's right.
  Konkret deuten die anekdotischen Beweise in meiner Beratung, Y Carrot, darauf hin, dass er recht hat.

[03:40] I don't want to understate this and it is early days for the company, but 100% of conversations that I have with prospective clients leads to next steps.
  Ich möchte das nicht untertreiben, und es ist noch früh für das Unternehmen, aber 100 % der Gespräche, die ich mit potenziellen Kunden führe, führen zu nächsten Schritten.

[03:51] There isn't anyone who says, "Nah, this isn't what we're looking for right now, or we'll get back to you in 3 months or 6 months."
  Es gibt niemanden, der sagt: „Nein, das ist nicht das, wonach wir gerade suchen, oder wir melden uns in 3 oder 6 Monaten bei Ihnen.“

[03:56] Everybody says, "Great, let's get into an NDA so I can explain more."
  Jeder sagt: „Großartig, lassen Sie uns eine Geheimhaltungsvereinbarung abschließen, damit ich mehr erklären kann.“

[04:01] And then once they do that, they say, "Let's get into a master service agreement so we can start getting to work and flushing out a contract."
  Und sobald sie das getan haben, sagen sie: „Lassen Sie uns einen Rahmenvertrag abschließen, damit wir anfangen können zu arbeiten und einen Vertrag auszuarbeiten.“

[04:07] Then let's get that contract going as quickly as possible.
  Dann lassen Sie uns diesen Vertrag so schnell wie möglich auf den Weg bringen.

[04:09] I can't wait to get this agentic solution, this AI solution in my platform.
  Ich kann es kaum erwarten, diese agentische Lösung, diese KI-Lösung, in meine Plattform zu integrieren.

[04:14] Although that said, not everyone is convinced.
  Obwohl, wie gesagt, nicht jeder überzeugt ist.

[04:17] I should give that, you know, basically except for this slide, we're going to be 100% gung-ho on Agentic AI this whole time.
  Ich sollte dazu sagen, wissen Sie, abgesehen von dieser Folie werden wir die ganze Zeit zu 100 % voll und ganz auf agentische KI setzen.

[04:26] Who knows Andre Burkoff?
  Wer kennt Andre Burkoff?

[04:26] He wrote the 100page machine learning book.
  Er hat das 100-seitige Buch über maschinelles Lernen geschrieben.

[04:29] Yeah, we've got some hands up.
  Ja, wir haben einige Hände oben.

[04:29] So Andre Burkoff was also on my show recently in episode 867.
  Andre Burkoff war kürzlich auch in meiner Sendung in Folge 867 zu Gast.

[04:34] And Andre believes that LLM's agentic systems, including the kinds of multi-aent systems that we'll be talking about in today's training, are overhyped.
  Und Andre glaubt, dass agentische LLM-Systeme, einschließlich der Art von Multi-Agenten-Systemen, über die wir im heutigen Training sprechen werden, überbewertet sind.

[04:45] I'm personally more in Andrew Ing's camp.
  Ich persönlich gehöre eher zum Lager von Andrew Ng.

[04:48] Um I there is certainly some overhype, but the LLMs that power agentic systems today, they do have flaws and they do have limited capabilities, but those are being overcome at a crazy pace.
  Ähm, es gibt sicherlich einen gewissen Hype, aber die LLMs, die heute agentische Systeme antreiben, haben zwar Fehler und begrenzte Fähigkeiten, aber diese werden in einem wahnsinnigen Tempo überwunden.

[05:00] So here is um a chart of some of the leading models uh
  Hier ist also eine Übersicht einiger der führenden Modelle.

[05:07] GPT401, uh, Sonnet 3.5, Gemini 1.5 from Google, um, showing their performance on different benchmarks.
  GPT401, uh, Sonnet 3.5, Gemini 1.5 von Google, um, zeigen ihre Leistung bei verschiedenen Benchmarks.

[05:15] The key one that I want to highlight is humanity's last exam, HLE, which is shown in white and black there.
  Der wichtigste, den ich hervorheben möchte, ist das „Humanity's Last Exam“ (HLE), das dort in Weiß und Schwarz dargestellt ist.

[05:22] So HLE is a multimodal benchmark.
  HLE ist also ein multimodaler Benchmark.

[05:26] It has 2500 very challenging questions across over a 100 subject areas curated by a thousand subject matter experts across 500 institutions, 50 countries and they maintain a private test set of held out questions to assess model overfitting and of course prevent training to test.
  Er umfasst 2500 sehr anspruchsvolle Fragen aus über 100 Fachgebieten, die von tausend Fachexperten aus 500 Institutionen in 50 Ländern kuratiert wurden, und sie pflegen einen privaten Testsatz mit zurückgehaltenen Fragen, um eine Überanpassung des Modells zu bewerten und natürlich das Training auf die Testdaten zu verhindern.

[05:43] Ah, I do see people taking photos of the slides.
  Ah, ich sehe, dass Leute Fotos von den Folien machen.

[05:46] So you can actually, um, there's a GitHub repo that Ed will bring up shortly which will have a link to the slides.
  Sie können also tatsächlich, um, es gibt ein GitHub-Repo, das Ed in Kürze zeigen wird und das einen Link zu den Folien enthalten wird.

[05:52] You can also go to my website johncone.com/talks.
  Sie können auch auf meine Website johncone.com/talks gehen.

[05:58] Uh, so johncone.com/talks and there you can also access the slides.
  Uh, also johncone.com/talks und dort können Sie ebenfalls auf die Folien zugreifen.

[06:03] If you're watching the recording in the future, you can make your way to today's date which is May 14th.
  Wenn Sie die Aufzeichnung in der Zukunft ansehen, können Sie zu dem heutigen Datum navigieren, dem 14. Mai.

[06:12] 14th of 2025 and there's a link to the slides from my website there.
  Der 14. des Jahres 2025 und dort gibt es einen Link zu den Folien von meiner Website.

[06:18] The whole point of HLE, of Humanity's Last Exam, was to create a benchmark that is very hard for today's LLMs and it's supposed to take many years to overcome.
  Der ganze Sinn von HLE, dem „Humanity's Last Exam“, bestand darin, einen Benchmark zu schaffen, der für die heutigen LLMs sehr schwer ist und dessen Überwindung viele Jahre dauern soll.

[06:28] And so you see that all these leading models, the best performance you're getting from o1, which is this chain of thought model that can reason, that can reflect on its responses and come up with better ones.
  Und so sehen Sie, dass bei all diesen führenden Modellen die beste Leistung von o1 kommt, diesem Chain-of-Thought-Modell, das schlussfolgern kann, über seine Antworten nachdenken kann und bessere hervorbringt.

[06:41] It performs at 10%.
  Es erreicht eine Leistung von 10 %.

[06:44] All the others are around 5%.
  Alle anderen liegen bei etwa 5 %.

[06:47] And so the idea was that this should last a long time, that Humanity's Last Exam should be difficult to conquer.
  Die Idee war also, dass dies lange Bestand haben sollte, dass das „Humanity's Last Exam“ schwer zu bewältigen sein sollte.

[06:51] And yet when you contain an LLM within an agentic workflow that allows step-by-step chain of thought processing, checking accuracy of work, real-time internet searches like OpenAI deep research, which you guys will be recreating today using the OpenAI agents SDK.
  Und doch, wenn man ein LLM in einen agentenbasierten Workflow einbettet, der schrittweise Chain-of-Thought-Verarbeitung, die Überprüfung der Genauigkeit der Arbeit und Echtzeit-Internetsuchen wie bei OpenAI Deep Research ermöglicht – was ihr heute mithilfe des OpenAI Agents SDK nachbauen werdet.

[07:10] Boom.
  Bumm.

[07:10] All of a sudden, you have.
  Plötzlich hat man es.

[07:12] Over 25% accuracy.
  Über 25% Genauigkeit.

[07:14] And there's lots of extra headroom in that because you can extend your inference time.
  Und es gibt viel zusätzlichen Spielraum, weil man die Inferenzzeit verlängern kann.

[07:18] You can compute for longer on your responses.
  Sie können länger an Ihren Antworten rechnen.

[07:21] And so mere months after humanity's last exams release, it suddenly looks conquerable.
  Und so, nur wenige Monate nach der Veröffentlichung der letzten Prüfungen der Menschheit, sieht es plötzlich bezwingbar aus.

[07:26] And that's thanks to agents.
  Und das ist den Agenten zu verdanken.

[07:28] So you have this wind at your back of LLM capabilities and then wrapped in agentic frameworks, they're particularly powerful.
  Sie haben also diesen Rückenwind durch LLM-Fähigkeiten, und in agentische Frameworks verpackt sind sie besonders leistungsstark.

[07:35] Here's another chart, an exponential chart.
  Hier ist ein weiteres Diagramm, ein exponentielles Diagramm.

[07:37] So if you check out the y-axis, you can see that it goes from 1 second, 4 seconds, 15, then a minute, and then you're into hour ranges quickly on the y-axis over here.
  Wenn Sie sich also die y-Achse ansehen, können Sie sehen, dass sie von 1 Sekunde, 4 Sekunden, 15, dann eine Minute reicht, und dann sind Sie hier auf der y-Achse schnell im Stundenbereich.

[07:51] And the point of this chart is that it's showing how cognitive tasks that would take a human, you know, in the bottom left corner, just a few seconds or around here a few minutes, and now we're starting to get closer and closer to an hour.
  Und der Punkt dieses Diagramms ist, dass es zeigt, wie kognitive Aufgaben, die einen Menschen, wissen Sie, in der unteren linken Ecke, nur ein paar Sekunden oder hier ein paar Minuten kosten würden, und jetzt kommen wir einer Stunde immer näher.

[08:05] Cognitive tasks that would take a human that kind of timeline are being handled with a 50% success rate by.
  Kognitive Aufgaben, die einen Menschen einen solchen Zeitrahmen kosten würden, werden mit einer Erfolgsquote von 50% bewältigt von.

[08:15] Today's models.
  Die heutigen Modelle.

[08:15] So, we're inching closer to an hour.
  Wir nähern uns also einer Stunde an.

[08:20] And so, people will use this chart to justify that artificial general intelligence, an algorithm that has all the capabilities of a human, is merely months or years away.
  Und so werden die Leute dieses Diagramm verwenden, um zu rechtfertigen, dass künstliche allgemeine Intelligenz, ein Algorithmus, der alle Fähigkeiten eines Menschen besitzt, nur noch Monate oder Jahre entfernt ist.

[08:31] Now, I wouldn't take it that far because there's a number of limitations here because we're talking about a 50% success rate.
  Nun, ich würde nicht so weit gehen, weil es hier eine Reihe von Einschränkungen gibt, da wir von einer Erfolgsquote von 50 % sprechen.

[08:36] That's not useful in a lot of enterprise applications.
  Das ist in vielen Unternehmensanwendungen nicht nützlich.

[08:37] Um, and this is actually specific to tasks that you can easily create multi-step training data for.
  Ähm, und das ist tatsächlich spezifisch für Aufgaben, für die man leicht mehrstufige Trainingsdaten erstellen kann.

[08:47] So, math problems, machine learning problems, coding problems, those kinds of things.
  Also mathematische Probleme, Probleme des maschinellen Lernens, Programmierprobleme, solche Dinge.

[08:51] Yes, more generally, there's still a long ways to go.
  Ja, allgemeiner gesagt, ist es noch ein langer Weg.

[08:54] I think we're at least years away from AGI, but nevertheless, the point of this chart should be exciting for you because you're interested in building agentic systems.
  Ich denke, wir sind noch mindestens Jahre von AGI entfernt, aber dennoch sollte der Punkt dieses Diagramms für Sie aufregend sein, weil Sie daran interessiert sind, agentenbasierte Systeme zu bauen.

[09:04] And so you have this wind at your back of all of this power that's getting better all the time.
  Und so haben Sie diesen Rückenwind durch all diese Kraft, die ständig besser wird.

[09:08] So my general advice to you is that it's never been a better time to develop AI agents.
  Mein allgemeiner Rat an Sie ist also, dass es noch nie einen besseren Zeitpunkt gab, um KI-Agenten zu entwickeln.

[09:16] There is unprecedented opportunity for creativity and impact because of this.
  Aufgrund dessen gibt es beispiellose Möglichkeiten für Kreativität und Wirkung.

[09:21] My overall guidance is that while agents aren't perfect or suitable for all enterprise use cases today, there are a ton of use cases that they are useful for.
  Mein allgemeiner Rat ist, dass Agenten zwar heute noch nicht perfekt oder für alle Unternehmensanwendungsfälle geeignet sind, es aber eine Vielzahl von Anwendungsfällen gibt, für die sie nützlich sind.

[09:31] So, especially on repetitive tasks, multi-agent systems can be inexpensive to design and deploy thanks to the kinds of techniques that Ed will be showing you today.
  Besonders bei repetitiven Aufgaben können Multi-Agenten-Systeme dank der Techniken, die Ed Ihnen heute zeigen wird, kostengünstig entworfen und bereitgestellt werden.

[09:42] They allow you to substantially augment, improving the outcome of business processes, or to even fully automate tasks today that are done entirely by humans.
  Sie ermöglichen es Ihnen, Geschäftsprozesse wesentlich zu erweitern und deren Ergebnisse zu verbessern oder sogar Aufgaben, die heute vollständig von Menschen erledigt werden, vollständig zu automatisieren.

[09:52] It's like robotic process automation, RPA, on steroids.
  Es ist wie Robotic Process Automation, RPA, auf Steroiden.

[09:55] And it allows measurable operational metric improvement and or ROI return on investment over condensed time frames.
  Und es ermöglicht messbare Verbesserungen betrieblicher Kennzahlen und/oder einen ROI (Return on Investment) innerhalb verkürzter Zeitrahmen.

[10:05] And so if you can find some lowhanging fruit, get that operational improvement, demonstrate that ROI, that creates a flywheel, an AI ROI flywheel.
  Wenn Sie also einige leicht erreichbare Ziele finden, diese betriebliche Verbesserung erzielen und diesen ROI nachweisen können, erzeugt das ein Schwungrad, ein KI-ROI-Schwungrad.

[10:18] Where management says, "Wow, look at this improvement."
  Wo das Management sagt: „Wow, schauen Sie sich diese Verbesserung an.“

[10:21] Look at this ROI from that small agentic project that we invested in.
  Schauen Sie sich diesen ROI von dem kleinen agentischen Projekt an, in das wir investiert haben.

[10:25] And so then they'll invest more and you can tackle bigger and bigger projects, get the AI ROI flywheel spinning faster and faster.
  Und dann werden sie mehr investieren, und Sie können immer größere Projekte in Angriff nehmen und das KI-ROI-Schwungrad immer schneller drehen lassen.

[10:36] And just in terms of other broad reasons why it's an unprecedented time to be developing automated systems and projects, obviously advances in LLMs, like I just talked about in the preceding slides, as well as the kinds of frameworks that we have access to, things like PyTorch Lightning and Hugging Face and the agentic frameworks that Ed will be showing today.
  Und nur im Hinblick auf andere allgemeine Gründe, warum es eine beispiellose Zeit ist, automatisierte Systeme und Projekte zu entwickeln: offensichtlich Fortschritte bei LLMs, wie ich gerade in den vorangegangenen Folien besprochen habe, sowie die Art von Frameworks, auf die wir Zugriff haben, Dinge wie PyTorch Lightning und Hugging Face und die agentischen Frameworks, die Ed heute zeigen wird.

[10:55] Cloud compute and infrastructure like AWS, Google Cloud, Azure allows us to scale more rapidly than ever before.
  Cloud-Computing und Infrastruktur wie AWS, Google Cloud und Azure ermöglichen es uns, schneller als je zuvor zu skalieren.

[11:02] Serverless computing and containerization techniques like Docker and Kubernetes simplify deployment and management of these automated systems.
  Serverloses Computing und Containerisierungstechniken wie Docker und Kubernetes vereinfachen die Bereitstellung und Verwaltung dieser automatisierten Systeme.

[11:10] Data, massive open source data sets are available online repositories and increasing digitization across industries means that we have way more.
  Daten, riesige Open-Source-Datensätze sind in Online-Repositories verfügbar, und die zunehmende Digitalisierung in allen Branchen bedeutet, dass wir viel mehr haben.

[11:19] Data all the time.
  Die ganze Zeit Daten.

[11:21] It's something like every 6 months the amount of data on the planet doubles which is insane and provides you with lots of fodder for your AI systems.
  Es ist so, dass sich die Datenmenge auf dem Planeten etwa alle 6 Monate verdoppelt, was wahnsinnig ist und Ihnen viel Futter für Ihre KI-Systeme liefert.

[11:29] Um, open source software, GitHub repositories, extensive documentation allow for easy sharing, reuse, and collaboration on automation projects.
  Ähm, Open-Source-Software, GitHub-Repositories und umfangreiche Dokumentationen ermöglichen ein einfaches Teilen, Wiederverwenden und Zusammenarbeiten bei Automatisierungsprojekten.

[11:38] Lowcost hardware mean that you could have sensors, microcontrollers, Raspberry Pies, edge computing devices that the agents are taking action with or recording data from.
  Kostengünstige Hardware bedeutet, dass Sie Sensoren, Mikrocontroller, Raspberry Pis und Edge-Computing-Geräte haben könnten, mit denen die Agenten Aktionen ausführen oder von denen sie Daten aufzeichnen.

[11:47] Uh, that make it you know the the the the landscape of potential um is uh is accelerated by this lowcost hardware.
  Äh, das macht, wissen Sie, die Landschaft der Möglichkeiten, ähm, wird durch diese kostengünstige Hardware beschleunigt.

[11:56] Uh user-friendly development tools.
  Äh, benutzerfreundliche Entwicklungstools.

[11:58] Uh so drag and drop programming interfaces for people who don't code are increasingly common and even just the tools that we have like Ed will be demoing today.
  Äh, also Drag-and-Drop-Programmierschnittstellen für Leute, die nicht programmieren, werden immer häufiger, und sogar die Tools, die wir haben, wie Ed sie heute demonstrieren wird.

[12:06] They make it so easy to build agentic systems and it will get easier and easier as we develop more and more abstractions connectivity.
  Sie machen es so einfach, agentenbasierte Systeme zu bauen, und es wird immer einfacher werden, je mehr Abstraktionen und Konnektivität wir entwickeln.

[12:15] So high-speed internet, 5G networks, wireless networks.
  Also Hochgeschwindigkeitsinternet, 5G-Netzwerke, drahtlose Netzwerke.

[12:16] It won't be long before everyone on the planet has.
  Es wird nicht lange dauern, bis jeder auf dem Planeten es hat.

[12:20] High-speed internet.
  Hochgeschwindigkeitsinternet.

[12:22] Allowing these kinds of agentic systems to make a big impact everywhere in the world.
  Dies ermöglicht es diesen Arten von agentischen Systemen, überall auf der Welt einen großen Einfluss auszuüben.

[12:26] In some countries, in some regions, there's a supportive regulatory environment.
  In einigen Ländern und Regionen gibt es ein unterstützendes regulatorisches Umfeld.

[12:29] In the US, where we are today, governments and regulatory bodies recognize and support technological innovation in particular.
  In den USA, wo wir uns heute befinden, erkennen und unterstützen Regierungen und Regulierungsbehörden insbesondere technologische Innovationen.

[12:36] There's strong market demand, as I've already been describing.
  Es gibt eine starke Marktnachfrage, wie ich bereits beschrieben habe.

[12:38] At Y Carro, we are experiencing this.
  Bei Y Carro erleben wir das.

[12:40] The market wants these kinds of solutions.
  Der Markt will diese Art von Lösungen.

[12:43] And due to things like labor shortages in a lot of countries, desire for productivity improvements, safety requirements, cost reduction pressures, this is a huge factor.
  Und aufgrund von Dingen wie Arbeitskräftemangel in vielen Ländern, dem Wunsch nach Produktivitätssteigerungen, Sicherheitsanforderungen und Kostensenkungsdruck ist dies ein riesiger Faktor.

[12:57] Finally, availability of educational resources like this training, like the open data science conference, through online courses, tutorials like Ed's Udemy course, you get free or very inexpensive training on the most cutting edge approaches.
  Schließlich ist die Verfügbarkeit von Bildungsressourcen wie diesem Training, der Open Data Science Conference, Online-Kursen und Tutorials wie Eds Udemy-Kurs ein Grund, warum man kostenlose oder sehr günstige Schulungen zu den modernsten Ansätzen erhält.

[13:12] So these are my 10 reasons why it's never been a better time to develop AI agents.
  Das sind also meine 10 Gründe, warum es noch nie einen besseren Zeitpunkt gab, KI-Agenten zu entwickeln.

[13:16] Collectively these advancements and conditions.
  Zusammengenommen diese Fortschritte und Bedingungen.

[13:20] Yeah, make it an exceptionally favorable time to be implementing automated solutions with agentic AI as some examples.
  Ja, machen Sie es zu einer außergewöhnlich günstigen Zeit, um automatisierte Lösungen mit agentenbasierter KI zu implementieren, als einige Beispiele.

[13:30] In case, you know, you're looking for some, you can talk to your favorite LLM to get ideas.
  Falls Sie, wissen Sie, nach einigen suchen, können Sie mit Ihrem bevorzugten LLM sprechen, um Ideen zu erhalten.

[13:34] You can describe your particular business, and it will provide lots of agentic ideas for you.
  Sie können Ihr spezielles Unternehmen beschreiben, und es wird Ihnen viele agentenbasierte Ideen liefern.

[13:38] But to get your brain cells churning, code generation is a straightforward example.
  Aber um Ihre Gehirnzellen in Schwung zu bringen, ist die Codegenerierung ein einfaches Beispiel.

[13:45] So, generating pseudo code, checking for architectural soundness, transforming that pseudo code into actual code—all of these things can be handled by agents.
  Also, das Generieren von Pseudocode, das Überprüfen auf architektonische Solidität, das Umwandeln dieses Pseudocodes in tatsächlichen Code – all diese Dinge können von Agenten erledigt werden.

[13:55] In fact, as you'll see in module 2 today, you can have agents be a whole team of software developers working for you on whatever software development task.
  Tatsächlich können Sie, wie Sie heute in Modul 2 sehen werden, Agenten als ein ganzes Team von Softwareentwicklern einsetzen, die für Sie an jeder beliebigen Softwareentwicklungsaufgabe arbeiten.

[14:03] Medical diagnosis is a cool one that potentially has a lot of impact.
  Medizinische Diagnose ist eine coole Sache, die potenziell eine große Wirkung hat.

[14:08] So, you can have specialized models for neurology, for dermatology, whatever kind of situation that's multimodal, can take images, video, can hear the patient's voice and be providing better medical diagnoses.
  Sie können also spezialisierte Modelle für Neurologie, für Dermatologie haben, jede Art von Situation, die multimodal ist, Bilder oder Videos aufnehmen kann, die Stimme des Patienten hören kann und bessere medizinische Diagnosen liefert.

[14:21] Than ever before.
  Mehr als je zuvor.

[14:23] A scientific literature review.
  Eine wissenschaftliche Literaturrecherche.

[14:25] You can have research papers analyzed by multiple LLMs focusing on different aspects of the paper and then you can actually have an agentic AI system, a multi-agent system, design and run experiments for you.
  Sie können Forschungspapiere von mehreren LLMs analysieren lassen, die sich auf verschiedene Aspekte des Papiers konzentrieren, und dann können Sie tatsächlich ein agentenbasiertes KI-System, ein Multi-Agenten-System, Experimente für sich entwerfen und ausführen lassen.

[14:38] So this has already been done, for example, in machine learning where you know some budget is provided to the AI system to do a literature review, come up with experiments, and run those experiments on compute, on cloud compute, and then write up the results fully autonomously.
  Dies wurde zum Beispiel bereits im Bereich des maschinellen Lernens getan, wo dem KI-System ein gewisses Budget zur Verfügung gestellt wird, um eine Literaturrecherche durchzuführen, sich Experimente auszudenken, diese Experimente auf Rechenleistung, auf Cloud-Computing, auszuführen und dann die Ergebnisse vollkommen autonom niederzuschreiben.

[14:57] And it won't be long before that kind of thing is happening in wet labs as well.
  Und es wird nicht lange dauern, bis so etwas auch in Nasslaboren geschieht.

[15:03] So there's already talk of this.
  Es wird also bereits darüber gesprochen.

[15:04] There are people working on it.
  Es gibt Leute, die daran arbeiten.

[15:05] Big pharmaceutical companies, for example, can have agentic systems designing experiments not just to run in silico on computers but run in the real world using, you know, robotic arms, these kinds of things, in order to run biological chemical experiments in a wet lab.
  Große Pharmaunternehmen können zum Beispiel agentenbasierte Systeme Experimente entwerfen lassen, die nicht nur in silico auf Computern laufen, sondern in der realen Welt unter Verwendung von Roboterarmen und ähnlichen Dingen durchgeführt werden, um biologisch-chemische Experimente in einem Nasslabor auszuführen.

[15:23] Lab uh fully autonomously and then write up the paper.
  Labor äh vollkommen autonom und dann das Papier schreiben.

[15:27] As you're getting the impression, we can replace more and more tasks starting starting with things like uh customer support.
  Wie Sie den Eindruck gewinnen, können wir immer mehr Aufgaben ersetzen, angefangen bei Dingen wie äh Kundensupport.

[15:33] And so more and more tasks can be handled by agents.
  Und so können immer mehr Aufgaben von Agenten erledigt werden.

[15:35] It may be possible in our lifetime, maybe in a decade or two, to have a billion dollar firm with no employees.
  Es könnte zu unseren Lebzeiten, vielleicht in ein oder zwei Jahrzehnten, möglich sein, eine Milliarden-Dollar-Firma ohne Angestellte zu haben.

[15:45] Seriously, it's possible.
  Im Ernst, es ist möglich.

[15:49] All right, that got a chuckle, but uh I wouldn't be shocked.
  Alles klar, das hat für ein Schmunzeln gesorgt, aber äh ich wäre nicht schockiert.

[15:54] Maybe we need someone to sue.
  Vielleicht brauchen wir jemanden, den wir verklagen können.

[15:56] So then there needs to be a human to sue or maybe we'll have legislation that agents are people too.
  Also muss es dann einen Menschen geben, den man verklagen kann, oder vielleicht werden wir Gesetze haben, dass Agenten auch Personen sind.

[16:04] Um all right so we already kind of gave a broad definition of what agents are.
  Ähm alles klar, wir haben also bereits eine grobe Definition davon gegeben, was Agenten sind.

[16:09] Let's uh get into that in more detail.
  Lassen Sie uns äh näher darauf eingehen.

[16:12] We're going to we're going to get into even more detail as this uh training goes on.
  Wir werden noch mehr ins Detail gehen, während dieses äh Training weitergeht.

[16:19] But let's start by um bifurcating agentic systems into two.
  Aber lassen Sie uns damit beginnen, äh agentische Systeme in zwei zu unterteilen.

[16:23] Specific types.
  Spezifische Typen.

[16:26] So the first one is relatively simple.
  Der erste ist also relativ einfach.

[16:27] We can call these workflows.
  Wir können diese Workflows nennen.

[16:27] These are systems where LLMs and tools are orchestrated through predefined code paths.
  Dies sind Systeme, in denen LLMs und Werkzeuge durch vordefinierte Codepfade orchestriert werden.

[16:37] So there's a relatively high level of control that the agentic system designer has in this workflow case.
  Es gibt also ein relativ hohes Maß an Kontrolle, das der Designer des agentischen Systems in diesem Workflow-Fall hat.

[16:42] In contrast, agents, and this is kind of funny because they're both under this agentic systems umbrella, but within agentic systems, you have workflows, which are relatively simple, relatively constrained, and then agents proper.
  Im Gegensatz dazu gibt es Agenten, und das ist irgendwie lustig, weil sie beide unter diesem Dach der agentischen Systeme stehen, aber innerhalb der agentischen Systeme hat man Workflows, die relativ einfach und relativ eingeschränkt sind, und dann die eigentlichen Agenten.

[16:54] And these agents proper are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.
  Und diese eigentlichen Agenten sind Systeme, in denen LLMs ihre eigenen Prozesse und die Werkzeugnutzung dynamisch steuern und die Kontrolle darüber behalten, wie sie Aufgaben erledigen.

[17:05] So, there's a greater level of autonomy here that allows Anthropic to call these actually agents.
  Es gibt also ein höheres Maß an Autonomie, das es Anthropic ermöglicht, diese tatsächlich als Agenten zu bezeichnen.

[17:11] And later on in this training in module two, I'll start off by going into examples of these kinds of workflows and go into agents in more detail.
  Und später in diesem Training in Modul zwei werde ich damit beginnen, auf Beispiele für diese Art von Workflows einzugehen und Agenten detaillierter zu behandeln.

[17:20] But you have this in your back pocket now as just kind of a frame of reference.
  Aber Sie haben dies jetzt als eine Art Bezugsrahmen im Hinterkopf.

[17:22] So.
  Also.

[17:23] When Ed or I are talking about workflows, you have this in mind as relatively constrained systems within the broader agentic systems umbrella.
  Wenn Ed oder ich über Workflows sprechen, haben Sie dies als relativ eingeschränkte Systeme innerhalb des breiteren Dachs agentischer Systeme im Sinn.

[17:34] Let's talk about tools.
  Lassen Sie uns über Werkzeuge sprechen.

[17:34] I've mentioned tools a number of times.
  Ich habe Werkzeuge bereits mehrfach erwähnt.

[17:35] Let's concretely define what these are.
  Lassen Sie uns konkret definieren, was diese sind.

[17:38] They give LLMs autonomy because they give an LLM the power to carry out actions like querying a database or messaging other LLMs or running the robotic arm in a biological wet lab.
  Sie verleihen LLMs Autonomie, da sie einem LLM die Fähigkeit geben, Aktionen auszuführen, wie das Abfragen einer Datenbank, das Senden von Nachrichten an andere LLMs oder das Steuern eines Roboterarms in einem biologischen Nasslabor.

[17:52] And this might sound spooky.
  Und das mag unheimlich klingen.

[17:55] So it might sound like, oh, what if I arm the OpenAI agents SDK with a tool that is accessing the database on my computer?
  Es könnte also klingen wie: Oh, was ist, wenn ich das OpenAI Agents SDK mit einem Werkzeug ausstatte, das auf die Datenbank auf meinem Computer zugreift?

[18:03] OpenAI can reach right into my computer.
  OpenAI kann direkt auf meinen Computer zugreifen.

[18:05] That might sound kind of scary, but as Ed has worded it, the reality is more mundane than that.
  Das mag etwas beängstigend klingen, aber wie Ed es formuliert hat, ist die Realität banaler als das.

[18:15] So, the popular perception of tool calling is that an LLM can reach into your computer, access your file system if it needs to.
  Die allgemeine Vorstellung von Tool-Calling ist also, dass ein LLM auf Ihren Computer zugreifen und bei Bedarf auf Ihr Dateisystem zugreifen kann.

[18:21] And so, it would be.
  Und so wäre es.

[18:23] Something like this.
  Etwas wie das.

[18:25] This isn't what happens.
  Das ist nicht das, was passiert.

[18:25] Don't memorize this diagram.
  Prägen Sie sich dieses Diagramm nicht ein.

[18:26] This is the misconception diagram where you have some code um that provides a prompt to an LLM.
  Dies ist das Diagramm für das Missverständnis, bei dem Sie einen Code haben, der eine Eingabeaufforderung an ein LLM liefert.

[18:35] So the code over here provides a prompt to the LLM and this is the misconception is that the LLM then executes uh the tool use say in your file system on your computer.
  Der Code hier liefert also eine Eingabeaufforderung an das LLM, und das Missverständnis besteht darin, dass das LLM dann die Werkzeugnutzung ausführt, sagen wir in Ihrem Dateisystem auf Ihrem Computer.

[18:46] It gets a response and then provides that response back to the code.
  Es erhält eine Antwort und gibt diese Antwort dann an den Code zurück.

[18:48] In fact what happens the mundane reality is that an LLM responds with the actions needed.
  Tatsächlich ist die banale Realität, dass ein LLM mit den erforderlichen Aktionen antwortet.

[18:57] So the code or you send a prompt to the LLM.
  Also sendet der Code oder Sie eine Eingabeaufforderung an das LLM.

[19:00] The LLM provides a response back to your code and then that executes the tool and so it is much more constrained.
  Das LLM liefert eine Antwort an Ihren Code zurück, und dieser führt dann das Werkzeug aus, daher ist es viel stärker eingeschränkt.

[19:11] Here is an example that Ed came up with that I love.
  Hier ist ein Beispiel, das Ed sich ausgedacht hat und das ich liebe.

[19:13] So this is you can right here.
  Das hier können Sie direkt hier sehen.

[19:16] This is the entire chat with the chat GBT.
  Dies ist der gesamte Chat mit dem Chat-GPT.

[19:17] There's no other instructions in the background.
  Es gibt keine weiteren Anweisungen im Hintergrund.

[19:19] You can just write a chat right now where you say you are a.
  Sie können jetzt einfach einen Chat schreiben, in dem Sie sagen, dass Sie ein ... sind.

[19:24] Support agent for an airline.
  Support-Mitarbeiter für eine Fluggesellschaft.

[19:27] You answer user questions.
  Sie beantworten Benutzerfragen.

[19:29] You also have an ability to query for ticket prices.
  Sie haben auch die Möglichkeit, Ticketpreise abzufragen.

[19:31] That's a tool.
  Das ist ein Werkzeug.

[19:33] You're arming it with a tool.
  Sie statten es mit einem Werkzeug aus.

[19:33] Just respond only.
  Antworten Sie nur.

[19:33] Use tool to fetch ticket price for London to retrieve the ticket price for London or for whatever city the user names.
  Verwenden Sie das Werkzeug, um den Ticketpreis für London abzurufen, oder für jede beliebige Stadt, die der Benutzer nennt.

[19:40] Here is the user question.
  Hier ist die Benutzerfrage.

[19:43] User, I'd like to go to Paris.
  Benutzer: Ich möchte nach Paris reisen.

[19:46] How much is a flight?
  Wie viel kostet ein Flug?

[19:51] So that you are arming this simple agent uh with a tool here with your explanation.
  Sie statten also diesen einfachen Agenten mit Ihrer Erklärung hier mit einem Werkzeug aus.

[19:55] And so it replies back use tool to fetch ticket price for Paris.
  Und so antwortet er: Verwenden Sie das Werkzeug, um den Ticketpreis für Paris abzurufen.

[20:00] So that is like here in this diagram.
  Das ist also wie hier in diesem Diagramm.

[20:03] So that would be the response back to the code and then the code uses the tool some kind of ticket price checking API in order to get that price for you.
  Das wäre also die Antwort an den Code, und dann verwendet der Code das Werkzeug, eine Art API zur Überprüfung von Ticketpreisen, um diesen Preis für Sie zu erhalten.

[20:11] Now um despite these kinds of constraints there are risks to agent systems even the workflows which are relatively simple but then especially when we get into agents proper there are risks.
  Nun, trotz dieser Art von Einschränkungen gibt es Risiken bei Agentensystemen, selbst bei Workflows, die relativ einfach sind, aber besonders wenn wir zu eigentlichen Agenten übergehen, gibt es Risiken.

[20:23] Agents can be.
  Agenten können sein.

[20:27] unpredictable. So they can head on an

[20:29] unpredictable path.

[20:32] They can have unpredictable outputs and

[20:34] they can have unpredictable costs. But

[20:37] thankfully

[20:39] well planned monitoring and guard rails

[20:41] effectively mitigate against this risk.

[20:44] So you can monitor your agent agentic

[20:46] systems in real time. You can even have

[20:48] agents monitoring your agents to be

[20:51] making sure that they're not misbehaving

[20:52] in some way or that users aren't

[20:54] misbehaving in some way. And then on top

[20:56] of that, you can have guardrails that

[20:57] ensure your agents behave safely,

[21:00] consistently, and within your intended

[21:02] boundaries. So, Agentic AI frameworks in

[21:06] particular, I'm going to uh cover some

[21:09] now, and Ed will obviously get into them

[21:10] in detail. They help us offset risks,

[21:14] including by setting up guard rails and

[21:16] by having structured outputs. So, new

[21:18] frameworks are coming up all the time,

[21:21] but on this slide, I'll cover the most

[21:23] important ones today. These first two

[21:26] they're this they are the simplest of

[21:28] the frameworks that I'll be discussing

[21:29] today. So having no framework obviously

[21:31] that's the simplest there's no

[21:33] abstractions you connect to LLMs

[21:35] directly via APIs and the benefit of

[21:38] this is that you see exactly what's

[21:40] going on under the hood you control

[21:42] every aspect of prompting or using the

[21:45] agents. The other um very simple uh kind

[21:50] of framework which actually isn't a

[21:51] framework at all. So MCP model context

[21:54] protocol from Anthropic. This isn't a

[21:56] framework, it's a protocol. And so it's

[21:59] extremely popular today, released in

[22:01] late 2024, but exploded in terms of

[22:04] GitHub stars in the past couple of

[22:06] months. It's open- source and it's a

[22:08] standard protocol for connecting agents

[22:10] with data sources and with tools. So it

[22:13] eliminates the need for glue co for glue

[22:16] code. you can simply conform to the MCP

[22:19] protocol and the common analogy is that

[22:22] it's like a USBC USBC

[22:26] uh for connecting you know you know that

[22:28] you use for connecting any kind of

[22:29] hardware you just have this one specific

[22:31] format MCP is the same idea for agentic

[22:35] workflows and agentic systems and in

[22:38] module three this afternoon Ed will show

[22:41] you in the final project how to

[22:42] conveniently link lots of components

[22:44] together using MCP

[22:46] The next layer of complexity in terms of

[22:48] frameworks, these are actually

[22:50] frameworks. That makes it that's a good

[22:53] uh uh bonus here. And so the OpenAI

[22:55] agents SDK,

[22:57] this is Ed's favorite. You'll be

[23:00] starting out with it in the project

[23:01] that's coming up in just a few slides.

[23:03] Um in fact, I think it might be the in

[23:06] the very next slides you'll be getting

[23:07] into uh doing this demo. Um, so, uh,

[23:10] after this slide, I'll be passing over

[23:12] to Ed, and he'll show you hands-on how

[23:14] you can use this to recreate OpenAI's

[23:17] deep research. The OpenAI agents SDK is

[23:20] lightweight, it's simple, it's clean,

[23:23] it's flexible, and it's new. It actually

[23:26] came out after we created the syllabus

[23:28] for this course today. Um, and so, yeah,

[23:31] brand new, but very popular, very

[23:33] useful. Crew AI is also a favorite of

[23:35] Eds as well as mine. I'm friends with

[23:37] Rob Bailey, Tony, and Jiao uh who are uh

[23:41] in the leadership or the co-founders in

[23:44] the case of Rob and Jiao uh for Crew AI.

[23:47] They're burgeoning partner of my

[23:49] consultancy Y carrots and this this uh

[23:52] framework has been along has been around

[23:54] longer than the agents SDK and it's a

[23:57] bit heavier weight than the SDK. uh and

[24:01] it's designed as the name suggests it's

[24:03] a framework especially designed for

[24:04] multi- aent systems a crew of agents is

[24:08] where the name comes from and uh it

[24:11] allows a lot to be handled through

[24:12] configurations so YAML files as opposed

[24:15] to code um and it will be used today

[24:18] again in module 2 to create a crew of

[24:22] complimentary software engineers that

[24:24] can handle a software engineering

[24:26] project for you in module three you'll

[24:28] use that team of engineers

[24:30] that crew of engineers to create um a

[24:34] trading uh platform or to to execute

[24:37] trades to to come up with trading

[24:38] guidance that again Ed and I are not uh

[24:41] financially responsible for legally

[24:42] responsible for for you. Finally, the

[24:44] top layer of complexity um we have

[24:47] Langraph and so this is from the same

[24:49] people that make Lang Chain in the top

[24:50] left and then Microsoft Autogen and so

[24:54] both of these have a steeper learning

[24:55] curve but can be powerful. um it feels

[24:58] less like you're interacting directly

[25:00] with LLMs than with uh than than if you

[25:03] use any of these other frameworks or not

[25:05] frameworks. Um and we won't have time to

[25:09] cover Langraph or Autogen in detail

[25:12] today, but Ed does cover them in his

[25:14] 17-hour complete AI agents course in

[25:17] Udemy. So you can you can check that

[25:19] out. But we we only have four hours

[25:21] today. So we couldn't we had to pick

[25:23] what we thought were the most valuable

[25:25] uh and most interesting most uh timely

[25:28] frameworks for you to be working with.

[25:29] So yeah, OpenAI agents SDK, Crew AI, MCP

[25:33] we will be digging into today. And in

[25:35] fact with no further ado, Ed, come on up

[25:39] and get us going on the agents SDK.

[25:48] Well, hello everybody.

[25:50] So, I want to start what I have to say

[25:53] by giving you all a piece of life

[25:56] advice, a tip for your life. And that is

[26:00] you always want to avoid situation in

[26:03] life when you are up presenting in a

[26:07] room full of people like this and you

[26:09] are following this guy.

[26:13] This this is a tough act to follow.

[26:16] John, that's amazing. That's a fabulous

[26:18] introduction. Thank you so much. I as I

[26:20] say, horrible act to follow. Uh and if

[26:23] you're not already subscribed to Super

[26:24] Data Science, then then honestly, you

[26:26] need to subscribe now. You need to watch

[26:28] all of the How many episodes is it now?

[26:30] Coming up to 900 almost 900 episodes

[26:34] that will keep you busy for your journey

[26:36] back. But hello everybody and let me get

[26:40] started. But I'm going to do a little uh

[26:41] introduction first as well. Myself, my

[26:43] name is Ed. Uh I am, as John said, the

[26:46] co-founder CTO of an AI startup called

[26:49] Nebula, which I can tell you all about

[26:51] if you're interested later. Uh and I

[26:53] spent most of my career at JP Morgan. Uh

[26:57] anyone here from JP Morgan? Oh, lovely.

[27:00] Oh, yes. Wonderful. I see. Is that

[27:03] Mimmude? Yes, it is. is that at the back

[27:06] is one of uh sorry is is a great former

[27:09] friend and colleague from JP Morgan.

[27:11] Wonderful. Uh so current friend former

[27:15] colleague. Thank you John.

[27:20] Uh and uh wonderful. And uh yeah so I

[27:24] started out in uh in London and then I

[27:27] moved to uh Tokyo and then ended up in

[27:30] New York. And before Nebula, I founded a

[27:33] company called Untapped, which was

[27:35] another AI startup. And Untapped was

[27:37] actually acquired a few years ago. And

[27:40] this is a picture of the announcement in

[27:43] Time Square a few years ago of our

[27:45] acquisition, which was a super magical

[27:47] moment for me. And I show you this

[27:49] because ju just to prove it, I want

[27:51] everyone to squint. And if you look

[27:52] really closely, you can see me. And my

[27:54] picture is right there. So take a look

[27:57] at that. And I also show this to you

[27:58] because not just me, but John is there

[28:01] too. That is John right next to me cuz

[28:03] John was part of this startup untapped

[28:05] as well. So we are both here on this

[28:08] picture. And yeah, you can bring up the

[28:10] slide on your computer and zoom it in if

[28:12] you don't trust me. Uh and uh this is

[28:16] another place where I am. I'm on

[28:17] LinkedIn and some people are quite koi

[28:20] about connecting on LinkedIn and they

[28:22] say, you know, connect with me. I'll

[28:24] connect back if I recognize you. I am

[28:26] not koi. I I welcome all LinkedIn

[28:29] connections. I love building a data

[28:31] science community. So you should feel

[28:33] free to connect with me and if you send

[28:35] a message I will reply. People are

[28:37] suspicious that I've written an AI agent

[28:39] that writes the replies for me. And I

[28:42] assure you I have not. If I reply it is

[28:44] me. I will confess that that I have

[28:46] mapped some keys. So some some of it

[28:48] might be copy and pasted. At least 50%

[28:51] of the content will be really from me.

[28:53] So please do reach out. do connect with

[28:56] me and I will get back to you. And I

[28:58] also include there's like obligatory

[29:00] personal life picture. This is me

[29:03] showing me in front of a plane that I

[29:05] had just flown. You might be thinking

[29:07] this is me saying I'm really good at

[29:08] flying planes. Uh but quite the

[29:11] opposite. I want to tell you that my

[29:13] great skills when it comes to LLMs and

[29:16] agents are only surpassed by my complete

[29:20] inability to do anything that requires

[29:23] hand eye coordination.

[29:25] So, so if at the end of this you find

[29:27] yourself on the on the flight back and

[29:29] you look in the cockpit and you see that

[29:31] it's me there with the with the stick,

[29:34] you want to be looking for a parachute.

[29:36] But but if you find yourself in a

[29:40] conference and I'm talking about agents

[29:42] and LLMs, then that is my wheelhouse.

[29:45] You're in the right place. All right,

[29:47] that is my intro. It's finally time for

[29:51] us to get to the detail and talk about

[29:54] OpenAI agents SDK, the first of the

[29:57] frameworks we're going to look at. And

[29:58] the great thing about it is that it's

[30:00] really lightweight. It's simple. It's it

[30:04] stays out of the way. It's not

[30:06] opinionated. It lets you do things the

[30:08] way you want to and it doesn't require

[30:10] you to to go through a big learning

[30:11] curve to get there. And yet at the same

[30:14] time, it makes difficult things really

[30:16] easy, which is exactly what you want. So

[30:19] for anyone that's used like OpenAI's

[30:21] chat completions API to to use tools,

[30:24] you've had to write like a lot of JSON

[30:26] gump that you have to put together to

[30:28] tell OpenAI how to reach back and call

[30:31] the tool as John described it. All of

[30:33] that is just taken care of for you by

[30:35] OpenAI agents SDK and it tells you what

[30:37] it's doing so you can see it. Nothing is

[30:40] hidden from you. Uh but it makes it all

[30:42] super simple. And as John said, OpenAI

[30:44] agents SDK is definitely my favorite.

[30:47] Love it. As you will see, Crew is coming

[30:50] right up behind it. Crew is second

[30:51] favorite, but this one is just the best.

[30:54] I love the fact that it has minimal

[30:56] terminology. So you have agents. That's

[31:00] one of its words, an agent. that is

[31:02] something that represents a autonomous

[31:04] interaction with an LLM. You have

[31:08] handoffs. That is the term for one agent

[31:11] passing control to another agent. And

[31:14] then you have things called guard rails.

[31:16] Super important. As John had mentioned,

[31:18] this is one of the critical controls you

[31:20] need to put in place to be able to

[31:22] deploy agentic systems to production.

[31:25] And guardrails are built into OpenAI

[31:27] agents SDK. If you want to build an

[31:30] agent system in open agents SDK, there

[31:33] are three steps you have to follow. And

[31:34] we're going to do these three steps in a

[31:36] second. So keep them in mind. First of

[31:38] all, you create an instance of an object

[31:40] called agent, which is going to be your

[31:42] agent. Secondly, you use a context

[31:45] manager called trace to describe what

[31:48] you're about to do so that you'll be

[31:49] able to look at it in monitoring tools

[31:51] and see everything that's gone on. And

[31:53] then thirdly, you call runner.run. That

[31:57] is how you kick off your agent workflow.

[32:01] And so with that, it is time for us to

[32:03] do some coding. We're going to do some

[32:05] coding of a of a uh building a deep

[32:07] research project just as John described,

[32:10] which is such an important such a

[32:12] foundational use case of Agentic AI. Uh

[32:15] but I have to give you uh just just a

[32:17] little bit of prep for this. So, first

[32:19] of all, I have some good news, which is

[32:20] why I'm showing you this picture of of

[32:22] like a cake here, which is that John and

[32:24] I have some real treats in store for

[32:27] you. The three projects that we've lined

[32:29] up are delicious. We've baked something

[32:31] great, and I can't wait to show them uh

[32:34] to you. But there is some bad news. You

[32:37] know those those those cooking shows

[32:38] where they put a bunch of ingredients on

[32:40] a baking tray and they sort of made them

[32:43] all together and then they put them all

[32:44] in the oven and then they say and here's

[32:47] one that I put in the oven earlier and

[32:49] they bring it out and he say hang on a

[32:51] second that looks completely different.

[32:53] Uh so I am going to be doing a bit of

[32:54] that. I have to warn you. Uh it's

[32:57] because this is a 4-hour session and

[32:58] we're not going to be able to go through

[32:59] everything and do all of the the coding

[33:01] in in gory detail. And you'll have to

[33:03] trust me uh that that that I've been

[33:05] I've been honest. I really have run this

[33:07] myself. But you don't have to trust me

[33:10] because we put this all in GitHub and we

[33:14] would like to ask you to go through and

[33:16] do this yourself, but do it afterwards.

[33:19] You could bring it up here and watch

[33:21] while I'm doing it, but I don't think

[33:22] it's realistic to say try and execute it

[33:24] while I do because some people might

[33:26] have problems and there's going to be

[33:28] too it's going to be too hard. So, I'd

[33:30] say follow what I'm doing. I'm going to

[33:32] give you intuition for why I'm doing

[33:34] what I'm doing and and what's going on

[33:36] and then later come back and do it

[33:37] yourself, but please do it yourself and

[33:40] then contact me or contact John if you

[33:42] get stuck. We are here to help you. We

[33:44] come with a package. That's what you get

[33:45] for coming and putting uh four or six

[33:47] hours of your time today into this is

[33:49] that we are around to help you out. So,

[33:52] so connect with me or or or send me a

[33:54] message on LinkedIn or wherever and I

[33:56] will help you right away because it's so

[33:58] cool to imagine everyone being able to

[34:00] take advantage of this and running it

[34:02] yourself. And as I say, we're going to

[34:03] be moving pretty fast through this. So

[34:06] don't don't worry if you don't pick

[34:07] everything up because you'll be able to

[34:08] later. And the final little caveat I'll

[34:10] give you is again to tie to something

[34:12] that that John had explained, which is

[34:15] that agentic systems are by their very

[34:18] nature somewhat unpredictable. And so

[34:21] out of all of the demos that I ever

[34:23] give, this is some of the hairiest

[34:25] because I never quite know what's going

[34:27] to happen. So you have to bear with me.

[34:29] If if things go crazy, if the agents

[34:30] don't behave, if our engineering team

[34:32] decides to go and build something

[34:33] completely different, we'll have to

[34:35] figure it out together. Maybe maybe

[34:36] they'll build a bridge. uh uh we'll

[34:40] we'll we'll be there together. So So be

[34:42] prepared for that. All right. And with

[34:45] that, we're going to get in and we're

[34:47] going to bring up some code. And this

[34:50] here, if if you went to our GitHub and

[34:53] you cloned our GitHub, this is what

[34:55] you'll be faced with. So uh before

[34:59] anything, I want to do a quick visual

[35:02] check. So, this is going to be a bit

[35:04] challenging, but can I ask can I can I

[35:06] have someone in the back row here? You

[35:09] are in the worst possible place. How can

[35:12] you see is this is this legible? It's a

[35:14] that's a yes.

[35:16] Okay. Okay. Excellent. All right. Thank

[35:18] you. If it ever stops being legible,

[35:20] then please shout and I'll make it

[35:22] bigger. So, so when when you've uh

[35:23] cloned the repo, this is what you'll

[35:25] get. You'll see a readme, which is where

[35:28] we have a few details about this. Uh,

[35:30] and uh, yes, there is a link to my Udemy

[35:33] course. If if you uh, this if if you

[35:35] decide you want 17 more hours of this,

[35:37] then then that's where you'll find it.

[35:39] And then there are setup instructions

[35:41] for Windows, for Mac, and for Linux. And

[35:43] they're super clear. Now, I've done this

[35:46] in cursor. So, we're using uh, an HTKI

[35:49] platform for coding, but you can also

[35:51] use VS Code or whatever you're

[35:52] comfortable with, of course. Um, but we

[35:54] will be using Cursor for this today. And

[35:57] it's wonderful how often it fills in

[35:59] exactly the code I'm about to do.

[36:01] There's also a set of guides. There's a

[36:02] troubleshooting guide, too. So, there's

[36:04] lots of stuff. But once you've got all

[36:06] of this set up, there's three folders,

[36:08] deep research, engineering team, and

[36:09] trading floor. Come into deep research

[36:12] and then select the first lab, lab one.

[36:15] And that is where we will begin with the

[36:17] OpenAI agents SDK. And we're going to

[36:20] start with uh an agent equivalent of a

[36:23] hello world example uh which is asking

[36:26] an agent to tell us a joke. Something

[36:29] which LLMs are perhaps not wonderfully

[36:32] skilled at yet. I don't think it's part

[36:33] of humanity's last exam, but we will

[36:35] see. All right. So, you remember that

[36:37] there are three steps to opening our

[36:40] agents SDK. We're going to do them right

[36:42] now. I'm going to start uh by running

[36:44] some imports. I'm also going to load in

[36:46] my secrets, my environment variables. If

[36:49] you're not familiar with loadm, it's

[36:51] explained in the readme. All right. And

[36:54] now this line here, I'm going to hide

[36:57] the files there. So hopefully everyone

[36:59] can see this. This this is the first

[37:02] step, the key step. We are creating an

[37:04] instance of agent. It's being called

[37:07] jokester. We give it a name. We give it

[37:09] something called instructions. And

[37:11] instructions is basically the system

[37:13] prompt that will always be used for this

[37:15] agent. So instructions is their name for

[37:18] a system prompt and we're saying you are

[37:19] a joke teller and we give it the model

[37:22] that it should use under the covers.

[37:24] This is uh the uh GPT 4.1 mini that

[37:27] we're going to use today. One of the the

[37:29] latest models from OpenAI. And in the

[37:32] setup instructions there are guides for

[37:33] how you can switch this out for DeepS or

[37:35] Gemini or Grock or whichever models you

[37:38] most prefer working with. So we run

[37:40] that. So we've just created an instance

[37:42] of agent. That was pretty easy. So now

[37:45] we have the other two steps. So we're

[37:48] going to set up a trace telling a joke

[37:50] so that we can monitor this. And now we

[37:53] call runner.run.

[37:55] We pass in the name of the agent and we

[37:58] pass in sorry a reference to the agent

[37:59] and we pass in what is effectively our

[38:01] user prompt. Tell a joke about

[38:04] autonomous AI agents. And then we will

[38:07] print the result. And that is all it

[38:09] takes to get an agent running. So let's

[38:11] see what it says. Why did the autonomous

[38:12] AI agent bring a ladder to work? Because

[38:14] it wanted to reach new levels of

[38:17] self-improvement.

[38:19] Okay,

[38:21] I guess uh yes, we're not not yet ready

[38:24] for uh uh artificial super intelligence

[38:26] just yet. We have some ways humans are

[38:28] still uh still at the forefront here. Um

[38:31] but that is how easy it is to make your

[38:34] first request to an agent. And now I've

[38:36] got a link to bringing this up in the

[38:39] tools that OpenAI provides so that we

[38:41] can look at a trace of what happened

[38:43] there. So here we go. There's a line for

[38:46] telling a joke. You can see I I told one

[38:48] or two jokes before this. And uh we now

[38:52] click here. There's just one row here.

[38:54] And you'll see over here it's showing us

[38:56] on the right. Um that's probably hard to

[38:58] see, but let me zoom in a bit. There we

[39:00] go. Uh you can see that it shows the

[39:03] system prompt, it shows the user prompt

[39:05] and no surprise, this was a very trivial

[39:08] example. It was one call to an LLM. You

[39:10] see the system prompt and the user

[39:12] prompt and you get to see it in traces.

[39:14] But never fear, we will have some more

[39:16] sophisticated traces coming very soon.

[39:19] All right. So let's go back here again.

[39:23] That was uh a simple example. We are now

[39:26] going to go and build ourselves a deep

[39:28] research. So I want to start by just

[39:31] saying again this is such a huge

[39:33] example. This is so important.

[39:35] John showed you what happened to

[39:37] humanity's last exam when we started to

[39:39] incorporate deep research. So so this is

[39:42] a a huge deal. Uh and uh it can be

[39:45] applied to any business area and you can

[39:47] find ways to take this and apply it to

[39:49] your business area. So you should be

[39:51] thinking about how could you make a

[39:53] specialist deep research agent that

[39:55] could do deep research particularly in

[39:56] your field. Uh so going to do a bunch of

[39:59] imports and now I have something to

[40:02] explain. So the OpenAI agents SDK comes

[40:05] out of the box with three special tools

[40:09] that are called hosted tools which means

[40:12] they are provided by OpenAI that you can

[40:14] you can just use them out of the box for

[40:16] a price. So the first of them is called

[40:19] the web search tool and that is a tool

[40:22] which allows you to ask OpenAI to run a

[40:24] web search on your behalf. The second of

[40:26] them is called a file search tool and

[40:29] that allows you to upload a bunch of

[40:31] files to open AAI which it will store in

[40:33] a vector data store and it can look that

[40:35] up effectively running rag for you on

[40:37] OpenAI's servers. And the third one is

[40:40] called computer tool which allows uh

[40:42] OpenAI to automate a running a computer

[40:45] screen taking screenshots clicking in

[40:47] places. Now for now we're just going to

[40:49] use the first one the web search tool.

[40:52] So keep that in mind. So, we're going to

[40:54] be making four different agents, but

[40:56] following exactly the same process as

[40:58] our as our jokester a minute ago. Four

[41:00] agents. And I I need you to pay

[41:02] attention to these four because when we

[41:04] go through them, you'll need to remember

[41:05] how they fit together. So, the first

[41:06] agent, the simplest one, the search

[41:08] agent. This is an agent which can take a

[41:10] query and it will then look that it will

[41:13] use the the OpenAI search tool to search

[41:17] for that uh on on the internet. So, it's

[41:19] a a search agent is able to run a search

[41:21] query on the internet. The second agent,

[41:25] the planner agent, that's able to take a

[41:28] question from a user, a general

[41:30] question. We're going to ask it to

[41:32] recommend Agentic AI frameworks. Take a

[41:34] question like that, and it's going to

[41:36] say, okay, can I come up with a bunch of

[41:39] things that I could search for on the

[41:41] internet that would help me answer that

[41:43] question? So, it's taking a question,

[41:45] and it's turning it into a bunch of

[41:47] search items. That's our planner agent.

[41:49] The third one, the report agent, is

[41:52] going to take tons of information that's

[41:54] been taken from lots of searches and

[41:56] turn that into a summary report on the

[41:59] results to answer the original question.

[42:01] And then the fourth one is a fun extra

[42:03] one. The push agent is one that will be

[42:06] able to send a push notification to a

[42:08] mobile phone because that's just fun.

[42:09] So, we're going to do that, too. All

[42:11] right. So, with that, our first agent

[42:14] then, our search agent. So, here it is.

[42:16] So, it's exactly the same as before, but

[42:18] now there's some more detail. We've got

[42:21] a a beefier system prompt. You are a

[42:24] research assistant. Given a search term,

[42:26] you search the web for it. And then some

[42:29] more here. So, then we create the search

[42:31] agent. We instantiate an instance of

[42:33] agent. We give it a name. We pass in

[42:35] these instructions. And we have a new

[42:37] thing here. We're passing in some tools.

[42:40] And we are specifying a special tool.

[42:42] This is OpenAI's tool, the web search.

[42:45] We're giving it a model as before. And

[42:47] this little setting here is telling it,

[42:49] we need you to use this tool. It's not

[42:51] optional. You've got to call it at least

[42:53] once. So, we run that. Let's give this a

[42:56] try. Let's let's just call runner.r run

[42:58] again. We're going to say what are the

[43:00] most popular and successful AI agent

[43:02] frameworks in May 2025 and check that it

[43:05] can search for that on the internet and

[43:06] come back with a result. So, this is now

[43:08] going off. It's effectively running a

[43:10] Google search on OpenAI's boxes. And

[43:13] this is the response it comes back with.

[43:15] It's saying that Langchain, Langraph,

[43:17] and Crew AI are the three that came back

[43:20] from that search. And we could go in and

[43:23] look at that trace. We'll do it very

[43:24] quickly. You'll see that it's done

[43:25] exactly what we expect. Here it is. It's

[43:28] in the OpenAI dashboard. You can see if

[43:31] you click on it that it used the tool uh

[43:34] the web search tool right here. So, it's

[43:37] time for the second agent. This is this

[43:39] is where it gets real. This is the one

[43:40] that that takes us from a normal LLM

[43:43] world to an agent world. We want it

[43:45] we're going to tell it that we want it

[43:47] to do five different searches. The

[43:49] instructions, you're a helpful research

[43:51] assistant. Given a query from the user,

[43:54] come up with a set of web searches to

[43:56] answer the query. And we tell it how

[43:58] many. Now, what we're going to do now is

[44:01] use a feature called structured outputs.

[44:04] Let me just check how many people here

[44:06] are familiar with Pyantic.

[44:09] Great. Great. Most most people if you're

[44:11] not familiar with Pyantic, there is a

[44:12] guide in the guides folder that will

[44:14] tell you about Pyantic. But Pyantic is

[44:16] basically a way that you can write

[44:18] Python objects which describe a schema

[44:21] of of of how you want information to be

[44:23] represented. And we use Pyantic to

[44:25] create some Python classes here. So web

[44:29] search item is a subclass of base model

[44:32] and it's got two fields and these are

[44:34] fields that we're going to want OpenAI

[44:36] to respond with. One of them is query.

[44:39] This is an actual search query that we

[44:40] want it to tell us about. But before

[44:42] that we've got another thing reason your

[44:45] reasoning for why this search is

[44:48] important to the query. And here's the

[44:50] thing we're not actually going to use

[44:52] this. This isn't actually anything that

[44:54] we need to know. The reason we put this

[44:57] in here is that we want to force the

[44:59] model to start to tell us its thinking.

[45:02] And we want it to do that before it

[45:04] gives us the query. And that is like a a

[45:07] trick, a simple trick to turn a normal

[45:10] chat model into operating in a reasoning

[45:13] mode where it has to think through what

[45:15] it's doing before it tells you the

[45:17] outcome. So, it's this this cool trick

[45:19] that that when you're writing structured

[45:20] outputs, when you're when you're

[45:21] describing how you want it to respond,

[45:23] you should always force it to tell tell

[45:25] you its reasoning before it gives you

[45:27] the answer, and you'll just get better

[45:29] outcomes. It's it's still it's just

[45:31] about generating the the most likely

[45:34] next tokens, but if it's told you its

[45:36] reasoning, it biases the model to be

[45:39] more likely to output tokens consistent

[45:41] with its reasoning, and so you get

[45:44] better outcomes. It's it's it's crazy.

[45:46] So that is the web search item with its

[45:48] reason. And then we have something

[45:50] called web search plan which is simply a

[45:52] list of web search items. And here we

[45:54] have our planner agent. So we give it

[45:57] its instructions. And here we have one

[45:59] new thing for you to look at here.

[46:00] Output type. We're telling our agent we

[46:03] need you to output using a particular

[46:06] type of object using this object here.

[46:09] This pyantic object that describes your

[46:12] output. So we run that. And now we're

[46:15] going to try this out. We're going to

[46:16] say, "What are the most popular and

[46:18] successful AI agent frameworks?" And

[46:20] what we're hoping for here is that it's

[46:22] going to come back with some things that

[46:24] it would like to search for. Here they

[46:25] are. The web search plan. It would like

[46:28] to search for things, but before it

[46:29] tells us that, it's telling us its

[46:31] reason. And here you can see its reason.

[46:34] And then here is the query that it would

[46:35] search for. And because it's told us its

[46:38] reason, the search is going to be that

[46:39] little bit better. All right, everyone

[46:42] following me so far? some nods.

[46:45] Great, great, great. And and a thumbs

[46:47] up. Oh, yes. Yeah. The question was,

[46:50] what do the other search terms look

[46:51] like? What are the other reasons? Let's

[46:52] keep going. Uh so, um let's do some

[46:56] code. Look for

[46:59] results in

[47:02] final output dot. Hang on. We're just

[47:06] going to make sure we get this right.

[47:08] Searches

[47:13] So for search,

[47:22] we're going to print out the rationale.

[47:26] Let's get this right. We print the

[47:29] reason and the query.

[47:35] We're hoping for five. We're hoping some

[47:37] good. Here we go. So we did indeed get

[47:39] five. uh to find the most popular AI

[47:42] agent frameworks as of May 2025 was the

[47:44] reason and there is simply the search

[47:47] and you can see all of its uh reasons

[47:49] and searches there and sure enough that

[47:51] does appear to be five. It has obeyed

[47:53] its instructions. Great question. Thank

[47:55] you. All right, so now on to the third

[47:59] agent which is the writer agent. This is

[48:02] a pretty simple one. You're a senior

[48:04] researcher tasked with writing a

[48:06] cohesive report and we ask for a summary

[48:09] and again we use structured outputs. We

[48:12] create a subclass of base model. We ask

[48:14] for a short summary and then a full

[48:16] markdown report and follow-up questions.

[48:18] And then we simply have an agent which

[48:21] takes those instructions. This time

[48:23] we'll use GPT4 mini and we'll output

[48:26] into that type. And then our final agent

[48:29] is going to be a tool that we will build

[48:31] right now. It's called the push uh agent

[48:34] and it's going to make a little push

[48:36] notification to my phone. So, I'm going

[48:38] to turn my phone off mute and hope no

[48:40] one calls me. Uh there we go. Volume up.

[48:45] Okay. So, uh we are going to I'm first

[48:50] going to show you this little nice

[48:52] function here called push. And push is a

[48:55] function which uses a a platform called

[48:58] pushover which is very simple and free

[49:00] and easy to set up which can send push

[49:02] notifications to your phone. And I'm

[49:03] going to say push hello ad.

[49:12] Here we go. It came through but it

[49:14] didn't make a noise. It says hello Ed.

[49:16] Uh let me try and see if I can if I do

[49:18] it a second time if it will make a noise

[49:19] so you can believe me.

[49:22] There we go.

[49:24] Very nice. So, we will have that noise

[49:27] coming a few times. It's a uh just check

[49:30] one more time.

[49:33] So satisfying. Okay. Lovely. All right.

[49:36] Now, this is a function called push. It

[49:39] could be any function. It could be a

[49:40] function that writes to your database.

[49:42] It could be a function that writes to a

[49:43] flat file. And we are simply going to

[49:46] add a decorator at function tool like

[49:49] that.

[49:51] And now I'm going to run this again. And

[49:53] now push is no longer a function, but

[49:56] because of that decorator, push has been

[49:59] turned into something called a function

[50:00] tool. And if you look at this, you'll

[50:03] see that in here is a ton of JSON. And

[50:07] for people that have worked with tools

[50:08] before and you've had to write all of

[50:10] this JSON and it's a real pain. Uh, this

[50:12] is so simple. I love the fact that you

[50:14] can just turn any function into a tool

[50:16] this way through the OpenAI agents SDK,

[50:18] but it still shows you what it's doing.

[50:20] It's not like this is hidden from you.

[50:22] You can always get access to the JSON

[50:23] itself as well. But that is how you make

[50:26] a tool with open air agents SDK. And

[50:28] this is where you pass it in. We just

[50:30] say tools tool like is push like that.

[50:34] And now we are equipping this agent with

[50:37] the ability to send a push notification

[50:39] to my phone and make that cute noise.

[50:42] All right, we've basically done the

[50:43] work. Now we just have to thread this

[50:45] together and figure out which order to

[50:47] call the different agents. So these

[50:49] three functions here simply they're

[50:51] calling runner.run. We're going to have

[50:53] something that is able to plan out the

[50:55] searches given a user's query. It will

[50:57] run our planner agent. This one is then

[51:00] these these two here are going to end up

[51:02] calling the search agent for each of the

[51:05] search queries. And I'll let you look at

[51:07] this, but it is as I say just

[51:09] boilerplate code that calls runner.run

[51:11] run. And I've also got one that calls

[51:14] the writer agent to write the report.

[51:17] And here is the one that calls the push

[51:19] notification. And it's going to make my

[51:21] phone make a noise. All right. And that

[51:24] is it. It's time for showtime. We're

[51:27] going to ask this question. What are the

[51:28] most popular and successful AI agent

[51:31] frameworks in May 2025? And we're going

[51:33] to put this in a trace. And we're going

[51:35] to run that code that's now going to

[51:37] call each of those agents in turn. And

[51:39] it's telling us what's going on. Now it

[51:40] started the research. It's planning the

[51:42] searches. It's going to perform five

[51:44] searches. And now it's connected to

[51:47] OpenAI. It's done the searching. And

[51:49] it's now thinking about writing a

[51:51] report. A report to describe

[51:55] the most important or the the uh the

[51:57] latest most popular and successful AI

[52:00] agent frameworks in May 2025 and writing

[52:04] the report because it's got to output

[52:06] all of those tokens. This is the longest

[52:08] part of the process and the steps we're

[52:10] seeing here is basically what OpenAI's

[52:13] deep research is doing when it's running

[52:16] and when it's if you've used it before

[52:18] when it's building that

[52:21] you hear that

[52:23] and here is the results popular AI agent

[52:26] frameworks in May 2025 there's an

[52:28] outline there's an introduction an

[52:30] overview langchain langraph crew open

[52:32] it's it's a it's noted itself as a

[52:35] popular agents framework we Hope so. Uh,

[52:38] and then some others. It's mentioned

[52:40] small agents. I know a lot of people

[52:41] love small agents from Hugging Face. We

[52:43] won't have time to cover it today, but

[52:44] it's a great one. And, uh, and Autogen

[52:47] that John mentioned earlier as well.

[52:48] There's a section on market trends. Look

[52:50] how substantive this is. Challenges and

[52:52] considerations, future directions, and

[52:54] conclusion. And at the bottom, it has

[52:56] cited its references. And let's have a

[53:00] quick look at the trace to see this.

[53:03] And what you'll see now, of course, is

[53:04] that the trace is more interesting than

[53:06] that the the joke trace I showed you at

[53:08] the beginning. This is called a research

[53:10] trace. You'll see the planner agent was

[53:12] called first and then the search agent

[53:15] was called. And you'll see that it ran

[53:17] five searches at the same time in

[53:20] parallel. Then the writer agent was the

[53:22] one that took all of the time. You see

[53:24] here the timeline. This this blue line

[53:26] here is showing you how much time it was

[53:28] taking. And then finally the push agent.

[53:30] It shows it using the push tool right

[53:33] here and the final response. So, I can't

[53:36] stress enough, it's so important when

[53:38] you run these that you then come back to

[53:40] the traces and you look through it. Uh

[53:42] because the the the uh you can just sort

[53:44] of trust that your agent system is

[53:46] working as expected. Um but you should

[53:48] always come in and look at it and see

[53:50] for sure that it's it's doing what you

[53:52] thought. So an excellent question which

[53:55] is okay so we've seen how you can run

[53:57] this collect traces and then go into

[53:59] open AI's tools to look at those traces

[54:01] but what if you wanted to log that

[54:03] yourself in your own database or maybe

[54:05] show it to the user in some situations

[54:07] or have it in files. Can you do that?

[54:08] And the answer is yes. Uh OpenAI agents

[54:11] SDK has made that super simple. There's

[54:13] an easy way to to to um catch uh the

[54:16] tracing it's doing and write your own

[54:18] tracer. And in fact in module 3 we will

[54:21] do exactly that. we're going to build

[54:23] something. When we have our our traders,

[54:26] our live traders trading there, we're

[54:28] we're going to want to see what they're

[54:29] doing. It's going to be super boring if

[54:30] they're just sitting there thinking,

[54:31] we're going to want to see that on the

[54:33] screen. So, we're going to write a

[54:34] custom tracer that's going to write to a

[54:36] database and then show us on the screen

[54:38] what each trader is doing. So, great

[54:41] question and uh and that's the answer.

[54:43] And you'll see if you look in the third

[54:46] module uh code, you'll see a a Python

[54:48] module traces.py Pi uh that shows that

[54:51] happening. All right, we're almost at

[54:53] the end of the first module. I've got

[54:54] one more thing to show you and then it's

[54:56] uh back to John. I want to show you that

[55:00] it's also super easy to put a little

[55:03] user interface around this. Uh now I

[55:06] happen to be a huge fan of Gradio. Uh

[55:10] who here knows Graddio? Hands for people

[55:12] that know Gradio. Yeah, Gradio is

[55:14] wonderful. It's good to see. Gradio is

[55:16] now owned by Hugging Face. It's a lovely

[55:18] platform that means that that even

[55:20] horrible front-end developers like me,

[55:22] you never want me near a front end

[55:24] except if I have gradio, I can do it

[55:26] easily. And so with just a few lines of

[55:28] gradio that you can look at yourself, we

[55:30] can put a little user interface around

[55:32] this. And so I can just say uh I can

[55:34] just bring that up

[55:37] and we can have a look at a user

[55:39] interface around the deep research tool

[55:41] that we just built. Here it is. Uh what

[55:44] topic would you like to research? It's

[55:45] going to ask us. We're I'm going to say

[55:47] um what should I attend at

[55:52] ODSC East

[55:56] on Thursday, May the 15th, 2025.

[56:00] Something that might be useful for

[56:01] everyone here. Let's see. I press run.

[56:04] The first thing it does up here is it

[56:06] prompts me to show me the trace if I

[56:08] want to see that. So, I can bring up and

[56:09] watch the trace while it's running. Uh

[56:12] and uh it's now saying search is planned

[56:14] started to search. I'll make this a bit

[56:16] bigger.

[56:20] And you'll find this in a folder called

[56:23] deep research in the first folder. And

[56:25] deep research.py is the gradio code to

[56:28] bring this to life. And you'll see it.

[56:29] It's uh insane how easy it is to take an

[56:32] agent workflow and just throw up a user

[56:35] interface to bring it to life. It's now

[56:38] writing the report, which is always the

[56:39] the the longest part of the process, but

[56:41] Oh, done.

[56:45] There's the the ping. And here we go.

[56:47] ODSC East 2025. What to attend on

[56:49] Thursday, May the 15th. Introduction,

[56:52] conference overview, keynote sessions

[56:54] here. Uh looks like blueprint for

[56:57] impactful agentic AI in the enterprise.

[57:00] That sounds like a good one. Uh and uh

[57:02] workshop offerings, networking

[57:04] opportunities, and recommended

[57:05] strategies for maximizing attendance.

[57:08] And a conclusion. How about that? So if

[57:11] you have a moment in the lunch break

[57:13] perhaps to bring up the code and run

[57:14] this yourself, you can plan out your day

[57:17] tomorrow with the help of your very own

[57:20] deep research agent.

[57:22] All right, and that wraps up the first

[57:25] module and I will pass you back over to

[57:28] John.

[57:30] [Applause]

[57:33] [Music]

[57:37] Nicely done, Ed. I did notice that uh

[57:39] our session was mentioned there in that

[57:42] in that research. Did you see that?

[57:44] Yeah. Uh so it didn't Yeah. You know

[57:49] there is not a 100% accuracy as we were

[57:52] talking about at the beginning of the

[57:53] session. It is not Thursday uh today but

[57:58] um don't mind it uh giving us that

[58:00] support.

[58:01] Nice. All right. So thank you. I hope

[58:03] you enjoyed that first hands-on demo.

[58:05] Isn't Ed great? I just like Yeah. Yeah.

[58:09] Another round of applause. That's

[58:10] organic.

[58:16] Fantastic. All right. So,

[58:19] brilliant. So, we've now finished module

[58:22] one where I stood up here and defined

[58:25] agents a bit for you and hopefully made

[58:27] a case for why it's never been a better

[58:30] time to be thinking about building agent

[58:32] AI agent systems personally in an

[58:35] enterprise whatever. And Ed just

[58:38] completed our first coding session where

[58:41] we recreated OpenAI's deep research

[58:44] functionality using the OpenAI agents

[58:47] SDK.

[58:49] Now in module two, I'm going to start

[58:52] things off with a relatively uh short

[58:54] theory session on designing agents. So

[58:58] best practices for developing these the

[59:01] kinds of patterns that we have and then

[59:03] Ed will come up and I think it's our

[59:05] most substantial uh module 2 is our most

[59:07] substantial coding session. So that

[59:09] might end up being um you know we might

[59:12] do that in two parts uh depending on how

[59:15] long it takes one before lunch and one

[59:16] after lunch. Um, we also actually, you

[59:19] know, now would be the perfect time for

[59:21] us to maybe do some audience questions.

[59:23] We've we've finished module one. It

[59:25] seems like we're making good time. Um,

[59:28] so we do we have a um we have a

[59:30] microphone here. Um, we can uh pass it

[59:34] to you if there's we can do a few

[59:35] questions in a row and people could

[59:37] actually hear your questions. Um, is

[59:40] there any any pressing questions? Hi,

[59:43] thanks for the session, Ed. Uh I know we

[59:45] quickly talked about structured outputs.

[59:47] Um so I haven't um hands-on used pyantic

[59:52] objects before but I did use zstring I

[59:55] believe uh earlier. Do you is pyantic

[59:58] the recommended approach for structured

[59:59] outputs or are there others that you you

[01:00:02] would suggest tinkering with for the

[01:00:04] openi agents SDK in particular? It does

[01:00:07] expect a pyantic object so just a

[01:00:09] subclass of base model but it's super

[01:00:11] lightweight. It's like a data object.

[01:00:13] It's a way to to define your field. I

[01:00:15] think Lang graph is more permissive. You

[01:00:17] can use a lot of different types for for

[01:00:19] langraph but with open agents SDK they

[01:00:21] they do expect a subcluster based model

[01:00:23] to go in there. Thank you. Great

[01:00:25] session. Uh great session. Super. Uh one

[01:00:29] question before OpenAI agents SDKs

[01:00:32] came uh there was one pertaining

[01:00:35] question with regard to debugging. How

[01:00:37] to debug multi- aent systems? that's

[01:00:40] been the pain point for for the

[01:00:42] developers. Not sure how the traces will

[01:00:45] help us or maybe if there is anything

[01:00:47] that you can talk about on that. Yeah, I

[01:00:50] so the the short answer is uh that that

[01:00:53] it's it's hard that uh generally in

[01:00:57] working with LLMs uh I often find that

[01:01:01] that that people come at LLM engineering

[01:01:04] with a software engineering hat on

[01:01:06] looking looking to build a lot of code

[01:01:08] and build lots of systems. A lot of

[01:01:10] questions I get is about how do I attach

[01:01:12] to this database or or uh or how do I

[01:01:14] use rag in this way and people forget

[01:01:17] that fundamentally it's a data science

[01:01:20] discipline and we need to act like

[01:01:22] scientists first and foremost and

[01:01:24] working with agentic systems it's even

[01:01:26] more so the amount of of research and

[01:01:29] development and experimentation you need

[01:01:31] to do to convince yourself that it is

[01:01:34] following a particular formula uh and to

[01:01:37] to start small and simple and with one

[01:01:39] agent and make absolutely sure that

[01:01:41] you've you've worked with that agent in

[01:01:43] detail. You understand when it performs,

[01:01:45] when it doesn't perform, before you

[01:01:47] start adding more agents before you

[01:01:49] start growing and then for sure working

[01:01:51] with traces, working with guard rails

[01:01:53] with open AI agents SDK and uh just

[01:01:56] measuring and monitoring at every step

[01:01:58] of the way. Uh but generally working

[01:02:00] with LLMs requires a lot more of that

[01:02:03] science hat than than a lot of of

[01:02:05] development. But working with agentic

[01:02:07] systems is even more so. So so there's

[01:02:10] no shortcut to experimentation and

[01:02:13] starting small is also such a big a big

[01:02:15] trick. A lot of people send me solutions

[01:02:18] which involve many agents collaborating

[01:02:20] and it's not doing what they want and

[01:02:22] they say why isn't this working? And the

[01:02:24] answer is rewind. Start start small.

[01:02:27] Build something very small. Make sure

[01:02:28] that works and gradually add to it.

[01:02:31] Thanks Ned. Great session again. I have

[01:02:34] a question in terms of uh one pricing.

[01:02:37] How do you keep track of um the costs

[01:02:39] that each of these agents uh cost you

[01:02:41] over a period of time? Um and then the

[01:02:43] other one is how does the interaction um

[01:02:46] with these structured data that you're

[01:02:47] going to probably discuss? What about

[01:02:49] visualization? Are there any

[01:02:51] integrations possible um so business

[01:02:54] users can understand that data without

[01:02:57] having to actually look at it? When it

[01:02:58] comes to visualization,

[01:03:00] the I do believe that Google's agent

[01:03:04] development kit, which is which is very

[01:03:06] new, comes with a lot of really exciting

[01:03:08] visualization tools, which is one way

[01:03:11] that that that it's really standing out.

[01:03:13] With OpenAI agents SDK, they they

[01:03:15] probably put the onus on you to be

[01:03:17] building that kind of scaffolding and to

[01:03:19] be writing the uh the code that is that

[01:03:22] is um presenting that in a format that's

[01:03:24] going to be useful to the to the users.

[01:03:26] So again, in the in the third module,

[01:03:28] when we build our trading platform, we

[01:03:30] do want to be showing our users what the

[01:03:32] agents are thinking about. And the way

[01:03:34] that we do that is we intercept OpenAI's

[01:03:37] tracers logic and we build our own and

[01:03:40] then write that to the database and

[01:03:41] visualize it ourselves using colors and

[01:03:43] things like that. Uh so it's it's

[01:03:45] engineering work that we've written to

[01:03:47] to add to to to the environment. Wait,

[01:03:50] and what was the cost question? Oh, the

[01:03:51] cost question, of course. Uh yes. So uh

[01:03:54] that's another super important question

[01:03:57] and uh it is a big risk. I think John

[01:04:00] mentioned the risk with aentic systems

[01:04:02] is that the costs can be unpredictable

[01:04:04] and particularly if they get into a loop

[01:04:06] they can just keep chugging away and

[01:04:08] your costs can keep building. Uh so uh

[01:04:11] there there's there's a few controls

[01:04:13] there's there's some controls that you

[01:04:14] put on in the agent framework. So,

[01:04:17] OpenAI has a has a a a maximum number of

[01:04:20] turns that any one agent's allowed to

[01:04:22] run for that defaults to 10 and after

[01:04:25] that it will fail. And you can override

[01:04:26] that and make that a bigger number. In

[01:04:28] the trading example, I make it 30. Uh

[01:04:31] but you have to do that cautiously and

[01:04:33] always being aware of of of your limits

[01:04:35] and what that might cost you. But by far

[01:04:37] the most important is putting the

[01:04:39] constraints on the uh on the on the API

[01:04:43] itself. In OpenAI, you can of course set

[01:04:45] up limits. You can set up limits for

[01:04:47] your whole organization or for each

[01:04:49] individual project and you can manage

[01:04:51] and track those limits and make

[01:04:53] absolutely sure that it will stop uh

[01:04:55] when it when it uh uh uses up those

[01:04:57] limits. So it's super important to

[01:04:59] monitor your spend and watch your

[01:05:01] limits. Now, the OpenAI limits

[01:05:04] monitoring system isn't foolproof that

[01:05:07] if you have like a tight loop that calls

[01:05:09] it a lot, you can spend more than the

[01:05:12] amount of credits you put on OpenAI and

[01:05:14] you can go into like a negative balance

[01:05:16] and if you then top up with more money,

[01:05:18] it will it will use that negative

[01:05:19] balance which which is something to

[01:05:21] watch out for. I've seen people be burnt

[01:05:23] by that before. Uh so always monitoring,

[01:05:27] watching and uh making sure you've got

[01:05:29] controls at each step is very important.

[01:05:32] I think I might add on to that that you

[01:05:33] can also as Ed's using today in in the

[01:05:36] demo that we saw already, you were using

[01:05:39] a very inexpensive model 4.1 mini. And

[01:05:42] so that also it reduces the stakes. It's

[01:05:45] like it's like playing lowblind poker

[01:05:48] where you're you know how much of a bill

[01:05:51] you can run up is relatively small. Um,

[01:05:53] same thing with using like a DeepSk. Um,

[01:05:56] whereas if you're using 01 or 03 mini

[01:06:01] high or something like that, you could

[01:06:03] all of a sudden very quickly be using

[01:06:04] dollars per second. Um, so yeah. So

[01:06:08] yeah, so in module two here, I'll be

[01:06:11] going over uh key design patterns for

[01:06:14] designing agentic systems, um, workflows

[01:06:17] as well as agents proper. And yeah, at

[01:06:20] the end of the module, you'll code up an

[01:06:22] engineering team with crew AI. And yeah,

[01:06:26] that'll be a nice um foundation

[01:06:30] for a module three when that engineering

[01:06:32] team will uh develop the software to

[01:06:36] have autonomous traders using anthropics

[01:06:39] MCP. Right? So module two on designing

[01:06:42] agents. Recall from earlier this slide

[01:06:45] is a recap. So you have already seen

[01:06:48] this slide. We talked about how

[01:06:51] anthropic distinguishes between two

[01:06:53] types of agentic systems. One of them is

[01:06:57] workflows which are relatively simple.

[01:06:59] These are systems again where LLMs and

[01:07:02] tools are orchestrated through

[01:07:04] predefined code paths. Predefined

[01:07:07] obviously being the code the the key

[01:07:09] word. And then agents are systems where

[01:07:13] LLM's dynamically direct their own

[01:07:15] processes and tool usage, maintaining

[01:07:17] control over how they accomplish tasks.

[01:07:19] So more flexibility there, potentially

[01:07:22] more power, but also more risks, more to

[01:07:24] be aware of. So let's go through the

[01:07:26] workflows first. The first workflow that

[01:07:30] I'm going to explain is called prompt

[01:07:32] chaining. And all of this, by the way,

[01:07:34] comes from a uh a December blog post,

[01:07:37] December 2024 blog post from Anthropic

[01:07:40] called Building Effective Agents. So you

[01:07:43] can Google that easily and get more

[01:07:44] information on any of the things that

[01:07:46] we're describing here. Building

[01:07:48] effective agents is the blog post from

[01:07:50] Anthropic. And so the first workflow

[01:07:54] design pattern that they describe in

[01:07:56] that blog post is called prompt

[01:07:58] chaining. This is the simplest of all of

[01:08:01] them really. Uh and in this one we

[01:08:04] decompose

[01:08:05] into fixed subtasks. So you think about

[01:08:08] your overall problem that you're

[01:08:10] tackling. You break it into subtasks and

[01:08:13] have LLM handle those subtasks

[01:08:16] individually. So here's a diagram of

[01:08:18] this workflow. You've got the in on the

[01:08:21] far left and you'll see the in on all of

[01:08:23] the workflows that I cover, all five of

[01:08:25] them. This is the beginning of the work

[01:08:27] of the workflow. So you can imagine this

[01:08:29] is some kind of user input. Um and then

[01:08:33] out happens at the end. That's the end

[01:08:34] of the workflow. And so that could end

[01:08:37] with an agent taking some action or

[01:08:39] outputting some tokens uh for example to

[01:08:42] the user. The yellow boxes um these

[01:08:46] represent LLMs. So throughout all of

[01:08:48] these diagrams that I'm going to be

[01:08:49] describing, yellow is always an LLM and

[01:08:53] blue is code that you've written. So um

[01:08:58] critically here for this one for the

[01:09:00] prompt chaining workflow the blue box

[01:09:04] the code box that isn't essential that

[01:09:07] isn't an essential component of prompt

[01:09:09] chaining you could actually have just

[01:09:11] lms tackling subtasks but to show you to

[01:09:14] give you an illustrative example that

[01:09:16] does include code you can optionally

[01:09:18] include it so an example flow here with

[01:09:22] prompt chaining your prompt your user

[01:09:25] input in goes to the first LLM and then

[01:09:30] the LLM1 the leftmost

[01:09:33] yellow box it passes it its output to

[01:09:37] code that you've written and this code

[01:09:39] that you've written acts as some kind of

[01:09:41] gate um it uh processes it or passes

[01:09:45] along uh depending on what you needed

[01:09:47] that code to do to LLM2

[01:09:50] and then LLM2 does its specialized

[01:09:54] processing it passes along some output

[01:09:56] as an input to LLM3 and then finally

[01:10:00] LLM3 its output flows out of the system

[01:10:04] for example to a user or to a database

[01:10:06] or maybe taking some kind of action. The

[01:10:08] number of LLM calls is arbitrary, but

[01:10:12] the key idea is that you are breaking

[01:10:15] down the overall task into subtasks and

[01:10:18] you are deciding

[01:10:21] uh exactly what that LLM does, what its

[01:10:23] prompt is or sorry, what its uh

[01:10:25] instructions are and so how it therefore

[01:10:27] deals with a prompt. Why would we use

[01:10:31] this kind of workflow? Well, we have

[01:10:32] more control over each of the subtasks.

[01:10:35] So this could be a good place to start

[01:10:37] on some problem that you're tackling.

[01:10:39] Um, and the reason why you break it into

[01:10:42] subtasks is because you can get more

[01:10:46] effective responses each step of the

[01:10:47] way. You can check your traces to ensure

[01:10:49] that each of those subm models is doing

[01:10:51] what it's supposed to be doing as

[01:10:52] opposed to relying on an LLM say to

[01:10:56] handle all subtasks on its own. That is

[01:10:58] an option, but you have less control.

[01:11:01] And by doing it this way, by breaking it

[01:11:03] into subtasks each step of the way, we

[01:11:06] can have guardrails to ensure that

[01:11:09] things are going as we anticipated,

[01:11:11] making it easier to debug. Following

[01:11:13] along with the question that we had um

[01:11:16] in between modules. So some real world

[01:11:19] examples. Um a content creation pipeline

[01:11:22] is is something you could use here. So

[01:11:23] actually both of these real world

[01:11:25] examples I'm going to give you happen to

[01:11:27] follow exactly this schematic. But again

[01:11:29] remember the number of subtasks that

[01:11:32] LLMs are handling is arbitrary. Here we

[01:11:34] happen to have three. We happen to have

[01:11:36] uh code in here. You don't need to have

[01:11:38] that. But both examples I'm going to

[01:11:40] give just to make it easier to follow

[01:11:41] along will exactly follow this diagram.

[01:11:44] So the first one is a content creation

[01:11:47] pipeline. So you can imagine a marketing

[01:11:49] agency could use LLM1 to generate

[01:11:52] article outlines and then you could have

[01:11:54] a gate to check if the outline meets

[01:11:57] brand guidelines. So you could have some

[01:11:59] very some deterministic brand guidelines

[01:12:03] that you need to have followed. You

[01:12:04] don't need an LLM for that. And then

[01:12:06] LLM2 if uh if the content passes the

[01:12:09] gate, LLM2 will write a full draft based

[01:12:13] on the outline that the gate approved.

[01:12:16] And then LLM3 can take that draft and

[01:12:20] polish it um and maybe add in SEO

[01:12:23] optimizations or something like that and

[01:12:25] then output the finished article with

[01:12:27] those SEO optimizations. As a second

[01:12:29] example, maybe uh close to the heart of

[01:12:32] those here, lots of hands-on

[01:12:33] practitioners is a code generation

[01:12:36] workflow. So here uh LLM1

[01:12:40] uh so the user provides some code that

[01:12:42] you would like to have generated by this

[01:12:44] workflow. LLM one generates pseudo code,

[01:12:47] so converts requirements into pseudo

[01:12:49] code. And then the gate checks for

[01:12:52] architectural soundness. LLM 2

[01:12:55] transforms the pseudo code into actual

[01:12:57] code. And finally, LM3 adds

[01:13:00] documentation and test cases to the code

[01:13:03] and provides all of that as an output

[01:13:05] for you. Cool. That's workflow number

[01:13:08] one, prompt chaining. Workflow number

[01:13:10] two is routing. So here with routing we

[01:13:15] direct an input into um one specialized

[01:13:18] subtask ensuring separation of concerns.

[01:13:21] So it'll be easiest for me to explain

[01:13:22] what that means by showing you a

[01:13:24] diagram. So here your input goes to an

[01:13:27] LLM which um triages which routes

[01:13:32] the input to one appropriate LLM uh for

[01:13:37] the subtask. So in this case here again

[01:13:39] the number of subtask specialized LLMs

[01:13:42] you have is arbitrary here we happen to

[01:13:45] have three and so LLM 1, LLM 2, LLM 3

[01:13:49] each of these is specialized in a

[01:13:51] different subtask

[01:13:53] and the LLM router is aware of what the

[01:13:57] specializations of each of the three are

[01:13:59] and routes the input to the most

[01:14:03] appropriate of the three. just one of

[01:14:06] those three um executes its specialized

[01:14:09] subtask and you get one output out of

[01:14:12] this um pattern. Uh yeah, this is a

[01:14:15] powerful and common approach and as some

[01:14:18] real world examples u medical diagnosis

[01:14:21] support. So earlier I was talking about

[01:14:22] how uh agentic systems could

[01:14:24] revolutionize uh medical diagnostics. So

[01:14:27] here's a concrete example. So uh

[01:14:31] patients symptoms are passed into the

[01:14:34] LLM router and the LLM router is aware

[01:14:37] that LLM1 is a cardiology specialist.

[01:14:40] LLM2 is specialized in neurological

[01:14:42] cases and LLM3 is specialized in

[01:14:45] dermatological cases. And so the LLM

[01:14:48] router gets um some query about acne.

[01:14:53] And so it sends it to LLM3 because

[01:14:55] that's the dermatological specialist.

[01:14:57] and then you just get one output um for

[01:14:59] that particular request. LLM one and

[01:15:01] LLM2 sat dormant. They didn't have

[01:15:03] anything to do. As a second example, uh

[01:15:06] legal document processing, the router um

[01:15:08] could c could categorize legal

[01:15:10] documents. So, uh it would send

[01:15:13] contracts to LLM 1. It would send

[01:15:15] compliance documentation to LLM 2 and it

[01:15:18] would send litigation materials to LLM

[01:15:20] 3. So each of the three LLMs is

[01:15:22] specialized in different tasks,

[01:15:24] contracts, compliance, and litigation.

[01:15:27] And so one of those would be selected

[01:15:30] and uh then would prepare a response,

[01:15:32] would prepare maybe documents and

[01:15:34] provide those as an output back to you.

[01:15:36] Cool. Hopefully straightforward so far.

[01:15:38] That's routing. Our third

[01:15:41] superficially looks a lot like the

[01:15:43] routing as you'll see. It's called

[01:15:45] parallelization.

[01:15:46] The key here is that unlike routing, we

[01:15:51] will actually use multiple LLMs in

[01:15:54] parallel as opposed to just choosing

[01:15:56] one. So we break down our task and run

[01:15:59] multiple subtasks concurrently. Here's

[01:16:01] what that looks like. So now here

[01:16:04] um so we have multiple LLMs running in

[01:16:07] parallel. But there is one other key

[01:16:09] change here. You may remember from the

[01:16:11] preceding slide that uh we had a an LLM

[01:16:15] acting as the router previously. We'll

[01:16:17] get back to a workflow that has that

[01:16:18] again momentarily. But in the meantime

[01:16:21] to give us a bit more control, you can

[01:16:24] have a coordinator that's actually code

[01:16:27] and so it isn't an LLM here. So we have

[01:16:30] code as the coordinator and then we also

[01:16:32] have code as an aggregator. And so the

[01:16:34] aggregator um there are a number of

[01:16:36] different things it could be doing here.

[01:16:38] It could be just taking different

[01:16:39] pieces. So, LLM 1, LM2, LLM 3 could

[01:16:42] generate different parts of a report.

[01:16:44] And it could be up to the aggregator to

[01:16:46] just simply concatenate those components

[01:16:49] and provide them as an output. But you

[01:16:50] could also end up in situations where

[01:16:52] maybe all three LLMs are actually doing

[01:16:56] the same subtask. So, for whatever

[01:16:59] reason, uh, like we actually saw with

[01:17:01] the deep research example, uh, Ed had in

[01:17:04] the demo, five times you did five

[01:17:06] different searches, but you had the same

[01:17:09] task being asked for. And so, you could

[01:17:11] have the same kind of thing here where

[01:17:13] all three LLMs instead of being

[01:17:14] specialists in different tasks, they're

[01:17:16] actually tackling the same task, they

[01:17:18] have the same specialization. And the

[01:17:20] aggregator then it might take the mean

[01:17:23] in some way. Maybe you have it doing

[01:17:25] math and you have it take the mean of

[01:17:28] the responses, the mean of a forecast.

[01:17:30] Or maybe you could have a whole bunch of

[01:17:32] LLMs. You could have uh 10 LLMs going

[01:17:36] and you're expecting, you know, a whole

[01:17:38] number as the result. You could actually

[01:17:40] take the mode. Um or, you know, maybe

[01:17:43] for some reason it's picking colors out

[01:17:45] of some different color options. And

[01:17:47] again, you could have the aggregator

[01:17:49] select the mode uh the most common

[01:17:51] response from those different LLMs. To

[01:17:54] make this concrete, you could think

[01:17:55] about uh one example would be a

[01:17:57] scientific literature review where

[01:17:59] research papers are analyzed by multiple

[01:18:02] LLMs uh that focus on different aspects.

[01:18:04] So the first one does uh uh an

[01:18:07] evaluation of the methodology of the

[01:18:09] research paper. The second one is

[01:18:11] specialized in doing a statistical in in

[01:18:14] evaluating the statistical analysis. And

[01:18:16] then the third one is specialized in

[01:18:18] interpreting the results. And then the

[01:18:20] aggregator can simply synthesize each of

[01:18:23] those specialized analyses into a

[01:18:25] comprehensive review. As a second and

[01:18:27] final example, you could have a

[01:18:29] financial investment analysis where

[01:18:32] market data are provided um to the

[01:18:35] coordinator which sends that market data

[01:18:38] to all three of the LLMs. The LLM, one

[01:18:41] is specialized in tech analysis, the

[01:18:43] second one in healthcare, the third one

[01:18:45] in energy, and each one of those LLMs

[01:18:48] provides different sector specific

[01:18:50] insights on the raw market data, and

[01:18:53] then the aggregator combines those

[01:18:55] together to create a diversified

[01:18:57] investment recommendation that balances

[01:19:00] risks and opportunities across all three

[01:19:02] sectors.

[01:19:03] There you go. That's number three. The

[01:19:05] fourth workflow design pattern is the

[01:19:07] orchestrator worker which again is going

[01:19:10] to look superficially similar. Here

[01:19:13] complex tasks are broken down

[01:19:15] dynamically

[01:19:16] and combined. So this is a copy paste of

[01:19:20] the preceding diagram except that now

[01:19:23] the orchestrator and the synthesizer

[01:19:26] they are LLMs. So we're have we have

[01:19:30] more flexibility, more dynamism. We

[01:19:34] start to feel less like maybe these

[01:19:36] these these start to feel less

[01:19:37] concretely like a strict workflow and

[01:19:41] more and more like a proper agentic

[01:19:44] system where agents are involved in more

[01:19:47] and more of the decision-m they have

[01:19:49] more and more autonomy around how this

[01:19:51] task should be accomplished. So yes, uh

[01:19:56] this is our most dynamic workflow so far

[01:19:59] has fewer constraints and so it would

[01:20:02] have the same kinds of the the examples

[01:20:03] that I gave you for the preceding one.

[01:20:06] Uh you could use those again. So I had

[01:20:07] the examples of the scientific

[01:20:09] literature review or the financial

[01:20:11] investment analysis. I'm not going to

[01:20:13] repeat those over, but you know again

[01:20:15] you could have three LLMs that are

[01:20:16] specialized in three different areas.

[01:20:19] But instead of having your code decide

[01:20:21] what goes to those LLMs, you have an LLM

[01:20:24] orchestrator do it. And then similarly,

[01:20:27] and you could imagine how much more

[01:20:28] useful this would be, especially for the

[01:20:30] synthesis, to have an LLM doing that

[01:20:33] instead of code that you've written

[01:20:35] because even in those examples that I

[01:20:36] gave, the scientific literature review,

[01:20:38] the financial investment analysis, you

[01:20:40] don't just want to be concatenating

[01:20:42] results. it would be nice to have it,

[01:20:44] you know, to have an intro added and an

[01:20:46] outro, uh maybe redundancies removed and

[01:20:50] all of that could be handled very nicely

[01:20:52] by a large language model. Finally, our

[01:20:54] fifth workflow design pattern is the

[01:20:56] evaluator optimizer. So with this one,

[01:21:00] uh which is sometimes also just called

[01:21:01] an evaluator or a validator. Um in this

[01:21:04] one, the LLM output is validated by

[01:21:07] another LLM. This is a super useful

[01:21:11] workflow. You should be thinking about

[01:21:13] using this all the time. I mentioned

[01:21:14] this even earlier in module one where if

[01:21:16] you want to be reducing error rates, you

[01:21:19] want to be improving the utility of some

[01:21:21] agentic application in an enterprise,

[01:21:23] you can have a second LLM validating

[01:21:25] outputs. um which means that you're

[01:21:28] going to dramatically reduce your

[01:21:30] hallucination rates because if if let's

[01:21:32] say you have uh you're already working

[01:21:34] with a reliable LLM

[01:21:37] um that has a you know it it has a 99%

[01:21:41] accuracy rate and then you work with a

[01:21:43] validator that also has a 99% accuracy

[01:21:46] rate overall for that whole pipeline for

[01:21:48] that whole workflow you can multiply

[01:21:50] those probabilities by each other 0.99*

[01:21:52] 0.99 to give you you know a very small

[01:21:55] probability ility of an error making it

[01:21:57] through the whole workflow. And uh yeah,

[01:22:00] so you could use this uh in a deep

[01:22:02] research setting like we just had in

[01:22:03] module one where you validate outputs

[01:22:05] and maximize the chances of an accurate

[01:22:07] response resulting in things like that

[01:22:09] huge jump in accuracy that we saw in

[01:22:11] humanity's last exam. So here's what the

[01:22:13] workflow looks like. Um it's a very

[01:22:16] simple diagram uh where you have your

[01:22:19] input going to some LLM generator. that

[01:22:22] solution is provided to an evaluator and

[01:22:24] then it rejects with feedback back to

[01:22:27] the generator if needed or if not needed

[01:22:30] then the solution is accepted and goes

[01:22:32] as an output. So here now we have a loop

[01:22:35] for the first time in these workflows

[01:22:38] and again this is a step in the

[01:22:41] direction of being a fully agentic

[01:22:42] system because this could potentially go

[01:22:45] on for quite some time and of course it

[01:22:48] doesn't need to be this simple of a

[01:22:50] diagram. You could have lots of LLMs

[01:22:53] code components. It could be combining

[01:22:55] lots of workflow design uh patterns

[01:22:57] together. But fundamentally the idea of

[01:22:59] this evaluator workflow is that you have

[01:23:01] an evaluator u checking the correctness

[01:23:04] of work. Um as an example this is

[01:23:06] probably an obvious one code generation

[01:23:08] and review. So you could have a

[01:23:09] generator that's gen that's writing code

[01:23:12] while an evaluator checks for security

[01:23:13] vulner vulnerabilities performance

[01:23:16] issues adherence to coding stand

[01:23:18] standards that your organization has. Um

[01:23:21] and uh the generator could then refine

[01:23:24] based on feedback from the evaluator. So

[01:23:26] you could do some back and forth kind of

[01:23:28] like pair programming with a more senior

[01:23:31] uh software developer uh advising you um

[01:23:34] until the evaluator is satisfied and the

[01:23:36] output is accepted. Um and it's a final

[01:23:39] example and actually the final example

[01:23:41] that I'm going to be giving uh entirely

[01:23:43] before we get to Ed uh go back to Ed and

[01:23:45] have some concrete uh hands-on work. Um

[01:23:48] you can imagine educational content

[01:23:50] development where a generator is

[01:23:51] creating lesson materials and the

[01:23:53] evaluator is assessing the effectiveness

[01:23:55] of these materials, age appropriateness,

[01:23:58] alignment with learning objectives and

[01:23:59] iterating with the generator until it's

[01:24:02] satisfied and you get some output from

[01:24:04] the system. Okay, so those are our five

[01:24:07] workflow design patterns. Remember that

[01:24:09] these workflow designs we have decided

[01:24:12] some overall flow and that is what

[01:24:15] distinguishes them from proper agents.

[01:24:20] So agents are open-ended. Um you you

[01:24:24] don't you can't necessarily create this

[01:24:27] specific flow of how information will go

[01:24:29] from input to output. You can have your

[01:24:31] agents deciding that autonomously

[01:24:34] dynamically.

[01:24:36] There will be feedback loops. You saw in

[01:24:38] in the preceding workflow that was the

[01:24:40] only workflow that had a feedback loop.

[01:24:42] But agentic proper workflows could or

[01:24:45] sorry agentic proper systems uh could

[01:24:48] have uh multiple feedback loops with

[01:24:50] lots of uh with lots of processing

[01:24:53] happening multiple times in different

[01:24:54] places throughout um throughout the the

[01:24:57] process throughout the flow. And um this

[01:25:01] means that you can also be running up

[01:25:02] your costs much more easily. Um and so

[01:25:05] you know there's more things that you

[01:25:06] need to be careful about and as I

[01:25:08] already have stated the most critical

[01:25:11] aspect of proper agents is that there is

[01:25:14] no fixed path. So this means that this

[01:25:17] is potentially much more powerful but

[01:25:19] you also have risks around robustness,

[01:25:21] safety and cost and it's more

[01:25:23] challenging to ensure that this will run

[01:25:26] in production effectively like you want

[01:25:28] it to and that it will meet the time and

[01:25:30] the cost constraints that you have for

[01:25:32] your particular application. Thankfully,

[01:25:36] the kinds of agentic frameworks that we

[01:25:38] will continue that Ed will continue to

[01:25:39] demonstrate today allow you to reduce

[01:25:42] your risks and increase and optimize

[01:25:45] your chance of a successful agentic

[01:25:47] application. So, here is the diagram. It

[01:25:50] actually looks a lot like the final uh

[01:25:54] workflow that I showed you, the

[01:25:55] evaluator one. Um, but in this case,

[01:25:59] you just have complete flexibility. So

[01:26:01] it's it's actually kind of a boring

[01:26:03] uninteresting diagram because anything

[01:26:06] can happen in this. Um it's a diagram

[01:26:09] that basically shows anything can be

[01:26:11] happening here. So you have your input

[01:26:12] from a human. Um instead of having an

[01:26:15] output, we have an environment here. And

[01:26:18] so uh this is some outside world that

[01:26:21] can be interacted with. This could be

[01:26:22] databases. This could be the internet

[01:26:24] that you're searching over. This could

[01:26:26] be hardware. um an internet of things

[01:26:29] device that is being interacted with and

[01:26:32] so infinite flexibility here in terms of

[01:26:35] what the environment is but the idea is

[01:26:37] that an LLM or many LLMs take actions in

[01:26:42] the uh within the environment the

[01:26:44] environment provides feedback which

[01:26:46] could be data could be images uh could

[01:26:49] be video and uh based on that

[01:26:52] environment feedback the LLM continues

[01:26:55] to take actions So this can go on for

[01:26:58] some time or um it reaches some end

[01:27:01] state. It's it decides that it has met

[01:27:04] the criteria that it that that were

[01:27:06] asked of it and it stops

[01:27:09] and provides uh that output back to some

[01:27:12] code. Um it could be a grad app uh that

[01:27:15] then renders um the outputs nicely for

[01:27:19] you. You know takes the markdown and

[01:27:21] converts it into something that looks

[01:27:22] pretty for human users. Yeah. So there's

[01:27:25] no more specific design patterns to

[01:27:26] cover. It's kind of funny because we,

[01:27:28] you know, you're here for to learn about

[01:27:29] agents and I've now talked about these

[01:27:31] different kinds of agentic systems where

[01:27:33] you could have workflows or a proper

[01:27:36] fully autonomous agent. And for the

[01:27:40] workflows, I had five examples to go

[01:27:41] over. But for the agents, which is kind

[01:27:43] of the most exciting, there's nothing

[01:27:45] else to show. And that's because that's

[01:27:47] a reflection of the dynamism that these

[01:27:50] systems have. you can't capture that in,

[01:27:53] you know, in specific kinds of uh in in

[01:27:56] more specific kinds of diagrams. So the

[01:27:59] main idea here, the final one I'll leave

[01:28:02] you with is that with well-designed

[01:28:03] agents despite the flexibility, we can

[01:28:07] minimize risks, use agents safely, keep

[01:28:10] costs and execution times under control,

[01:28:13] and all the while make use of agents

[01:28:18] tremendous flexibility and dynamism. So

[01:28:22] to bring that to life, here again is Ed.

[01:28:26] [Applause]

[01:28:32] Such a treat hearing John's

[01:28:34] explanations. I love this. It makes me

[01:28:35] feel super excited to be showing you

[01:28:37] this, too. Wonderful. Uh so now it's

[01:28:41] time for me to tell you about Crew, my

[01:28:44] second favorite uh agent framework. And

[01:28:46] I do I do love Crew and it has a lot in

[01:28:49] common with OpenAI agents SDK. And it

[01:28:51] has some ways in which it's quite

[01:28:53] different as you will see. But first of

[01:28:54] all, something it has in common is it it

[01:28:56] also uses the word agent as its kind of

[01:28:58] basic building block. An agent is an

[01:29:01] autonomous unit with an LLM and with

[01:29:03] access to tools. But here's the first

[01:29:06] difference. If you remember with OpenAI

[01:29:08] agents SDK, when you defined an agent,

[01:29:10] you just gave it instructions like a

[01:29:12] system prompt. With crew, you give it a

[01:29:15] role, a goal, a backstory, and

[01:29:18] potentially memory. Now the role, the

[01:29:22] goal, the backstory that all ends up

[01:29:23] just being part of a system prompt, but

[01:29:26] crew force tries to encourage you to

[01:29:28] think about it this way and to break

[01:29:30] down the way you describe your agent

[01:29:32] with more steps. So then a task, this is

[01:29:35] a new kind of thing that we don't have

[01:29:38] an analog in in OpenAI agents SDK. A

[01:29:40] task is an assignment. It is something

[01:29:43] that you give to an agent. Every task

[01:29:46] has a a onetoone uh assignment to an

[01:29:48] agent and it has a description and

[01:29:51] potentially an expected output.

[01:29:53] And a crew in crew AI is just what they

[01:29:56] call a bunch of agents and tasks. That

[01:29:59] is what a crew is as as Jon had

[01:30:01] explained at the beginning. And crews

[01:30:03] can be set up to work in two different

[01:30:05] modes, a sequential mode and a

[01:30:08] hierarchical mode. And a sequential mode

[01:30:12] feels rather like the the workflows that

[01:30:14] John was describing. It just runs tasks

[01:30:17] in the order that you define them

[01:30:18] assigned to their agents. The

[01:30:21] hierarchical mode is when it runs a

[01:30:24] separate manager LLM and that manager

[01:30:28] LLM gets to choose which order the tasks

[01:30:30] are executed in. So there's more

[01:30:33] autonomy in that mode. And generally

[01:30:36] speaking, I would I would think of crew

[01:30:38] as being something which is similar but

[01:30:41] somewhat more opinionated than OpenAI

[01:30:44] agents SDK. It has some more terminology

[01:30:46] and it's a bit more prescriptive. And

[01:30:49] and I would say that that's neither it's

[01:30:51] it's both it's got some pros and it's

[01:30:52] got some cons. And I hope that you're

[01:30:54] going to really get a sense of that. I'm

[01:30:56] going to make that tangible for you so

[01:30:57] you see that. And the great thing about

[01:30:59] it is that it's got what people like to

[01:31:01] call batteries included. you get a lot

[01:31:03] for investing a bit more time into it.

[01:31:05] And you'll see some good examples of

[01:31:07] that in just a second. But first of all,

[01:31:09] I want to explain the five steps. If you

[01:31:11] remember with with OpenAI, I talked

[01:31:13] about three steps. There's going to be

[01:31:14] five steps. And we're going to do these

[01:31:15] five steps together for a couple of

[01:31:18] projects culminating in our very own

[01:31:20] engineering team. Hoping to get that

[01:31:22] done by 12:30 so we can leave it running

[01:31:24] during lunch, which will be really cool.

[01:31:26] Uh so what are the five steps? Uh first

[01:31:29] step is you create a project with crew.

[01:31:32] you you create your new project by

[01:31:34] running this command crewi create crew

[01:31:36] and then the name of your project and

[01:31:38] that sets up like a whole directory

[01:31:41] structure with a lot of scaffolding. It

[01:31:43] puts in lots of template classes and

[01:31:45] configuration files that you can then go

[01:31:46] in and edit. So you should expect quite

[01:31:48] a lot to be generated when you do that.

[01:31:51] The second step is you go into this this

[01:31:53] scaffolding, all of this code that's

[01:31:55] been generated, and you find a couple of

[01:31:56] configuration files that use the YAML

[01:31:59] format, a nice human readable format,

[01:32:01] and there's one called agents.yaml and

[01:32:04] one called tasks.yaml that describes

[01:32:06] your agents and your tasks, and you fill

[01:32:08] them in to to uh uh arm crew with that

[01:32:11] information. There are other ways to do

[01:32:12] it, but this is the way that's that's

[01:32:14] recommended by crew and is the the

[01:32:16] easiest.

[01:32:17] The third thing you need to do is go to

[01:32:19] a module that's called crew.par. PI and

[01:32:21] this is where you write some code that

[01:32:23] stitches together your crew built out of

[01:32:25] agents and tasks and you refer to the

[01:32:28] config the YAML that you just wrote.

[01:32:31] And then the fourth step is there's

[01:32:33] another module called main.py. And this

[01:32:36] is where you do the final touches to get

[01:32:38] your crew ready including specifying the

[01:32:41] inputs the the original requests that

[01:32:44] you've got for your crew. You write it

[01:32:46] in main.py pi and then you just run crew

[01:32:49] aai run and the whole thing kicks off

[01:32:52] and you and you watch it with amazement.

[01:32:54] Uh so that's the process. Those are the

[01:32:56] five steps. Now we are going to be doing

[01:32:59] something quite interesting. We are

[01:33:01] going to be giving the ability for some

[01:33:03] of our agents to write Python code.

[01:33:07] We're going to make them into coders.

[01:33:10] And this is something that is

[01:33:11] challenging. It's complex because we're

[01:33:14] going to want to build an agent that can

[01:33:16] write code and can execute that code in

[01:33:19] a Docker container so that it's executed

[01:33:21] safely and then come back and look at

[01:33:23] the output and be be interacting with

[01:33:25] the Docker container. So, we're going to

[01:33:26] have quite a lot of work to do to make

[01:33:28] this work in in like a reliable way. Um,

[01:33:31] so this is going to be quite hard.

[01:33:33] Except it's not. This is going to be

[01:33:36] really easy.

[01:33:38] This when I say that crew comes with

[01:33:40] batteries included. This is exactly what

[01:33:42] I mean. In crew, you just write these

[01:33:45] these these two uh parameters. You pass

[01:33:47] them and you create an agent. Allow code

[01:33:49] execution equals true and code execution

[01:33:52] mode is safe. And it will handle

[01:33:55] everything else for us. It's going to

[01:33:56] set up the as long as you're running

[01:33:58] Docker, it will create a Docker

[01:33:59] container. It will make sure that the

[01:34:00] code happens in there. It will provide

[01:34:02] the outputs back to your agent. And so

[01:34:05] it's it's amazing that you get all of

[01:34:06] that out of the box. Now on the flip

[01:34:08] side, it's sort of harder to debug when

[01:34:11] it doesn't do what you're expecting

[01:34:12] because you have a bit less insight.

[01:34:14] It's it's it's not as as simplistic as

[01:34:16] OpenAI agents SDK when you have to do

[01:34:19] every step. So that's really the deal

[01:34:20] that you're making with Crew. You get a

[01:34:22] lot of this for free, but you are

[01:34:24] signing up for this ecosystem, and it is

[01:34:26] a bit harder to debug in my experience

[01:34:28] when it doesn't come up with with with

[01:34:30] what you're expecting. Now I did make

[01:34:32] one sort of subtle point here. People

[01:34:34] tend to call these things coder agents.

[01:34:37] And when I I I used to think that a

[01:34:39] coder agent meant like an agent that

[01:34:42] outputs code as you think like a coder

[01:34:44] agent is like a coder agent. Uh it's it

[01:34:48] means more than that. A coder agent is

[01:34:50] the expression for any agent that's able

[01:34:53] to write Python code and use that to to

[01:34:56] meet its goal. And its goal might have

[01:34:58] nothing to do with writing code. So, for

[01:35:00] example, you might have an agent where

[01:35:02] you can it's a customer support agent

[01:35:04] and you can say to it, uh, I'm I'd like

[01:35:06] to know the the 50th decimal place of pi

[01:35:08] for that. That's the kind of customer

[01:35:10] support agent it is for some reason. Uh,

[01:35:12] and the way that it answers that

[01:35:13] question is it has the ability to write

[01:35:15] a little bit of Python code, run that,

[01:35:16] find out the answer zero, and return

[01:35:19] that to you. And so, it's not returning

[01:35:21] Python code to you. It's returning the

[01:35:23] final answer. It's just able to use

[01:35:24] Python to achieve it. And that's what's

[01:35:27] called a coder agent, which is just just

[01:35:29] maybe worth understanding the

[01:35:30] distinction. But having said that, what

[01:35:32] we're going to do right now is we are

[01:35:34] going to make agents that write code,

[01:35:36] that kind of coder agent. And we're

[01:35:38] going to make a whole team of them.

[01:35:39] We're going to use crew to build an

[01:35:42] engineering team with an engineering

[01:35:44] lead that can sort of decide the design,

[01:35:47] a back-end engineer, a front-end

[01:35:49] engineer, and a test engineer that can

[01:35:51] validate it. And the team is going to

[01:35:53] work together autonomously. and we're

[01:35:55] going to leave it doing its thing over

[01:35:57] lunch, which is which is awesome. So,

[01:35:59] that that's the plan for right now. And

[01:36:01] and as I say, it's a little bit risky.

[01:36:03] This this works in 80% of my practices.

[01:36:06] So, uh keep your fingers and toes

[01:36:09] crossed for me, please. Here's our files

[01:36:12] again. Close the first folder.

[01:36:15] some of these tabs that are open

[01:36:20] and we're going into the second folder

[01:36:22] engineering team. Now again I do advise

[01:36:26] uh I suggest don't try and do this with

[01:36:29] me. Take take sort of uh insight for

[01:36:31] what I'm doing and as I talk you through

[01:36:33] it but then please try it later. I would

[01:36:35] love that and see whether you get the

[01:36:37] same results I get or if you're part of

[01:36:38] the unfortunate 20%. And hopefully not.

[01:36:42] All right. So the first thing I'm going

[01:36:43] to do is bring up a terminal in in

[01:36:46] cursor or in VS Code is the same with

[01:36:49] control and back tick. And then I'm

[01:36:51] going to go into the second folder

[01:36:54] and then I am going to type crew AI.

[01:36:57] This was step one of the five steps.

[01:36:59] Crew AI create crew and we're going to

[01:37:03] call our project team. It's going to be

[01:37:05] an engineering team. And we run this.

[01:37:08] And crew is now going to ask us what

[01:37:11] provider are we going to be working

[01:37:13] with. And I will select OpenAI, but you

[01:37:15] can choose whichever one you wish. And I

[01:37:17] will go with a cheap model, uh, GPT41

[01:37:20] mini, as John mentioned, to keep costs

[01:37:22] down. Uh, there's also, uh, a nano

[01:37:26] variant of this of this model, GPT41

[01:37:28] nano, which is super cheap. Uh, but

[01:37:31] unfortunately uh, it doesn't it's not it

[01:37:33] doesn't have the coherence to be able to

[01:37:35] deal with a challenge. we'll do today.

[01:37:37] So, mini is about as as cheap as you can

[01:37:39] go for this challenge. Um, okay. So, it

[01:37:43] has now uh I'm going to exit this

[01:37:45] terminal so we can see what's going on.

[01:37:47] Um, it has now set up a new folder team

[01:37:51] that's appeared here in the in the file

[01:37:53] explorer. And if I open this up, it's

[01:37:55] created a whole bunch of new folders and

[01:37:57] files for us. And I'm going into the

[01:38:00] source folder and I'm going into config.

[01:38:03] And here you'll see two YAML files as I

[01:38:05] promised you. There's one called

[01:38:07] agents.yaml and there's one called

[01:38:09] tasks.yaml.

[01:38:10] And I'm selecting agents.yaml. And up

[01:38:13] comes the the template. It writes

[01:38:16] something for you. So you can see like a

[01:38:17] default. And I hate those defaults. So

[01:38:19] I'm deleting it right away. Starting

[01:38:21] fresh. Uh so what we're now going to do

[01:38:25] is type in here our our YAML for our for

[01:38:29] our first agent. We're going to start

[01:38:31] with just one developer before we have a

[01:38:33] whole team of them. Let's start by

[01:38:34] making one coder. Uh, and I'm now going

[01:38:37] to type all of this in. Um, except Oh,

[01:38:40] hang on. Not that here.

[01:38:45] Yeah, I've set up a shortcut key so I

[01:38:47] could just paste it all in. This is this

[01:38:48] is also how I respond to LinkedIn. Uh,

[01:38:51] so here is a a a YAML example. Let me

[01:38:55] hide the left. So this is how you define

[01:38:58] in YAML an agent in crew. You give it a

[01:39:01] name backend engineer a role a python

[01:39:04] engineer who can write code to achieve

[01:39:06] requirements a goal and here is here is

[01:39:10] the goal. We want it to meet some

[01:39:12] business requirements and if you look

[01:39:13] here you'll see that there is like a tag

[01:39:16] a templated tag in curly braces called

[01:39:18] requirements. And in fact you'll see

[01:39:20] there's some others. There's one called

[01:39:21] module name and one called class name.

[01:39:24] So there's three templated tags and I

[01:39:26] want you to remember this because at the

[01:39:28] very end we're going to be able to

[01:39:30] choose what they should be. That's going

[01:39:31] to be our inputs to our crew. So this is

[01:39:34] where we've defined our three and as

[01:39:36] you'll see there's also like this

[01:39:37] backstory which gives sort of a nice

[01:39:39] background. You're a seasoned Python

[01:39:41] engineer with a knack for writing clean

[01:39:43] efficient code. Now as I say all of this

[01:39:46] crew is going to use to generate a

[01:39:48] system prompt. And again this is both

[01:39:50] the sort of the the pro and the con. The

[01:39:52] downside is that we sort of have to to

[01:39:55] conform to this way of thinking about it

[01:39:57] and we're signing up for the fact that

[01:39:59] Crew uh has an idea for a really good

[01:40:01] way to make system prompts out of these

[01:40:04] components. But the good side of it is

[01:40:06] that Crew has put a lot of work into

[01:40:07] this. They've done a lot of analysis.

[01:40:09] They've done lots of data science to

[01:40:11] figure out that this is a really

[01:40:13] effective way to have a system prompt

[01:40:15] that organizes an an AI agent. And we're

[01:40:18] taking advantage of all of that. So

[01:40:20] that's why we do it that way. And at the

[01:40:21] bottom here, we specify the LLM. And

[01:40:23] actually for this one, I'm going to use

[01:40:25] Claude 37 Sonnet latest. Uh for probably

[01:40:28] for many of us, Claude is the favorite,

[01:40:30] but particularly when it comes to

[01:40:31] coding, Claude is really great. And

[01:40:33] Claude 37, I'm getting some nods. It's

[01:40:35] it's amazing. I I I use many of them all

[01:40:37] the time, and Claude 37 always beats the

[01:40:40] others for me. So that's what we're

[01:40:41] going to use for our LLM engineer. All

[01:40:44] right, going to the tasks.

[01:40:48] All right, we uh are going to here,

[01:40:51] sorry, I'm going to delete the stuff

[01:40:53] that was already in there. And I'm going

[01:40:54] to paste in the task that we're going to

[01:40:57] have here, the coding task. Uh and uh

[01:41:01] again, it has a description. Um and here

[01:41:05] again, we've got this template

[01:41:07] requirements. It has expected output,

[01:41:10] which is where we tell it we want you to

[01:41:12] make a Python module. And you can see

[01:41:14] I've got like an important line in here.

[01:41:17] And this is the result of

[01:41:18] experimentation. Before I put in this

[01:41:20] note, uh, it tended to output something

[01:41:23] which wasn't a well-formed Python module

[01:41:25] because it included back ticks and the

[01:41:27] word Python at the top of it, which

[01:41:29] obviously broke. So I had to add this in

[01:41:32] to make it behave itself. And this is

[01:41:34] the kind of experimentation that you

[01:41:36] need to do with these agent systems.

[01:41:38] Here is where I assign this task to an

[01:41:41] agent. And of course, I'm assigning it

[01:41:43] to the very agent that we just defined.

[01:41:46] And then here is where we specify the

[01:41:48] file we want it to output to. So I'm

[01:41:51] going to save this. So now we have one

[01:41:54] agent and one task. So if you remember

[01:41:57] the next step, the third step is we have

[01:42:01] to go into a module called crew.py.

[01:42:04] And I'm deleting it comes with a whole

[01:42:06] ton of stuff that I'm deleting

[01:42:07] everything that was there. We're going

[01:42:08] to make our crew. And this is what the

[01:42:10] code looks like. It's very simple. you

[01:42:12] you tell it about the two config files

[01:42:15] that we just wrote and then you have a

[01:42:18] simple uh method for each of your agents

[01:42:21] and tasks. So in our case, we have a

[01:42:23] simple function for our agent and one

[01:42:26] for our task right here. And there's a

[01:42:29] decorator you use at agent for your

[01:42:31] agent and at task for your task. And

[01:42:34] again, you're probably getting I'm going

[01:42:35] on about this a bit, but you're getting

[01:42:36] a sense of this is this is the kind of

[01:42:39] uh framework that you have to conform

[01:42:41] to. So there's a bit of learning. You

[01:42:43] have to remember to use that decorator.

[01:42:44] And if you don't, you get a slightly

[01:42:45] obscure error which is a bit hard to

[01:42:47] track down. So it's again, it's the big

[01:42:49] benefit. You get a lot in the box, but

[01:42:51] you have to follow these this this this

[01:42:53] recipe to make sure that your crew works

[01:42:55] well. So for this agent, I'm I'm uh

[01:42:58] telling it to look up the the config for

[01:43:00] backend engineer we just wrote. And look

[01:43:02] here. Look at this. These two lines are

[01:43:05] the two lines that mean that this agent

[01:43:07] is going to be able to write code, run

[01:43:09] it in a Docker container and look at the

[01:43:11] results. We say allow code execution and

[01:43:14] do it safely in Docker. And that's it.

[01:43:16] And that has defined our agent and our

[01:43:19] task. And here is our crew. Uh we we

[01:43:22] have a bunch of agents and tasks. And

[01:43:24] here we're saying we want this to work

[01:43:26] in a sequential way, not in a

[01:43:28] hierarchical way. I'm going to change

[01:43:30] the maximum execution time to be a bit

[01:43:32] longer.

[01:43:34] And the the the fourth step is the

[01:43:37] main.py.

[01:43:39] And I'm going to uh paste in the code

[01:43:43] here. And main.py has a run

[01:43:47] uh method in it. And run takes some

[01:43:50] inputs. We have to set up a little

[01:43:52] dictionary of inputs. And these here, I

[01:43:54] hope you recognize them. These are the

[01:43:56] three template tags that we had put in

[01:43:59] the YAML. This is where we're specifying

[01:44:00] the business requirements, the module

[01:44:02] name, and the class name. And then this

[01:44:05] is where it comes together. We say we

[01:44:07] want our team, we want the crew, we want

[01:44:09] to kick it off, passing in our inputs,

[01:44:11] and that will then kick off our crew.

[01:44:15] So, and I should say all of this code,

[01:44:17] of course, is in the repo as well. Uh,

[01:44:20] so this what you're hopefully thinking

[01:44:22] is, okay, so what are the business

[01:44:23] requirements? What are we going to ask

[01:44:24] this thing to build? Uh, I'm going to

[01:44:26] kick it off and then and then I'll show

[01:44:28] you the business requirements. So, let's

[01:44:29] kick it off and then we're going to go

[01:44:30] for lunch just as we get to to to 12:30.

[01:44:34] Uh, so let me bring up terminal.

[01:44:38] I'm going to go into that directory. I'm

[01:44:40] going to go into the team directory and

[01:44:43] hopefully you remember that that fifth

[01:44:45] step, the final step is I just type crew

[01:44:47] AI run

[01:44:50] and it should just run and we will see

[01:44:53] it does some installation

[01:44:58] building the team.

[01:45:02] It's installing some packages. Now,

[01:45:04] while it's doing that, I'm going to

[01:45:05] scroll up and I'm going to tell you the

[01:45:06] business requirements. So, we're going

[01:45:08] to ask our crew or right now our single

[01:45:12] developer to build a simple account

[01:45:14] management system for a trading

[01:45:17] simulation platform. The system should

[01:45:20] let users create an account, deposit

[01:45:22] funds, withdraw them. It should allow

[01:45:24] them to record that they've bought or

[01:45:26] sold shares. It should be able to

[01:45:28] calculate the the value of the

[01:45:29] portfolio, the profit and loss, list the

[01:45:31] transactions, and it should have some

[01:45:33] error checking. It should prevent users

[01:45:35] from withdrawing money they don't have

[01:45:37] or selling shares that they don't have

[01:45:38] or buying shares that they can't afford.

[01:45:41] All of those checks should be written

[01:45:42] there in the code and that is what we

[01:45:45] are assigning to our agent. And here it

[01:45:48] is. It's already it's thinking and

[01:45:50] you'll see somewhere if we look higher

[01:45:51] up that it has it is using a code

[01:45:53] interpreter tool and it has started to

[01:45:55] run code in a docker environment. Our

[01:46:00] Python engineer is busy working and is

[01:46:03] going to be coding away. And we're going

[01:46:05] to leave our Python engineer coding

[01:46:07] while we go off and enjoy a fine lunch.

[01:46:11] [Applause]

[01:46:20] Okay, everybody, if I could get your

[01:46:21] attention, please. This time is what's

[01:46:24] known professionally in the industry as

[01:46:27] the death slot.

[01:46:29] This This is the after lunch slot. I I

[01:46:32] have rolled up my sleeves because this

[01:46:34] is going to be sleeves rolled up, hands

[01:46:37] on time. I'm going to compensate for the

[01:46:40] death slots by being even higher energy

[01:46:42] than usual. Uh and hopefully keep

[01:46:45] everyone excited.

[01:46:49] All right. But while you were out

[01:46:53] feasting on a delicious lunch, we had an

[01:46:56] agent working hard on writing some

[01:46:58] software. And the question is, was it

[01:47:00] successful? And as I told you, this is

[01:47:02] this is something which is not certain.

[01:47:05] There is a level of risk associated with

[01:47:07] these kinds of systems. So we shall now

[01:47:09] find out together uh whether or not it

[01:47:12] was successful. Uh let's have a look.

[01:47:15] This is us back in cursor and what we'll

[01:47:19] see if I just close this here we will

[01:47:24] see that there is a folder output that

[01:47:27] has been created in our folder called

[01:47:29] team and if I expand output there is in

[01:47:33] fact a python module called accounts.py

[01:47:35] pi that is sitting there. And if I open

[01:47:38] this and I just close the window down

[01:47:40] here that's in our way,

[01:47:42] you will see that there is a ton of

[01:47:45] Python code in here. Uh and uh it's got

[01:47:49] comments and it's got type hints, which

[01:47:51] is a good way to know that I didn't do

[01:47:53] it. Uh it's been written by someone

[01:47:54] that's a much better coder than me. Uh

[01:47:57] so what you'll see here is something

[01:47:59] that look at look at how much code is

[01:48:00] written. All of this and you'll see

[01:48:02] there are methods like print holdings

[01:48:04] report, get holdings, print transaction

[01:48:06] history. It's basically everything that

[01:48:09] we asked for in our spec has been built

[01:48:12] by our agent. So that's pretty cool, but

[01:48:16] I want to take it further. I think it

[01:48:18] would be more interesting if we put

[01:48:20] together a team to build this rather

[01:48:23] than just our lone developer. And if we

[01:48:25] included a user interface and a tester

[01:48:28] to be testing it as well so that we

[01:48:30] don't just look at Python code but we

[01:48:32] actually get to see a result. So that is

[01:48:35] going to be the next step. That's what

[01:48:36] we're going to do now. It was able to

[01:48:37] code but can actually build an

[01:48:39] application. Let's see. All right. And

[01:48:43] again this all of this code is in a in

[01:48:45] the folder number two engineering team.

[01:48:48] And you will find there's already a

[01:48:50] folder in there called engineering team

[01:48:52] that has the complete solution as as I

[01:48:54] coded it and as I ran it. But you could

[01:48:56] also replicate what I'm doing and do it

[01:48:58] yourself uh if you want to see it work.

[01:49:02] So we're going back. You remember that

[01:49:03] there the two YAML files. A quick

[01:49:05] revision. There's the agents.yamel, the

[01:49:07] task.yaml. We're going back to this file

[01:49:09] again. This is where we defined our

[01:49:10] backend engineer. And I'm going to

[01:49:12] delete that again. We're going to uh

[01:49:15] write some new code. And here it is. I

[01:49:17] typed it fast. Uh we now have uh these

[01:49:21] different agents. We have an engineering

[01:49:23] lead. The engineering lead is is

[01:49:27] something that can can review

[01:49:28] requirements and produce a detailed

[01:49:31] design and write that to a design

[01:49:34] document and it's going to use GPT40.

[01:49:36] We're going to mix it up and have a few

[01:49:38] different models. Here we're going to

[01:49:39] have a backend engineer. The backend

[01:49:42] engineer is the same one as before. This

[01:49:43] is exactly the same same person we had

[01:49:45] before except there is a difference.

[01:49:47] It's going to expect to receive a design

[01:49:49] document. We're going to have a

[01:49:51] front-end engineer and when I say front

[01:49:53] end, it's going to build a Gradio app

[01:49:55] because I love Gradio. That's the way to

[01:49:56] do it. So, we're going to try and have

[01:49:58] it build a Gradio app. And we're going

[01:49:59] to have a test engineer, a Python

[01:50:02] engineer who is able to write unit tests

[01:50:05] and and then uh use those unit tests to

[01:50:08] test the product. So, these are our four

[01:50:12] agents. And now I'm going to make some

[01:50:14] tasks. Let's bring back this. Make sure

[01:50:17] I saved it. Bring up tasks.yaml.

[01:50:20] Delete what we had there before. And put

[01:50:22] in something new in here. Um, there we

[01:50:26] go. So, again, this is a fairly simple

[01:50:29] example. We've got four tasks and each

[01:50:32] task maps to one agent. And it doesn't

[01:50:35] need to be this way. You can have

[01:50:36] multiple tasks assigned to one agent.

[01:50:38] You can have more complicated setups,

[01:50:40] but this is a very common and simple way

[01:50:42] of organizing it. So, four tasks, one

[01:50:45] task assigned to each agent. The design

[01:50:47] agent gets a design task. It says that

[01:50:50] it needs to produce a design document

[01:50:52] and it needs to output that design

[01:50:54] document. It's assigned to the

[01:50:55] engineering lead and it needs to be

[01:50:57] called design.

[01:50:59] It's going to be in markdown. Okay. Now,

[01:51:03] this code task is the task we're

[01:51:05] assigning to our developer agent. And

[01:51:07] there's going to be something different

[01:51:08] here and it's super important. We are

[01:51:11] adding this here. We are saying that

[01:51:14] this task requires some context. It

[01:51:17] requires the output from the design

[01:51:20] task. So whatever comes out of the

[01:51:22] design task is going to be provided as

[01:51:25] context to carry out the code task. And

[01:51:28] this has now introduced a relationship

[01:51:30] between these tasks. And crew will take

[01:51:33] care of all of that for us. We don't

[01:51:35] need to write any code to deal with that

[01:51:37] that context. It will come out of the

[01:51:39] box. That is that is the batteries

[01:51:41] included part of crew. All right. So far

[01:51:44] with me a front-end task. So this is

[01:51:47] going to build a front end uh and it's

[01:51:50] going to do it based on the backend code

[01:51:53] that was written. And so you can see

[01:51:55] what's happening here. Again, I'm using

[01:51:57] context. And this time I'm saying that

[01:51:59] for the front-end developer, the context

[01:52:01] is the backend code because it's going

[01:52:03] to write a UI to bring that to life and

[01:52:06] it's going to output it to app.py.

[01:52:09] And then finally, the test task which is

[01:52:11] going to write unit tests and output

[01:52:13] them. And now actually in the break uh

[01:52:17] Robert was talking to me and pointed out

[01:52:19] that that a cooler way of doing this

[01:52:20] that I should have thought of would be

[01:52:22] to use testdriven development and have

[01:52:24] it write the tests first and then have

[01:52:27] the backend developer write the back end

[01:52:29] that meets those tests. And that's a

[01:52:31] really great idea. And if someone wants

[01:52:32] to try and change change it around to do

[01:52:34] that, I would love to see that. That

[01:52:35] would be a cool exercise. I bet it would

[01:52:37] work great. Uh we've got a bit of that

[01:52:39] going on because the design document is

[01:52:41] written up front, but this would be even

[01:52:43] better. So that's a an exercise.

[01:52:46] All right. So with that, we now go to

[01:52:49] our crew module. Here it is. We're going

[01:52:52] to rewrite this. And there is our code

[01:52:56] for our crew module. It's very similar

[01:52:58] to before. It just has these agent

[01:53:02] methods for each of our four agents. And

[01:53:05] then the same for each of the tasks.

[01:53:07] You'll see again we're just using this

[01:53:09] code execution. I'm going to give it

[01:53:11] some more time so that it doesn't time

[01:53:12] out. And if you're following along in

[01:53:15] the code, you might need to change this

[01:53:16] as well. I discovered when I did a trial

[01:53:19] run yesterday that it timed out. So, so

[01:53:21] 500 is a is a better number. Let it run

[01:53:24] for a few minutes. Uh, so that is our

[01:53:27] crew module. And now you'll remember the

[01:53:30] main module. The main module is where we

[01:53:32] we give it the business requirements and

[01:53:33] we kick it off. And the cool thing is

[01:53:35] that we don't need to change this at

[01:53:36] all. Exactly the same main module that

[01:53:39] we used for our single loan engineer. We

[01:53:42] can use the identical one now. No

[01:53:44] changes at all. This as it stands right

[01:53:46] now with team.crew.kickoff

[01:53:49] passing in our business requirements is

[01:53:52] exactly what we need.

[01:53:54] So that is now an engineering team of

[01:53:58] our four agents. And now we're just

[01:54:00] going to see whether out of the box this

[01:54:02] just works. Uh, and so I'll come back

[01:54:05] here to the uh, terminal.

[01:54:08] Uh, actually I think I'll give myself a

[01:54:10] new terminal window. Hold on.

[01:54:13] There we go.

[01:54:15] We'll go into the second directory.

[01:54:17] We'll go into team, which is the the

[01:54:19] directory, the project we just built,

[01:54:20] and we type out that fifth step, the

[01:54:22] command to launch our crew, which is

[01:54:25] crew AI run. And this is now going to

[01:54:29] run our whole crew. Now, the first thing

[01:54:32] it's going to do is it's going to write

[01:54:34] a design document. And so, what we're

[01:54:36] hoping to see is that in this output

[01:54:38] directory, we're going to find shortly

[01:54:41] that the the what's currently there, the

[01:54:43] old Python code, is going to be joined.

[01:54:45] There we go. Did you see that? It's been

[01:54:47] joined by a design document. Let's open

[01:54:50] this document up and see it in preview.

[01:54:52] Here it is. It's a design document that

[01:54:54] describes what's to go in our module and

[01:54:57] it gives the method signatures and the

[01:55:00] dependencies and uh it's all laid out

[01:55:02] here for our back-end developer to work

[01:55:05] on. And that's that's pretty fun. Now,

[01:55:08] what I'm actually going to do now is

[01:55:10] what I warned you that I was going to do

[01:55:12] at the start. I'm going to do the the

[01:55:14] the baking maneuver when I'm going to

[01:55:16] say we've put this in the oven, but I

[01:55:19] ran this earlier because it does take

[01:55:21] about 5 minutes and I I ran it earlier,

[01:55:23] but I but I do assure you that this is

[01:55:25] legit. I really did run it earlier. And

[01:55:27] if any of you doubt me, then you should

[01:55:29] run it yourself and you will see that

[01:55:30] it's going to do what I something

[01:55:32] similar to what I do, although it's it's

[01:55:34] a bit different every single time. Uh

[01:55:36] and it doesn't always work. It's about

[01:55:38] 90%. So uh I uh yeah you should

[01:55:41] definitely try and check that you are

[01:55:42] part of the uh of the the good runs but

[01:55:46] I have already put the output in there

[01:55:48] and I'm going to show you what it comes

[01:55:49] up with right now. Let's have a new

[01:55:52] terminal window.

[01:55:56] So I put the output in a folder which I

[01:55:58] also checked into to get so you can see

[01:56:01] this yourself and it's just called

[01:56:03] output and you'll see in output there is

[01:56:05] a Python file there is the same design

[01:56:07] document and there is an app.py and

[01:56:10] there is a test accounts.py. So I'm

[01:56:14] going to go in now to that folder

[01:56:18] and go into output

[01:56:21] and now I am going to run app.py.

[01:56:25] So this is running the user interface

[01:56:28] for that account management application

[01:56:30] that we wrote. And I haven't touched a

[01:56:32] line of this code. This code came

[01:56:34] straight out of the agents. Let's see

[01:56:36] what it does.

[01:56:38] So it's running Gradio. So I press shift

[01:56:41] click here to bring it up. So here we

[01:56:42] go. This is a user interface. This

[01:56:44] screen that you're looking at here was

[01:56:46] built by our agents. So you'll see right

[01:56:49] away it's got a create account section.

[01:56:52] So, I can say like one, two, three. Put

[01:56:54] in an initial deposit of $1,000 and

[01:56:56] press create account.

[01:56:58] And I press that. And it says down here,

[01:57:00] I'm going to zoom out a little bit. It

[01:57:02] says account created for 123 with

[01:57:04] initial deposit. And it's got some more

[01:57:06] information down below. You'll also see

[01:57:09] there are two tabs up here. There's a

[01:57:12] trading tab and a reports tab. So, I can

[01:57:15] go to the trading tab and I can say,

[01:57:17] "All right, I would like to buy one

[01:57:19] share of Apple.

[01:57:21] buy. And it says, "Successfully bought

[01:57:23] one share of Apple at $150." And this is

[01:57:26] my account information and my holdings

[01:57:28] down here.

[01:57:30] I hope you're as amazed by this as I am.

[01:57:32] It's incredible.

[01:57:34] And then, so I'm now going to buy a

[01:57:36] share of Tesla stock. Tesla. It's not

[01:57:39] really buying share of Tesla, but I'm

[01:57:41] going to buy a share of Tesla stock. And

[01:57:43] here we go. Bought a share of Tesla at

[01:57:45] $800. And there we go. You can see that

[01:57:49] it's that it's got the holdings down

[01:57:50] there. Okay. I'm now going to come in

[01:57:54] and I'm going to say I'm going to try

[01:57:55] and sell three shares of Tesla. I do

[01:57:59] that and it says error insufficient

[01:58:01] shares to sell. So, just as we asked it,

[01:58:03] it checks if you've got the shares to

[01:58:05] sell before you do so. And I'm going to

[01:58:07] try and buy 10 shares of Tesla and it's

[01:58:10] going to say error insufficient funds to

[01:58:12] buy shares.

[01:58:14] And now I'm going to go to the reports

[01:58:16] tab and I'm going to press portfolio

[01:58:19] view. And it it gives us that profit and

[01:58:21] loss, current holdings, and transaction

[01:58:24] history. And it's showing us all of this

[01:58:26] information about our portfolio.

[01:58:29] And I got to tell you, I think this is

[01:58:30] absolutely extraordinary. It's

[01:58:32] incredible. This was built the whole

[01:58:34] thing. I didn't touch a line of code.

[01:58:36] the business logic, the the uh front

[01:58:39] end, this user interface with these

[01:58:41] different tabs and the test code was

[01:58:43] written by a team of agents working

[01:58:46] autonomously on their own and generating

[01:58:48] this and I did nothing. And I I can

[01:58:50] believe like as a project manager, I've

[01:58:53] asked engineers to build something like

[01:58:55] this and it's the sort of thing that

[01:58:56] maybe they they turn around in a day and

[01:58:58] you'd come back at the end of the day

[01:58:59] and and it would be done and you'd say

[01:59:01] great that's that's what I asked for.

[01:59:03] This this takes about 5 minutes. takes

[01:59:05] about five minutes and you just leave it

[01:59:07] running. You come back and it's done.

[01:59:09] So, I find this absolutely dramatic. Uh

[01:59:12] and uh and I hope you do too and and you

[01:59:14] should run this yourself. And the the

[01:59:16] final little thing I'll leave you with,

[01:59:17] which is also spectacular, is that every

[01:59:20] time that I run this, I get a slightly

[01:59:22] different user interface. Sometimes

[01:59:24] there aren't three tabs. Uh one I did

[01:59:26] last night when I was testing this just

[01:59:28] had two or one time it did everything on

[01:59:30] one big screen. Sometimes they have

[01:59:32] different types of checks and different

[01:59:33] UI widgets. So it's it's really

[01:59:36] interesting that there is something it

[01:59:37] is kind of choosing its own adventure.

[01:59:39] There is the real autonomy that you see

[01:59:42] uh happening there.

[01:59:44] So again I urge you to try this for

[01:59:47] yourself. See it come to life. Yes. A

[01:59:50] question. What the test? So the test

[01:59:53] wrote Python unit tests in test

[01:59:57] for sure. Let's have a look. Uh uh uh

[02:00:02] it would be under

[02:00:05] Not here. What's the percentage? We

[02:00:07] could have had an agent to come up with

[02:00:09] that. Here it is. Test accounts.py. So,

[02:00:11] and this is also checked into git so you

[02:00:13] can see it yourself. Uh, hang on.

[02:00:17] Let me just close this window here.

[02:00:19] There we go. So, this is the code

[02:00:20] written by the tester agent.

[02:00:28] Yeah, I imagine it was just the standard

[02:00:29] unit test. Yeah, the standard pi not not

[02:00:31] piest. Uh the question was which unit

[02:00:34] test library did it use? It picked just

[02:00:35] just uh uh the the standard unit test.

[02:00:39] So there you go. And check this code

[02:00:41] out. It is checked into uh to to the

[02:00:43] source code as well. It's a great

[02:00:45] question. So for a project like this,

[02:00:46] would I recommend OpenAI agents SDK or

[02:00:50] Crew AI? And it's going to be a typical

[02:00:53] answer to these things, so don't hate

[02:00:54] me, but it's it depends. Uh, and it is

[02:00:58] it's very much a matter of preference.

[02:01:00] With Crew AI, you get a lot that comes

[02:01:04] in the package in the sort of batteries

[02:01:07] included uh mindset. It was so quick to

[02:01:10] build that. Like this whole uh project,

[02:01:12] it was about uh 10 15 minutes worth of

[02:01:15] of working. It's really quick to get up

[02:01:17] and running. Now, I will admit that when

[02:01:20] I first did this, I made a couple of

[02:01:22] mistakes. Um, one of the mistakes I made

[02:01:24] was that when I was writing the task

[02:01:26] YAML, I had a typo that wasn't exactly

[02:01:29] the same as the YAML file in the agents

[02:01:31] code and it failed and it had like a

[02:01:33] stack trace that wasn't immediately

[02:01:35] obvious what was going on and it took me

[02:01:37] a while uh to figure out that's what it

[02:01:39] was and and and then it was easy and of

[02:01:41] course now I'll know if I ever see that

[02:01:43] again what's going on. So you get a lot

[02:01:46] uh that comes in the package with with

[02:01:49] crew but you are you are using a more

[02:01:52] opinionated framework which has some

[02:01:54] negatives as well and if you feel more

[02:01:56] comfortable with a more lightweight

[02:01:58] framework you have to put some more work

[02:02:00] into it but you have a lot more control

[02:02:02] finer grain control over exactly what's

[02:02:04] happening um and we were just actually

[02:02:06] talking about that if you wanted to be

[02:02:08] able to debug the Python code it was

[02:02:09] making while it was doing it then if you

[02:02:12] used OpenAI agents SDK you'd have a lot

[02:02:14] flexibility to build in that kind of

[02:02:16] functionality. Uh so it's a trade-off

[02:02:18] and a personal decision. Um hi, I had a

[02:02:22] question. Um if I used an agentic

[02:02:24] framework like Langraph to do this, I

[02:02:27] would be defining the nodes um as the

[02:02:30] agents and specific edges to kind of

[02:02:33] define the flow of execution between the

[02:02:35] different agents that I want the

[02:02:36] engineering lead to agent to first

[02:02:38] compute and then flow down to the

[02:02:40] backend engineer. So over here, how does

[02:02:43] crew AI know what the flow should be

[02:02:46] without specific edges?

[02:02:49] Yes. So it's a bit more simplistic with

[02:02:51] crew than it is with with a langraph or

[02:02:53] or Google ADK. The um you do explicitly

[02:02:58] assign each task to an agent. Um and

[02:03:02] then um you get to pick two different

[02:03:05] modes, the sequential mode or the

[02:03:07] hierarchical mode. And if you pick the

[02:03:09] sequential mode, then it literally uh

[02:03:12] runs each task one after another in the

[02:03:15] order that they're laid out. But if one

[02:03:18] of your tasks says that it's input, it

[02:03:20] requires context from another task, then

[02:03:23] it won't start that until all of the

[02:03:25] context has been satisfied. So it will

[02:03:27] go through in order, make sure that it's

[02:03:29] run any prerequisites, and then it will

[02:03:32] run your task. So it's a reasonably

[02:03:34] simple sequential process. If you choose

[02:03:37] the hierarchical process, then you have

[02:03:39] to also choose a manager that can be an

[02:03:42] LLM or it can be an agent and then it

[02:03:45] delegates to an LLM to decide which task

[02:03:48] to run in what order and then you have

[02:03:50] to to sort of use prompting to to to

[02:03:52] figure that out. Um, so those are the

[02:03:54] two techniques and it doesn't have quite

[02:03:57] the same level of flexibility as like a

[02:03:59] LAN graph where you can really map out

[02:04:01] your whole dependency tree and have it

[02:04:03] be something that's uh where where where

[02:04:05] that is really flexible. Thank you. You

[02:04:08] had mentioned that each time that you

[02:04:09] run the the prompt that we just saw that

[02:04:12] you have a slightly different flavor to

[02:04:14] the guey and I was wondering with each

[02:04:17] of those iterations were you using the

[02:04:19] same exact prompt letter for letter?

[02:04:22] Yep, I was. uh and you can too like if

[02:04:24] you run it twice just from the code you

[02:04:26] you'll get different answers. Now of

[02:04:27] course you you probably know this but

[02:04:29] when you're calling an LLM you can

[02:04:31] actually set the seed you can pass in a

[02:04:34] random seed that's used to make an LM

[02:04:36] behave in a more deterministic way. If

[02:04:39] you set a random seed and people

[02:04:42] traditionally always set it to 42 as a

[02:04:44] as a nod to to Douglas Adams. uh you set

[02:04:47] a random seed and you also set the

[02:04:49] temperature to zero, then you uh in

[02:04:52] theory will always get the same output,

[02:04:54] but it's not guaranteed. Uh it's just

[02:04:56] that the the provider will do their very

[02:04:58] best to try to to always uh give the

[02:05:01] same output tokens given some input

[02:05:03] tokens. But the the whole process of of

[02:05:06] uh running an LM has some uncertainty.

[02:05:09] uh for a start you're running some

[02:05:11] processes uh in a sort of very

[02:05:13] distributed way and things can run in

[02:05:15] different sequence when they're running

[02:05:16] on the GPU in in a in a big distributed

[02:05:18] setup. Um but there's also probabilities

[02:05:20] involved. If you have a temperature then

[02:05:22] it's it's sampling the output tokens

[02:05:24] from a distribution. So you could get a

[02:05:26] different a different output each time.

[02:05:29] Um, so yeah, the the short answer is you

[02:05:32] you can use random seed and temperature

[02:05:35] of zero to almost guarantee that you get

[02:05:38] the same UI every time, but otherwise

[02:05:40] you should expect differences. In this

[02:05:42] example, we see it kind of from the

[02:05:43] beginning, you know, a uh proof of

[02:05:45] concept uh use case that's being

[02:05:47] implemented.

[02:05:49] Could you talk a little bit about the

[02:05:50] experience of taking an existing project

[02:05:52] and how this might be implemented in

[02:05:53] that going forward? It's a great

[02:05:55] question and I would say that agentic AI

[02:05:58] is a bit of a brave new world that a lot

[02:06:01] of these things are happening for the

[02:06:02] first time. So I'm not sure that there's

[02:06:04] yet like a a a clear order of play. The

[02:06:08] the thing that I would always stress to

[02:06:10] people is uh starting small. So if you

[02:06:13] have an existing system and you want to

[02:06:15] try and introduce agentic elements uh

[02:06:17] certainly from from my experience

[02:06:20] starting by not being too ambitious but

[02:06:22] choose a very narrowly defined very

[02:06:25] clear part of the process where you

[02:06:27] think there's a compelling benefit to

[02:06:29] using agentic AI find a way to evaluate

[02:06:32] that benefit like have a metric that

[02:06:34] you're looking to improve and then build

[02:06:36] an agentic solution that just tackles

[02:06:38] that very narrowly defined uh part of

[02:06:41] your problem and can demonst demonstrate

[02:06:43] performance improvement and commercial

[02:06:45] improvement through that. And then when

[02:06:47] that's being successful, you can

[02:06:49] gradually start to extend the solution,

[02:06:51] have more uh flexibility, um add add

[02:06:54] more agents and and perhaps take take

[02:06:56] more risks. All righty. So module one on

[02:07:00] defining agents and getting used to the

[02:07:02] OpenAI agents SDK as well as now module

[02:07:06] two on designing agents and getting a

[02:07:09] whole remarkable engineering team with

[02:07:12] Crew AI going on whatever engineering

[02:07:14] task you want. Both of those modules are

[02:07:16] in our rearview mirror. And so now it's

[02:07:20] time for the third module on developing

[02:07:23] agents. And who's excited about MCP?

[02:07:26] That's like one of the hottest topics

[02:07:28] right now. Yes, we have lots of hands

[02:07:31] and some actual cheers which is nice.

[02:07:34] So MCP very very cool library right now.

[02:07:38] Let's get into it and then I'm not going

[02:07:40] to be up here very long. I'm just going

[02:07:42] to give a a bit of theory around how MCP

[02:07:44] works and then Ed will show you hands-on

[02:07:46] and we'll take advantage of our crew of

[02:07:49] engineers to build some autonomous

[02:07:52] traders with MCP. So MCP stands for

[02:07:56] model context protocol. It is most

[02:07:59] commonly described by in seemingly every

[02:08:01] blog post that you find about MCP

[02:08:04] describes it as the USBC

[02:08:06] for agentic applications. And you will

[02:08:10] notice that due to hallucinations and

[02:08:14] errors, the Gen AI model that created

[02:08:17] this pop art uh has a USBA cable.

[02:08:24] Uh MCP is nothing like USBA.

[02:08:28] It is only like USBC.

[02:08:31] All right. So, uh what is MCP not? Let's

[02:08:34] get some things out of the way. I

[02:08:36] mentioned this earlier when I had that

[02:08:37] slide with the six blocks of frameworks

[02:08:40] and things like frameworks and I said

[02:08:42] then that MCP is actually not a

[02:08:45] framework for building agents.

[02:08:48] It is not a big fundamental change to

[02:08:51] how agents work and it's not even a way

[02:08:55] to code agents. So then why is it so

[02:08:58] exciting? Why does everyone want to

[02:08:59] learn about it? Well, it's because it is

[02:09:02] a protocol. It's a standard like USBC

[02:09:06] that tells you how you should uh set up

[02:09:10] some communication uh in a standardized

[02:09:12] way that makes it very easy

[02:09:14] plug-and-play USBC to connect to lots of

[02:09:17] different uh agentic tools that you

[02:09:19] might like for example. Yeah. So, it's a

[02:09:21] simple way to integrate tools,

[02:09:23] resources, prompts all under the same

[02:09:25] protocol. Yeah. And so, there we go.

[02:09:27] There's that quote again. USBC port for

[02:09:29] AI applications. And so lots of people

[02:09:33] here are excited. Maybe you shouldn't

[02:09:35] be. Uh there's reasons not to be

[02:09:38] excited. So MCP is just a standard. It's

[02:09:42] not the tools themselves. The tools

[02:09:44] themselves are what really do the work.

[02:09:46] So maybe that should be exciting. Lang

[02:09:49] Chain actually already has a big tools

[02:09:51] ecosystem itself. And we already showed

[02:09:55] you, Ed already showed you earlier in

[02:09:56] today's training how you can take any

[02:09:58] function, add a decorator, and turn it

[02:09:59] into a tool. But of course there are

[02:10:02] reasons to be excited. Uh and this kind

[02:10:06] of follows on exactly I had a hard time

[02:10:07] not even just saying it out loud when I

[02:10:09] made the first bullet here about how

[02:10:10] it's not a it's it's just a standard.

[02:10:12] It's not the tools themselves. But the

[02:10:14] key thing here is that it means that now

[02:10:16] all tools become extremely fast and easy

[02:10:20] frictionless to integrate and it's

[02:10:23] taking off. So yeah, Langchain may

[02:10:24] already have a big tools ecosystem, but

[02:10:27] MCP is surely going to overtake it if it

[02:10:30] hasn't already. So I've got a chart here

[02:10:32] of GitHub stars over time from

[02:10:35] star-enhistory.com,

[02:10:38] which has lots of GitHub star charts if

[02:10:40] that's what you're into. And shown here

[02:10:43] in red is MCP. Also perhaps of interest

[02:10:47] is crew is the teal blue running over

[02:10:50] the top. So crew also obviously taking

[02:10:52] off though kind of more more linearly

[02:10:56] whereas there's this crazy uh MCP line

[02:11:00] hockey sticking upwards. Who knows how

[02:11:03] high that'll go. Bye bye now.

[02:11:07] And uh yeah and similarly this is a

[02:11:10] point that I mean all these points are

[02:11:12] really points that Ed makes uh and I am

[02:11:14] borrowing but uh he makes a great point

[02:11:17] here that HTML likewise was only a

[02:11:20] standard yet it is now ubiquitous. It's

[02:11:25] almost like the currency of everything

[02:11:27] that that flows flows to us over the

[02:11:30] internet. So uh MCP could similarly be

[02:11:33] uh that kind of equivalently ubiquitous

[02:11:36] standard for the agentic world that we

[02:11:38] are now entering into. Core concepts of

[02:11:40] MCP. Um so I'm going to move a little

[02:11:43] bit slower on this because we're getting

[02:11:44] into definitions. The last slides were

[02:11:46] all kind of fun. These are a bit more

[02:11:48] serious. Uh and we have some key terms

[02:11:50] here. So the there are three key

[02:11:53] components to uh to MCP. The first one

[02:11:57] is something called a host. And so you

[02:11:59] hear this word host so much in computer

[02:12:02] science and connectivity. And so in this

[02:12:05] case to concretely define this, the host

[02:12:08] is an app. And so it's an application

[02:12:12] that is something like if you have

[02:12:14] clawed desktop on your laptop, you can

[02:12:17] run MCP from that. So you can use that

[02:12:21] as your host. Um you could also use

[02:12:23] cursor as your host. That's that

[02:12:26] software application. Um, critically,

[02:12:29] you can't use Claude on the web. Like,

[02:12:31] if you go to claude.ai, that isn't uh a

[02:12:35] host. You can't use that as a host, at

[02:12:36] least not at the time of me standing up

[02:12:38] here. Uh, but the Claude desktop app

[02:12:40] will allow you to do that. You can also

[02:12:42] have your agent architecture be the

[02:12:45] host. So, hopefully that's relatively

[02:12:47] clear. I have some charts coming up that

[02:12:49] will also explain how these terms

[02:12:52] connect to each other. The second key

[02:12:54] component is the MCP client. And so the

[02:12:57] MCP client lives inside of the host. So

[02:13:00] the host is an application and it hosts

[02:13:04] MCP clients. And so a key thing here is

[02:13:08] that it connects one to one with an MCP

[02:13:13] server. So for every MCP server that you

[02:13:16] have, I'm going to get to what that is

[02:13:17] in a second, but the server is basically

[02:13:18] what's actually providing what's

[02:13:20] actually doing the tool use or or

[02:13:22] providing a connection to the database.

[02:13:25] um that yeah the MCP tur server provides

[02:13:28] tools context and prompts and for every

[02:13:31] MCP server that you connect to you must

[02:13:34] have also an MCP client running inside

[02:13:37] your host and so it's a simple onetoone

[02:13:40] identification and um so basically these

[02:13:43] MCP servers they have all kinds of

[02:13:45] abilities and you're like wow I would

[02:13:47] love to have that ability for my agent

[02:13:50] to be able to call on that ability okay

[02:13:52] this MCP server does that I'll spin up

[02:13:55] an MCP client corresponding to that

[02:13:57] server inside of my host that's already

[02:13:59] running. As a concrete example, Google

[02:14:02] Maps is an MP is an MCP server with

[02:14:05] geoloccation tools. And I thought

[02:14:06] there'd be no better way to understand

[02:14:09] that easily than to bring up the GitHub

[02:14:13] repo. So we're here in the GitHub MCP

[02:14:16] model context pro protocol repo um or

[02:14:20] account I suppose. And then in there

[02:14:22] there are lots of different repos uh put

[02:14:26] there by tons of different people from

[02:14:27] all over the world and it's growing all

[02:14:29] the time. And so as an example, I'll

[02:14:32] zoom in here a little bit.

[02:14:34] If you have uh the Google Maps MCP

[02:14:37] server running, you can use the maps

[02:14:40] geocode tool to convert an address into

[02:14:43] a coordinate or the reverse uh a reverse

[02:14:46] geocode uh converting a coordinate into

[02:14:49] an address and all the kinds of other

[02:14:51] things that you might imagine uh Google

[02:14:53] Maps might allow you to do, even

[02:14:55] directions between two points. So that

[02:15:00] hopefully gives you a sense of a

[02:15:01] specific MCP server and the kinds of

[02:15:04] tools that you might want to have access

[02:15:06] to as a result of being able to access

[02:15:08] that server. So in this example, you

[02:15:11] have Google Maps on an MCP server with

[02:15:14] the geoloccation tools that you want for

[02:15:16] your agent to be able to to access. You

[02:15:19] can configure then say claw desktop to

[02:15:22] be the host to run an MCP client that

[02:15:26] corresponds to the Google Maps MCP

[02:15:29] server and that launches the Google Maps

[02:15:31] MCP server say on your computer. Now uh

[02:15:37] that might those final three words on

[02:15:40] your computer might have surprised you

[02:15:42] because server sounds like something

[02:15:44] remote. Um, and there's different

[02:15:47] options. So, let's talk about

[02:15:49] architecture. So, on your computer,

[02:15:53] you

[02:15:55] have this host running. Let's say this

[02:15:56] is the clawed desktop app or this could

[02:15:59] be cursor. And let's say we have two MCP

[02:16:04] servers running also on our computer

[02:16:07] that we want to be able to have access

[02:16:09] to. So we can pretend that this one here

[02:16:11] in the bottom right corner is Google

[02:16:14] Maps, the Google Maps MCP server. And

[02:16:16] the one on the left is accessing your

[02:16:18] local file system. So in this case, we

[02:16:22] happened to have both of these MCP

[02:16:24] servers. We spun them up. We ran them on

[02:16:27] our own computer. So that's an option

[02:16:28] for you. And I'm going to talk about the

[02:16:29] different options in a moment. Remember

[02:16:31] from the preceding slide that for every

[02:16:33] MCP server, we must have a corresponding

[02:16:36] MCP client running inside of our host.

[02:16:38] So for the Google Maps MCP server, I

[02:16:41] have my Google Maps MCP client

[02:16:43] corresponding to it. For the MCP server

[02:16:45] that's accessing my local file system, I

[02:16:47] have an MCP client for that as well. And

[02:16:51] they are connected by MCP by the

[02:16:55] protocol. So the white arrows are really

[02:16:59] what MCP is. That's this is the protocol

[02:17:02] that makes it easy for the client to

[02:17:04] speak to the server um to have this

[02:17:06] painless way of connecting um to any

[02:17:10] kind of tool that you might like to

[02:17:12] separately on a remote server. You could

[02:17:16] actually have another MCP server running

[02:17:18] that for whatever reason due to

[02:17:20] workloads you know some kind of security

[02:17:23] requirements I'm not sure for whatever

[02:17:25] reason you want to have an MCP running

[02:17:27] on a remote server you can spin that up

[02:17:29] as well. It could be your own uh it

[02:17:31] could be your own remote server or it

[02:17:33] could be uh some public cloud

[02:17:35] infrastructure like GCP or Azure or AWS.

[02:17:39] And of course if we want to be able to

[02:17:41] connect to that MCP server running on

[02:17:43] that on in the cloud say we need to have

[02:17:45] a corresponding MCP client a third one

[02:17:48] running inside of our host and again

[02:17:51] those are connected by the model context

[02:17:53] protocol itself. Now there's a key piece

[02:17:57] of the puzzle which is that when you

[02:18:00] have that Google cloud or so is that

[02:18:03] Google Maps server running here that

[02:18:06] doesn't have all of Google Maps

[02:18:09] information in it. There isn't an open

[02:18:11] source repo that you can download where

[02:18:13] Google gives you all of their most

[02:18:15] valuable IP.

[02:18:17] And so even though this server is

[02:18:20] running on your own machine, there could

[02:18:22] be circumstances like with Google Maps

[02:18:24] where it still needs to reach out over

[02:18:26] the internet to some remote server that

[02:18:29] in this case Google is hosting to access

[02:18:32] the key data to be able to do that

[02:18:34] geoloccation to be able to find

[02:18:36] directions between two points. Um so

[02:18:39] there are three different situations

[02:18:42] happening happening here uh in terms of

[02:18:45] local uh local remote decisions that you

[02:18:49] have and so we'll go in a

[02:18:51] counterclockwise order

[02:18:54] in the local file system situation here

[02:18:57] we have both the MCP server and the host

[02:19:00] running locally and critically the work

[02:19:03] for this accessing your local file

[02:19:05] system that doesn't involve anything

[02:19:07] being sent over the internet, any remote

[02:19:09] access, everything happens locally on

[02:19:11] your machine.

[02:19:13] In the second example here, which I just

[02:19:15] went through in a fair bit of detail a

[02:19:16] moment ago, you have the client and the

[02:19:19] server running on your own computer

[02:19:20] locally, but in order for that server,

[02:19:24] say Google Maps, to be able to do its

[02:19:25] work, it has to grab information via uh

[02:19:28] some API over the internet. And then

[02:19:31] finally, the third situation is where

[02:19:34] you have the MCP server running

[02:19:36] remotely. And then this might also

[02:19:38] likewise like if you had the Google Maps

[02:19:39] server running remotely, then you'd have

[02:19:42] another line going off to another server

[02:19:44] calling the Google Maps API separately.

[02:19:46] But I think you get the point here that

[02:19:47] there's these three different scenarios

[02:19:49] for how you set up um your uh client to

[02:19:52] run. Now, the common misconception here

[02:19:55] is that MCP servers run remotely. And I

[02:19:59] think that's related to it being in the

[02:20:00] name. You have this natural association

[02:20:03] that an MCP server should be running on

[02:20:05] a remote server. But the most common

[02:20:08] reality is that you download an open

[02:20:11] source MCP server and you run it

[02:20:14] locally. And so then you're either

[02:20:15] you're doing one of these two scenarios

[02:20:17] here where either everything can happen

[02:20:19] locally like when you're accessing your

[02:20:20] local file system or you have the local

[02:20:24] server calling out to an API. And my

[02:20:28] final slide before we get to another

[02:20:30] code demo from Ed where he actually will

[02:20:32] be using MCP in code for you is why you

[02:20:36] might want to consider making an MCP

[02:20:39] server yourself.

[02:20:41] So you know there would be some labor

[02:20:42] associated with making a server. Why

[02:20:45] might you want to do it? Well, you could

[02:20:47] share. So uh lots of companies, lots of

[02:20:50] organizations, lots of individuals are

[02:20:52] today creating MCP servers so that you

[02:20:56] maybe some tools that your company

[02:20:57] creates can be accessible to MCP and

[02:21:02] that could actually potentially even be

[02:21:03] a revenue source for you. Um you could

[02:21:05] have a key associated with it. They have

[02:21:07] to provide you with their credit card

[02:21:08] details in order to use your company's

[02:21:11] uh tools. um and maybe they're going to

[02:21:14] end up having tons of agents and maybe

[02:21:16] they're going to write those agents

[02:21:17] poorly and have a hard loop and give you

[02:21:19] tons of money. And so another reason why

[02:21:21] you might want to have an MCP server is

[02:21:23] it allows you to uh consistently so if

[02:21:25] you if you have an agentic application

[02:21:28] that is calling on a bunch of MCP

[02:21:30] servers, you might just want to have

[02:21:32] consistency and say, "Okay, I want my

[02:21:34] own MC my own tools to be called in the

[02:21:38] same way." Okay, so you have all that

[02:21:39] consistency and you might just want to

[02:21:41] understand the plumbing of what you're

[02:21:42] doing. And the main reason why you would

[02:21:45] not want to make an MCP server is that

[02:21:47] it it's just for you. So if if there's

[02:21:51] there's no point in going to the effort

[02:21:52] of making an MCP server if you're the

[02:21:54] only one that's going to be using it. Uh

[02:21:56] because if you if you want to be using

[02:21:59] tools, there's easier ways to do it than

[02:22:01] spinning up an MCP server, creating an

[02:22:02] MCP server, sorry. Uh, and so the

[02:22:04] function tool decorator that Ed already

[02:22:06] showed us can trivially easily make any

[02:22:09] function into a tool. So that would be

[02:22:11] the place to start. All right, that is

[02:22:14] your MCP intro. Ed will get into the

[02:22:17] weeds.

[02:22:24] Marvelously explained as always. And now

[02:22:29] it is so exciting to be going into this

[02:22:32] project which is the epic project. This

[02:22:34] is what it's what it's all coming to. So

[02:22:36] so let me tell you first about the

[02:22:38] project and then we're going to get

[02:22:40] started with it. We're going to lay some

[02:22:41] some of the the foundations then we're

[02:22:43] going to have our our afternoon coffee

[02:22:45] break and then we're going to bring it

[02:22:46] home after that. So this project is

[02:22:50] called autonomous traders.

[02:22:54] So the uh the idea is we are going to

[02:22:57] build a bunch of agents that are able to

[02:23:00] make decisions about investing in

[02:23:02] financial markets. Now one reason that I

[02:23:05] picked this idea is that it's

[02:23:07] commercial. I I find that a lot of the

[02:23:09] projects that you see in in in the world

[02:23:11] of agents right now, they're all quite

[02:23:13] technical in nature. They're all

[02:23:14] different different kinds of ways that

[02:23:16] you could do things that that build a

[02:23:17] deep research or or something to do with

[02:23:19] technology. And you don't often see like

[02:23:22] true like commercial solutions. So I

[02:23:24] wanted something that would feel

[02:23:26] concrete and tangible and like something

[02:23:28] that could be could could uh be

[02:23:30] something that would be applied to a

[02:23:32] real business like financial markets.

[02:23:34] It's going to involve six different MCP

[02:23:37] servers. That's going to end up using 44

[02:23:40] tools and two resources. So we're going

[02:23:43] to equip LLMs with a lot of power. Uh

[02:23:46] and that's going to be fun and see if

[02:23:48] they how they survive with that. There's

[02:23:50] going to be interactions between agents.

[02:23:52] So, there's going to be communication

[02:23:53] between agents and they are going to be

[02:23:55] autonomous. They're going to be able to

[02:23:57] to pick their own adventure. And then I

[02:24:00] do want to say one more time something

[02:24:01] that John and I have said a couple of

[02:24:03] times, which is that you should not use

[02:24:04] this for trading decisions, please. Uh

[02:24:08] we we uh we we we do not want to be to

[02:24:10] be uh sued for for any financial losses

[02:24:13] that that result from this. But I will

[02:24:14] say of course if you do use it for

[02:24:16] financial decisions and you make lots

[02:24:18] and lots of money then we would love to

[02:24:20] be invited to your uh yacht launch

[02:24:23] party. Uh so don't forget us. Uh but no

[02:24:26] do not use for trading decisions. Uh and

[02:24:29] uh I do also want to say that there

[02:24:31] there's going to be this is quite a big

[02:24:33] project. It's quite meaty. So I am going

[02:24:35] to go through it again relatively

[02:24:37] quickly and I do ask that you use it to

[02:24:39] get intuition. use it a way of of taking

[02:24:42] down what's going on and then exploring

[02:24:44] it yourself later, remembering to to

[02:24:46] contact me if something goes wrong and

[02:24:48] we'll get it fixed up. And I realized I

[02:24:50] never fixed up. I will fix uh whatever's

[02:24:52] going on there. And and uh afterwards

[02:24:54] I'll be around if people are trying

[02:24:55] these things. We can uh we can figure it

[02:24:58] out with that. I uh we are ready to

[02:25:01] start our project. Um when I uh made

[02:25:04] this image, we there were only three

[02:25:06] traders. There are now four. So, this is

[02:25:08] now slightly out of date, but you get

[02:25:09] the idea. We are going to be building

[02:25:11] autonomous agents that know how to trade

[02:25:14] the market, and they are going to be

[02:25:16] using real live market data. So, they're

[02:25:20] going to be using real uh stock prices

[02:25:22] from financial markets, but they're not

[02:25:24] going to be making real trades, luckily,

[02:25:26] uh at least not yet. With that, we're

[02:25:29] going back into cursor and we are going

[02:25:32] into the third project now, trading

[02:25:35] floor. And you'll see we've got a bunch

[02:25:37] of labs to go through. And we're going

[02:25:39] to start with the first lab. Let me come

[02:25:41] up here and I'm going to make this nice

[02:25:44] and big.

[02:25:47] And welcome to the start of our third

[02:25:49] project and to the model context

[02:25:51] protocol. So as I say, do consider this

[02:25:54] to be like a teaser and uh take it as a

[02:25:57] as a exercise to do more detail. Now I

[02:26:00] do have a warning right away on this for

[02:26:02] Windows people. Uh so there is a current

[02:26:06] like production problem with using MCP

[02:26:09] servers over Windows that that uh it uh

[02:26:13] tends to come up with a with a bunch of

[02:26:14] problems with connectivity and the

[02:26:16] solution is to use something called WSL

[02:26:19] uh Windows subsystem for Linux and that

[02:26:22] it's a bit of a bore. It involves

[02:26:24] configuring a Linux uh process to run on

[02:26:26] your PC, but probably uh show of hands

[02:26:29] for people who have who are PC users

[02:26:31] here. And how many of you have WSL

[02:26:34] already?

[02:26:36] Okay. Oh, no, not as many as I thought.

[02:26:37] All right. Well, for the others,

[02:26:38] unfortunately, you will need to install

[02:26:40] WSL, but it's pretty easy. And I've got

[02:26:43] a full set of instructions in the setup

[02:26:45] folder, and let me know if that gives

[02:26:47] you any problems. All right, but on a

[02:26:50] Mac, you're fine. So the moral of the

[02:26:52] story is

[02:26:56] uh

[02:26:57] not not that I'm an Apple fanboy. All

[02:26:59] right. So we're starting with some

[02:27:02] import statements. Okay. So we're going

[02:27:06] to start with our very first MCP server

[02:27:09] and it's one called fetch which is an

[02:27:11] MCP server that Anthropic made available

[02:27:14] as as one of their kind of reference

[02:27:16] implementations. So the way that you

[02:27:18] that you uh use MCP uh we we're going to

[02:27:22] use I I I should have said before we're

[02:27:24] going to be using OpenAI agents SDK my

[02:27:26] very favorite. So we're bringing back

[02:27:28] OpenAI agents SDK and it makes it so

[02:27:31] easy to work with MCP servers. It's it's

[02:27:33] really great. Um, but whether you're

[02:27:35] using OpenAI agents SDK or or or or

[02:27:38] using something like claw desktop as

[02:27:40] John described it, one of the things

[02:27:41] that you need to do is have parameters

[02:27:44] that describe what kind of of MCP server

[02:27:47] you're working with. And here is one of

[02:27:49] such parameters. Um, and this describes

[02:27:52] the MCP server called fetch. MCP server

[02:27:55] fetch. And it is in fact uh like a

[02:27:58] command that's that's similar to to to a

[02:28:00] Python uh command that that runs a tool

[02:28:02] using the Python package manager UV

[02:28:05] which is which is a super amazing

[02:28:07] package manager which I have

[02:28:09] instructions on in the in the guides for

[02:28:11] people that are new to uh to UV. Um and

[02:28:13] it it downloads uh uh something called

[02:28:16] MCP server fetch and basically it does a

[02:28:19] pip install of this behind the scenes.

[02:28:22] it pip installs this locally. And this

[02:28:25] ties to what John was explaining that

[02:28:27] whilst it's called an MCP server, it

[02:28:30] sounds like we're going to be running

[02:28:31] something remotely. It's not. It's doing

[02:28:33] a pip install and that's going to run

[02:28:35] locally. And in some ways, you can think

[02:28:37] of pip as being a really nice analogy to

[02:28:40] the whole MCP ecosystem overall. The way

[02:28:44] that that pip uh the way that the pi has

[02:28:46] made it so simple to find a package and

[02:28:49] then just pip install it and have it

[02:28:51] running locally. It's like there's a

[02:28:52] sort of protocol there. There's a way

[02:28:54] that you can go to Pi, search for a

[02:28:56] package, see how popular it is, and then

[02:28:58] do pip install to bring it locally.

[02:29:00] That's sort of what MCP is. It's a way

[02:29:02] to have people tools that people have

[02:29:04] been written uh that are available that

[02:29:07] you can then just do an equivalent of a

[02:29:09] pip install. And this this is how you

[02:29:11] describe which one you're using. So,

[02:29:13] we're describing the fetch tool. And

[02:29:16] what fetch does is it's able to go and

[02:29:18] fetch a web page. Sounds pretty simple.

[02:29:21] It's able to go and get a web page. But

[02:29:24] what's more ingenious is what fetch

[02:29:26] actually does. What fetch actually does

[02:29:29] is it runs a headless browser on your

[02:29:33] computer and then it uses Playright to

[02:29:36] then go and find it uses browser

[02:29:38] automation with Microsoft Playright to

[02:29:41] go and request that web page and then it

[02:29:43] reads its contents and returns it to

[02:29:45] you. So there's a lot of code in there.

[02:29:47] That's that's a lot of heavy lifting and

[02:29:48] you don't need to worry about any of

[02:29:50] that. You just need to know these

[02:29:52] parameters.

[02:29:54] So I now got some some OpenAI agents SDK

[02:29:57] code here that is going to uh connect to

[02:30:00] this MCP server and it's going to ask it

[02:30:03] what tools do you provide? So right now

[02:30:06] that just got installed on my computer.

[02:30:08] It ran it. It collected the tools and it

[02:30:10] only has one tool and that tool is

[02:30:12] called fetch and it fetches a URL from

[02:30:15] the internet.

[02:30:16] Nice. That's our first looking at our

[02:30:18] first MCP server. We're going to look at

[02:30:20] another one here. We're also going to

[02:30:22] specify the parameters. This is a more

[02:30:24] complicated one that's that's provided

[02:30:26] by Microsoft and it runs the Playright

[02:30:30] uh Microsoft browser automation and it

[02:30:32] brings up a headless browser on your

[02:30:34] computer and it gives you much more

[02:30:36] control over it. So if I look for its

[02:30:38] tools, you get all of these tools that

[02:30:40] will be provided to our LLM. Look at all

[02:30:43] of these. It can close a browser, resize

[02:30:45] it, upload a file, navigate, navigate

[02:30:49] forwards and backwards, save a PDF, lots

[02:30:51] of different things that it can do. So

[02:30:53] that's another MCP server uh with a with

[02:30:56] a ton of code. I've got one more to show

[02:30:59] you and then we're going to put them all

[02:31:00] into action. This one is a another very

[02:31:03] simple one uh that's called server file

[02:31:07] system and it's a tool which allows your

[02:31:10] agent to read and write files from your

[02:31:13] local file system and we're going to to

[02:31:15] to choose a folder called sandbox which

[02:31:18] I've got here on my on my computer and

[02:31:20] we're going to give it the access to

[02:31:21] read and write files from sandbox and

[02:31:24] let's just see what tools this server

[02:31:26] has. So it has tools like read file,

[02:31:29] write file, list directory. So these are

[02:31:32] all of the tools that will be given to

[02:31:34] our agent if it uses that MCP server.

[02:31:37] Okay, so we've got tools that allow us

[02:31:39] to fetch web pages, to navigate in a

[02:31:43] browser window, and to read and write

[02:31:45] files. Let's now put this together.

[02:31:48] There's a question. It's a great

[02:31:50] question. Is there a way to select which

[02:31:52] tools to give to the agent? uh there is

[02:31:54] which I wish to not give which Yeah.

[02:31:57] Yeah. uh so uh the answer is yes but it

[02:32:01] involves you you going slightly uh uh

[02:32:04] off you you can't use the default

[02:32:06] mechanism. So the default mechanism with

[02:32:09] OpenAI agents SDK is just to list the

[02:32:12] servers here. And if you list an MCP

[02:32:15] server like this, then it will look for

[02:32:16] that MCP server, get all of its tools,

[02:32:19] and provide all of those tools to uh the

[02:32:22] uh the the agent that you're

[02:32:24] controlling. If you wanted to subselect

[02:32:28] to either reject or accept different

[02:32:30] tools from this bunch, all you would do

[02:32:32] is simply get the tools using list

[02:32:35] tools, filter out the ones, you can ask

[02:32:37] for each one has a name. So you can just

[02:32:39] filter them by name, select the ones you

[02:32:41] want to to pick or or reject the ones

[02:32:43] you don't, and then instead of saying

[02:32:45] MCP server equals, you simply provide

[02:32:47] the tool itself. You say tools equals,

[02:32:50] and then uh you'll be able to call the

[02:32:51] different tools uh that you want out of

[02:32:53] the bunch. That's a great question. But

[02:32:56] if you if you go with the out of the box

[02:32:57] approach like this, then it will give

[02:32:59] them all of the tools, but you can use

[02:33:01] the prompts as your way to try and tell

[02:33:03] the the agent not not to use all of

[02:33:05] them. Okay. So with this, I now wanted

[02:33:07] to have a useful productive task to give

[02:33:10] our agent. And what I came up with uh

[02:33:12] for our first assignment. So first of

[02:33:14] all uh we we have our instructions which

[02:33:18] you remember is OpenAI agents SDK's

[02:33:21] version of the system prompt. We say you

[02:33:23] use the internet to accomplish your

[02:33:25] instructions. Be persistent until you've

[02:33:28] solved your assignment. And uh then uh

[02:33:31] we have this code. We use a context

[02:33:33] manager. We say with the playright one

[02:33:37] and with the files MCP server, I'm going

[02:33:41] to create a new agent. It's called the

[02:33:43] investigator. And I'm going to give it

[02:33:45] those two MCP servers. And that means

[02:33:48] that this agent is going to be able to

[02:33:50] call any of the tools that are

[02:33:53] implemented by uh these MCP servers. So

[02:33:57] what is the task? Well, the task I've

[02:33:59] decided to assign it is to find a great

[02:34:01] recipe for bonafi pie, which happens to

[02:34:04] be my favorite dessert. Who here knows

[02:34:05] what bonafi pie is? I think it's a

[02:34:08] British thing. Look at that. That's a

[02:34:10] it's a tragedy. But the good news is the

[02:34:13] good news is you're all about to find

[02:34:14] out the recipe for bonafi pie. You'll

[02:34:16] also find it in the GitHub repo as well

[02:34:18] because it's already been created by by

[02:34:20] this agent. It's like a mixture of

[02:34:21] banana and toffee and cream and

[02:34:23] chocolate and there's nothing not to

[02:34:25] like about that. So, let's see what

[02:34:27] happens if I run this. And it is quite

[02:34:30] crazy. So, I've just executed this code

[02:34:32] and while I wait here, what I believe is

[02:34:35] going to happen.

[02:34:41] Oh, wait. We're just going to It's It's

[02:34:43] I don't want to disturb it while it's

[02:34:44] doing its thing. Uh, so it's currently,

[02:34:47] if you saw that, it just opened up a

[02:34:49] browser window. It opened up I I didn't

[02:34:51] have my hands on the keyboard. It opened

[02:34:53] up a browser window and it's uh now

[02:34:56] looking at recipes, controlling this

[02:34:58] browser. It's going to take time because

[02:35:00] it's now, I believe, learning about

[02:35:02] Bonafi Pi, which everyone should know

[02:35:05] about.

[02:35:08] Uh, and at the end of this, bam, it

[02:35:10] finished. This is the pop-up you talk

[02:35:11] about. Sorry, John. Yes. Uh that is

[02:35:14] annoying. But this is a recipe for

[02:35:17] Bonafi pie that you'll see that it just

[02:35:19] took. So it launched a web browser. It

[02:35:22] searched for recipes for Bonafi pie. It

[02:35:24] found this recipe. It's put it there.

[02:35:26] But also if I just show you the file

[02:35:29] browser, there's a folder called Sandbox

[02:35:32] here that it has written a recipe for

[02:35:34] Bonafi pie in there. And if I bring this

[02:35:36] up, you'll see it's been nicely

[02:35:38] formatted. A beautiful recipe. Um, and

[02:35:41] bonafi pie I I I can't cook anything. I

[02:35:44] have no cooking skills consistent with

[02:35:46] my uh hand eye coordination issues, but

[02:35:49] bonafi pie is one thing I can cook. Uh,

[02:35:52] and I can tell you that the recipe that

[02:35:53] it's come up with is a legit recipe for

[02:35:56] bonafi pie. Uh, strongly recommended. So

[02:36:00] anyway, a frivolous example, but the

[02:36:03] point uh was that it was so easy for us

[02:36:06] to equip an OpenAI agent with the

[02:36:09] ability to drive a browser to bring up a

[02:36:11] browser window and do things to that

[02:36:13] browser window and then to to to report

[02:36:15] on it and to write that to a file. And

[02:36:18] honestly, if you if you think about this

[02:36:19] pattern and think of all of the things

[02:36:20] you can do with this, uh I I've I've

[02:36:23] used this pattern to do so many to

[02:36:24] automate so many tasks. I had something

[02:36:26] where I had to myself just just go and

[02:36:29] and collect a ton of information from a

[02:36:31] bunch of different websites and I simply

[02:36:33] put that instruction into this very

[02:36:35] prompt and it was able to bring up a

[02:36:36] browser, go off, collect the information

[02:36:38] and save it down to a file. It works

[02:36:41] just like that. Yes, a question. It's a

[02:36:43] great question. The question was, is the

[02:36:45] agent that I initiated an MCP client? So

[02:36:50] uh it it uh uh the uh the answer is so

[02:36:54] the agent is really the host.

[02:36:57] The MCP client is actually coded for us

[02:37:01] by OpenAI agents SDK. They they in this

[02:37:04] this this context manager here they've

[02:37:07] implemented an MCP client that this

[02:37:09] creates and is attached to the MCP

[02:37:11] server. So you don't have to do that.

[02:37:13] Now they only came out with this about a

[02:37:15] month ago. And when I made the the uh

[02:37:18] the the Udemy course that that that John

[02:37:20] has kindly plugged a couple of times, I

[02:37:22] it was before they had done that. And so

[02:37:24] I went through and I built MCP clients

[02:37:26] myself for all of the different servers.

[02:37:28] And when I completed the whole project,

[02:37:30] the day that I completed it, they

[02:37:32] announced that they now had built uh SCP

[02:37:35] clients. So I had to go back and redo it

[02:37:36] all. That's how much this field is

[02:37:38] changing, how quickly it's changing. So

[02:37:40] now you don't need to worry about

[02:37:42] building your own MCP client if you're

[02:37:44] using OpenAI agents SDK because because

[02:37:46] this contacts manager does it all for

[02:37:48] you. Um but we will be in in a moment we

[02:37:51] will be building looking at an MCP

[02:37:53] client anyway just to show you what they

[02:37:54] look like. Yes. So an excellent

[02:37:55] question. This is essentially web

[02:37:57] scraping and uh have I experienced using

[02:38:00] this with with um uh websites that have

[02:38:04] scraping protections? Um and the answer

[02:38:07] is yes. And it it uh only gets through

[02:38:11] this particular example only gets

[02:38:12] through the simplest possible uh of

[02:38:15] those protections. It gets stuck. It it

[02:38:17] can say it it can accept cookies with

[02:38:18] ease. Uh but it it can't uh solve many

[02:38:21] captures. But uh there are many MCP

[02:38:26] servers out there. There are MCP server

[02:38:28] marketplaces that you can go to. There's

[02:38:30] one at glamour.ai.

[02:38:33] There's one at mcp.so SO that has

[02:38:36] thousands of MCP servers um written by

[02:38:40] anyone that's that's built some tools

[02:38:42] and has published them and many of them

[02:38:44] come with with um much more advanced

[02:38:47] kinds of of uh of code that will work

[02:38:49] around captures by calling NLM to solve

[02:38:52] the capture and then by putting that in

[02:38:54] uh of course that that's web scraping is

[02:38:56] a huge business now I'm definitely uh an

[02:39:00] advocate for best practice uh scraping

[02:39:03] principles this is something that that

[02:39:05] of course is something that that that

[02:39:07] people should read up on and understand

[02:39:09] as good uh internet citizens, the kinds

[02:39:12] of web scraping that we can do and we

[02:39:13] can't do and doing things like honoring

[02:39:15] robots.txt and so on. Super important.

[02:39:19] Uh but should you wish, there is an

[02:39:21] enormous set of MCP servers out there

[02:39:24] that will allow you to to uh uh bend

[02:39:27] those rules in various ways and and lots

[02:39:30] of of scraping is happening. Can you

[02:39:32] speak about security in MCP oath

[02:39:34] authentication all of those flows? Yeah,

[02:39:37] so it's very much so the the question

[02:39:39] about security in MCP this is very much

[02:39:41] a a a new emerging uh area. It's

[02:39:44] something that causes uh a lot of of

[02:39:47] concerns, rightly so. Um and Anthropic

[02:39:50] just released a few weeks ago, I think.

[02:39:52] Um and an authentication component to

[02:39:55] MCP, but I haven't seen it yet be take

[02:39:58] take sort of wider uh being taken on in

[02:40:01] a in a bigger way. But I think that's

[02:40:03] probably going to be the next big thing.

[02:40:05] Um what I'll say is two things. First of

[02:40:07] all, um if you use one of the MCP

[02:40:10] marketplaces like MCP.so, So one of the

[02:40:14] ways that these marketplaces

[02:40:15] differentiate themselves is by carrying

[02:40:17] out security testing themselves. So they

[02:40:20] give like a security grade to the

[02:40:22] different MCP servers published there

[02:40:24] that reflects the testing they've done.

[02:40:26] They've confirmed that that that it

[02:40:28] stays within certain boundaries. Um and

[02:40:31] there's also of course user feedback

[02:40:33] that's gathered there as well. So that's

[02:40:35] a place you can go to for this. And then

[02:40:37] the other point is is a point people

[02:40:39] have made which is that in many ways it

[02:40:42] ties back to that analogy I made with

[02:40:44] with pip. You should always consider

[02:40:47] that running an MCP server is is very

[02:40:50] similar to pip installing a library on

[02:40:52] your computer which by its nature is

[02:40:55] also very much you that that is not

[02:40:57] secure. you're running someone else's

[02:40:59] code on your computer and it's incumbent

[02:41:01] on you as the engineer to do your

[02:41:04] research to check it's got good feedback

[02:41:06] to check that it doesn't depend on other

[02:41:08] packages that maybe have had bad uh

[02:41:10] stuff injected into them um and that's

[02:41:12] something that's a very important

[02:41:13] consideration it's like npm as well the

[02:41:16] same thing people have enormous node

[02:41:18] dependencies um and it's it's uh it's

[02:41:21] super important that engineers are aware

[02:41:23] of that and are checking their

[02:41:24] dependencies now a concern that people

[02:41:27] have raised is that one of the dangers

[02:41:29] of MCP is that it's so easy and it's so

[02:41:32] accessible that a lot of people who

[02:41:34] don't have uh engineering or data

[02:41:37] science credentials are using it to

[02:41:40] install all sorts of stuff on their

[02:41:41] computer. And whereas we can be trusted

[02:41:43] to do our research, go and look at the

[02:41:45] number of stars at GitHub, look at the

[02:41:47] reviews, read the security reviews, um

[02:41:50] the general public may not be as well

[02:41:52] informed. So bridging that education gap

[02:41:54] and making sure that people understand

[02:41:55] the risks they're taking when they

[02:41:57] install someone else's MCP server on

[02:41:59] their computer. Um I think that's that's

[02:42:02] still an evolving story. Now you're

[02:42:04] right to be having some buzz right now

[02:42:06] because we are we're starting I'd say

[02:42:09] the the the most exciting part of this

[02:42:12] but also the riskiest. So so I'm a bit

[02:42:14] nervous I have to admit but we will see

[02:42:16] if things hold together. We after our

[02:42:19] little introduction, after John uh gives

[02:42:21] such such a a thorough explanation of

[02:42:23] what MCP servers and clients are, we

[02:42:25] then we looked at a a sort of toy

[02:42:27] example of using one through the OpenAI

[02:42:30] agents SDK that makes it so very easy.

[02:42:32] We are now going to start working on our

[02:42:34] project to build a simulated trading

[02:42:38] floor. And so first of all, I'm going to

[02:42:41] be I'm going to be showing you some

[02:42:43] example code and also taking you through

[02:42:45] some some Python modules because we're

[02:42:46] we're going to start to move away from

[02:42:48] notebooks and in into proper uh Python

[02:42:51] modules. And the first Python module

[02:42:53] that I want to show you is a Python

[02:42:55] module called accounts.py

[02:42:58] which you will find as a module in the

[02:43:01] in the three folder for the third

[02:43:04] module. So this is accounts.py Pi. And

[02:43:07] this is a bit of Python code that gives

[02:43:10] us a simulated environment for managing

[02:43:14] accounts for traders that want to buy

[02:43:16] and sell shares, deposit money,

[02:43:18] withdraw, sell shares, calculate

[02:43:21] portfolio value, profit loss, holdings,

[02:43:24] and so on. And I'm hoping that people

[02:43:26] are uh twigging uh particularly if you

[02:43:29] notice the comments and the type hints

[02:43:31] here that this code was not written by

[02:43:33] me. Uh but this code of course is the

[02:43:37] accounts code that was written by our

[02:43:40] agents in the second module. Uh now I

[02:43:42] will confess it's not it's not identical

[02:43:44] because because I did this a week ago

[02:43:46] and I got this repo ready. So this is

[02:43:48] what I ran a week ago and then I put it

[02:43:50] into this folder. But it's basically

[02:43:52] code written by agents that to manage a

[02:43:56] simulated trading environment following

[02:43:58] exactly the business rules that we set

[02:44:00] for our crew agents. That's what I have

[02:44:02] in accounts.py. Pi and then with with a

[02:44:05] couple of tweaks so it would it would be

[02:44:07] be integrated here. So let's let's let's

[02:44:10] start by just just using the code. We

[02:44:13] saw a user interface which was built on

[02:44:15] top of that. But let's just just uh go

[02:44:17] for for for looking at the code here. So

[02:44:19] we're going to import account. That's

[02:44:21] the name of the class that our agents

[02:44:24] created for us. I'm going to get the

[02:44:26] account for Ed. Get Ed's account. We get

[02:44:29] back an account with a name, a balance.

[02:44:32] It's got a strategy and I'm going to buy

[02:44:35] some shares. And I specify a stock

[02:44:38] ticker, a number, and then I say, why am

[02:44:40] I buying an Amazon share? And I'm

[02:44:43] rewinding the clock a little bit, and

[02:44:44] I'm saying because this bookstore

[02:44:47] website looks promising.

[02:44:52] All right. So, with that in mind, I

[02:44:54] bought a share of Amazon. How how wise

[02:44:56] of me. Uh, and uh we can now call

[02:44:59] account.report. And this is one of the

[02:45:00] functions that it made that that gives

[02:45:02] us details about that account. And I can

[02:45:04] list transactions. And can see this

[02:45:06] isn't the first Amazon share that I

[02:45:08] bought because I've been uh rehearsing

[02:45:10] this a couple of times. And you can see

[02:45:12] that indeed this is all working. So we

[02:45:16] have a Python class. What we now want to

[02:45:19] do is turn this into an MCP server.

[02:45:22] We're going to make our own MCP server.

[02:45:25] And now as John explained before, if our

[02:45:29] only intention is to use this ourselves,

[02:45:32] to use these tools ourselves, then we

[02:45:34] don't really need to make an MCP server

[02:45:35] because you remember you can just put

[02:45:37] the decorator function tool on each of

[02:45:39] these each of these methods and it will

[02:45:41] immediately become something we can use

[02:45:42] as a tool. So actually the reason that

[02:45:45] you would go about creating an MCP

[02:45:47] server is if you wanted to share it with

[02:45:48] other people. Otherwise, there's not

[02:45:50] such a reason. But we're going to do it

[02:45:52] for educational purposes now. So, even

[02:45:53] though it's just for us, we're going to

[02:45:54] do it because I want to show you how

[02:45:56] easy it is. And I've got a Python module

[02:45:59] called accounts server. And this is an

[02:46:02] MCP server. And I I had an interesting

[02:46:04] question in the break, which is uh could

[02:46:07] you build an agent to write an MCP

[02:46:10] server like this? And the answer is you

[02:46:12] certainly could, but it's super

[02:46:14] boilerplate. It's very light, simple, so

[02:46:17] it's just as easy just to type it out

[02:46:18] yourself. But you could equally we could

[02:46:20] have had our agents we could have had a

[02:46:22] front-end developer, a backend developer

[02:46:24] and an MCP server developer that could

[02:46:26] have turned out this code as well. So

[02:46:28] this is the code we're using anthropex

[02:46:30] packages to create our MCP server. Uh

[02:46:33] there's a there's a class called fast

[02:46:35] MCP and we create a new fast MCP server.

[02:46:39] You give it a name and then quite simply

[02:46:41] you write each of your tool functions

[02:46:44] that you want to make available as part

[02:46:46] of your MCP server and you give it this

[02:46:48] decorator atmcp.tool

[02:46:50] and that's just saying this is a this is

[02:46:52] a tool and it's the comments here are

[02:46:55] important. This is one time when you

[02:46:56] will see me writing comments because

[02:46:58] these comments get used as the

[02:47:01] description of the tool automatically.

[02:47:03] So, Anthropic uses these when it's

[02:47:05] building its its JSON to to define this

[02:47:08] tool. And I'm simply delegating to the

[02:47:11] account business logic written by our

[02:47:13] agents. Delegating to the account for

[02:47:15] each of these. So, it's just a bunch of

[02:47:17] wrapper functions that wraps each of our

[02:47:20] of our agent functions. And uh at the

[02:47:24] end of it, this thing here just simply

[02:47:27] creates the MCP server. And anyone that

[02:47:31] that's encountered MCP servers might

[02:47:33] know that there are in fact two

[02:47:34] different transport mechanisms that you

[02:47:37] can choose for MCP servers. There's

[02:47:38] these the by far the most common uh

[02:47:41] called stddio standard input output.

[02:47:44] That means that it connects over your

[02:47:46] standard input and standard output of a

[02:47:48] of a process. Um and this is actually

[02:47:50] the part that doesn't work on PCs which

[02:47:52] is why you need to use WSL if you're on

[02:47:55] a PC. So that's that's the extent of

[02:47:58] writing an MCP server. You could equally

[02:48:01] just decorate the the code itself in in

[02:48:04] the accounts package, but I think it's

[02:48:05] more common to build something like

[02:48:06] this. So this is our accounts server. So

[02:48:10] now we can go back to our our notebook

[02:48:13] again and take a look at this code. So

[02:48:16] this looks identical to the kind of code

[02:48:20] that I had when we were using real

[02:48:22] servers by third parties. We use one to

[02:48:25] to use Microsoft's playright and we use

[02:48:27] one for a file browser. So now I'm

[02:48:30] saying that I want to use my own account

[02:48:33] server that we just wrote. And I'm going

[02:48:35] to use this MCP server studio uh uh

[02:48:39] context manager here. Pass in these

[02:48:41] parameters to my own server, launch that

[02:48:44] server and ask it to list its tools. So

[02:48:48] this is now it's too quick. That

[02:48:51] initiated that Python process. It ran

[02:48:53] it. It launched an MCP server. OpenAI

[02:48:57] created an MCP client, connected to it,

[02:48:59] and it came back and said that the tools

[02:49:02] that it offers are get balance, get

[02:49:05] holdings, buy shares, sell shares. And

[02:49:09] we've also got one here called change

[02:49:11] strategy which I added in for fun which

[02:49:14] is allowing an agent to decide if it

[02:49:16] wants to change the strategy the the

[02:49:19] investment strategy o of of the uh of of

[02:49:22] its of the investments it's making then

[02:49:24] it has the discretion to do so. It has

[02:49:27] the autonomy to do so. Okay. So these

[02:49:30] are tools provided by our homemade MCP

[02:49:34] server that we just created in in just

[02:49:36] like 10 or 20 lines of code. So, we're

[02:49:38] now going to use that with an LLM. So,

[02:49:41] I'm going to to create a new agent. Me

[02:49:45] get more room here. Here we go. So, so

[02:49:47] the instructions, this is the system

[02:49:49] prompt. You are able to manage an

[02:49:51] account for a client and answer

[02:49:54] questions about the account. Okay.

[02:49:57] What's the question? My name is Ed. My

[02:49:58] account's under my name. What's my

[02:50:00] balance and my holdings? So, that is the

[02:50:03] uh what we're going to do. All right. So

[02:50:06] this again is the same code as before to

[02:50:08] OpenAI agents SDK. We are using our MCP

[02:50:13] server. We're we're equipping it with

[02:50:15] the ability to use our code that we just

[02:50:18] wrote and we're asking it this question

[02:50:21] and let's see if it can now launch a

[02:50:22] Python process, launch a server, connect

[02:50:25] to it, run the right tools, and tell me

[02:50:28] that I have I think I have Amazon stock

[02:50:30] and then one other that I bought that I

[02:50:32] forget. But let's see. It's running.

[02:50:36] And there we go. Your current balance is

[02:50:38] Oh, it's nice. And for your holdings, 20

[02:50:42] shares of Disney. I've got 20 shares of

[02:50:43] Disney and now nine shares of Amazon.

[02:50:48] And so that just shows a homegrown MCP

[02:50:51] server that we just built uh and we just

[02:50:54] ran it and and it was super easy. So to

[02:50:57] the question that someone asked me

[02:50:59] before, uh, one of the things that makes

[02:51:01] it really easy is that we never had to

[02:51:03] build an MCP client because OpenAI

[02:51:06] agents SDK does that for you as it

[02:51:09] happens. Um, but you can if you want.

[02:51:12] Uh, and and I did this because when I

[02:51:15] started out, OpenAI agents SDK didn't do

[02:51:17] this, but uh, I I wrote a client and

[02:51:20] again it's actually really simple. Here

[02:51:22] is the code that does it. I'm not going

[02:51:24] to go through this because this isn't

[02:51:26] really required these days because

[02:51:27] OpenAI does it for you. But basically,

[02:51:30] you can write some code that uses some

[02:51:32] context managers that creates a session,

[02:51:34] connects to the server, and then can

[02:51:36] either call list tools or can run

[02:51:38] different tools. Um, or in this case,

[02:51:40] we're going to use it to read a

[02:51:42] resource, which is another thing you can

[02:51:43] do with MCP. So, let's just try this

[02:51:47] out. Just make sure it works. So we are

[02:51:50] going to take this this uh this function

[02:51:53] read accounts resource that is something

[02:51:56] I just wrote in my MCP client. It's

[02:51:59] going to connect to an MCP server and

[02:52:01] try and read this resource. Let's see

[02:52:03] what comes back. And sure enough uh this

[02:52:07] is uh it's come back with all sorts of

[02:52:09] details about my account. So that seems

[02:52:11] to work. Now I realize I went through

[02:52:13] this part very quickly and again the

[02:52:15] idea is get some intuition, get a flavor

[02:52:17] for what it means to build an MCP server

[02:52:19] and client and come back look at this

[02:52:21] code and see how to do it yourself.

[02:52:23] Bearing in mind that you probably won't

[02:52:25] need to write your own MCP client. We're

[02:52:27] now going to go and have a lot of fun

[02:52:30] with MCP servers. We're going to go and

[02:52:32] try out a ton of different MCP servers

[02:52:35] just because it's so easy and because we

[02:52:37] want to equip our agents with lots of

[02:52:39] functionality that they can use. So,

[02:52:42] we're going to add three new powers to

[02:52:45] our agents. First of all, we're going to

[02:52:47] give them memory. Someone asked me about

[02:52:49] this. Memory is of course a super

[02:52:51] important functionality that you want to

[02:52:53] be able to give agents. And we're going

[02:52:55] to to be able to give it a special kind

[02:52:57] of of memory, a memory where it has a

[02:52:59] knowledge graph where it's able to

[02:53:01] remember people and relationships

[02:53:03] between them. We're going to give it the

[02:53:05] ability to search online to run a

[02:53:07] search. And I don't just mean look up a

[02:53:09] web page as we did with Bonafi Pi, but I

[02:53:12] mean run a search like we did in the

[02:53:15] first module with deep research. And

[02:53:18] then, and this is the best one, we're

[02:53:20] going to give it access to live market

[02:53:23] data. We're going to use a service

[02:53:25] called polygon.io, which is a super

[02:53:27] well-known financial market API. It has

[02:53:30] a free tier, uh, which gets you delayed

[02:53:33] market data, and it has like a paid

[02:53:34] tier, which gets you more more real

[02:53:36] time, and I've paid some money so that

[02:53:37] we could have some fun. Uh so we're

[02:53:39] going to get proper market data but this

[02:53:42] this exercise will all work with without

[02:53:45] uh paying for for for that live market

[02:53:48] data. So let's get started. So the first

[02:53:51] new MCP server we're going to look at is

[02:53:54] a persistent knowledge graphbased

[02:53:58] memory. So it's super interesting. We

[02:54:00] want to be able to store uh entities,

[02:54:03] observations about them, and

[02:54:05] relationships between them. That sounds

[02:54:08] like some chunky functionality. That

[02:54:10] would be a lot of engineering. But in

[02:54:11] MCP land, you just simply set up some

[02:54:13] parameters and then you equip your agent

[02:54:17] with those parameters. And we do it. We

[02:54:20] find out what tools does it give us? It

[02:54:21] gives us a tool create entities, search

[02:54:24] nodes, read graph, create relations, and

[02:54:28] delete entity and relation. So, it's

[02:54:30] allowing our agent to set up these kinds

[02:54:33] of entities and relations between them

[02:54:35] and then recall them later. With that in

[02:54:37] mind, let's let's do some uh some work

[02:54:39] with this. So, my system prompt, you use

[02:54:41] your entity tools as persistent memory

[02:54:43] to store and recall information. My

[02:54:46] name's Ed. I'm running a workshop live

[02:54:49] about AI agents right now. And I'm

[02:54:51] co-presenter with the co-presenting with

[02:54:53] the legendary presenter John from the

[02:54:56] super data science podcast. So that is a

[02:54:59] bit of information and we're going to

[02:55:01] give that information to our agent that

[02:55:04] is equipped with this memory tool.

[02:55:09] Off it goes. It says I've stored the

[02:55:12] information about you and John. All

[02:55:15] right. So now I'm going to ask this

[02:55:17] agent a question. My name's Ed. What do

[02:55:18] you know about me? Let's see what it

[02:55:21] says.

[02:55:23] I know your name is Ed. You're currently

[02:55:25] running a workshop about AI agents.

[02:55:27] Additionally, you're co-presenting with

[02:55:29] John, a legendary presenter from the

[02:55:30] Super Data Science podcast. It doesn't

[02:55:32] know that it's the world's most listened

[02:55:34] to data science podcast. Uh, let's

[02:55:37] change this to my name's John. What do

[02:55:39] you know about me?

[02:55:44] Oh,

[02:55:46] well, at least one thing had to go

[02:55:48] wrong. Uh, let's try giving it the Let's

[02:55:52] try debugging this. Let's see if we can

[02:55:54] give it the information a second time.

[02:55:58] Let's see.

[02:56:05] Works 90% of the time.

[02:56:09] Okay. My name's John. What do you know

[02:56:11] about me? Have I got everything right

[02:56:12] here? Yes.

[02:56:14] Drum roll.

[02:56:20] There we go.

[02:56:22] Uh, here's what I know about you, John.

[02:56:25] Legend of Santa. data science and you're

[02:56:26] co-presented with Ed. And there we go.

[02:56:30] Very nice. And of course, this is a good

[02:56:32] illustration. It's good that something

[02:56:33] goes wrong because it shows you that

[02:56:35] these systems are not 100% reliable. Uh

[02:56:39] and it it uh answers the the question

[02:56:41] you had. Even with identical inputs, you

[02:56:43] can get different answers. Um and I've

[02:56:46] I've run this quite a few times and this

[02:56:48] is the first time it's not worked. So

[02:56:50] that's that's super interesting. And we

[02:56:52] can actually check out the trace. If you

[02:56:53] remember the traces from uh uh the first

[02:56:56] part, uh we can go in and have a look at

[02:56:59] this and we can look through this trace

[02:57:02] and see that it did a search nodes and

[02:57:04] see the responses that it got back from

[02:57:05] that memory. And it would be interesting

[02:57:07] to debug and see what happened the time

[02:57:09] when it didn't get the right answer and

[02:57:11] see if we can figure out why that is and

[02:57:13] how we could then improve the prompts so

[02:57:15] that that would be less likely to happen

[02:57:16] in the future. Okay, moving on. Our

[02:57:19] second MCP server is a Brave search. So

[02:57:24] Brave is a company that offers an API

[02:57:26] service to run like a sort of

[02:57:28] alternative to a Google search. They'll

[02:57:30] run it for you online. Um and uh I' I've

[02:57:34] set up I had to set up an API key. They

[02:57:36] give you 2,000 free searches, but beyond

[02:57:39] that you have to to to pay like a half a

[02:57:42] cent per search. Um so uh if we just

[02:57:46] look at what tools we get from Brave.

[02:57:48] Let's have a look.

[02:57:51] They give two tools. One is called Brave

[02:57:53] web search and one is called Brave local

[02:57:55] search which looks for local businesses.

[02:57:57] And so now we're going to say you're

[02:57:59] able to search the web for information

[02:58:01] and briefly summarize the takeaways. And

[02:58:03] I'm going to ask for the latest news on

[02:58:05] Amazon stock price. I also wanted to

[02:58:07] mention this little trick I'm doing here

[02:58:09] which is a very common trick which is in

[02:58:11] the prompt passing in the current uh

[02:58:15] date and time. That's just a just a good

[02:58:17] technique. Anytime they're asking for

[02:58:19] something that's that's that has time

[02:58:21] involved. It's worth specifying it. An

[02:58:24] alternative is to actually create a tool

[02:58:26] which can look up the date and time. But

[02:58:29] that's more work than you need to do

[02:58:30] because you might as well just always

[02:58:32] provide the current date and time in

[02:58:33] your prompt and then just just give it

[02:58:35] to the LLM right away. So that's a nice

[02:58:37] nice trick to know. So we'll do that.

[02:58:39] And now we're going to ask to to know

[02:58:41] about uh uh takeaways

[02:58:45] about Amazon stock price.

[02:58:54] Here we go. A lot of stuff. the brief

[02:58:56] summary of the latest news regarding

[02:58:57] Amazon's stock price.

[02:59:00] Let's be bold and try and change this.

[02:59:02] Let's look for something different. The

[02:59:03] latest uh uh an update on the Super Data

[02:59:06] Science podcast.

[02:59:09] Make up for its lack of memory earlier.

[02:59:11] Please research the Super

[02:59:15] Data

[02:59:17] Science

[02:59:21] podcast.

[02:59:24] and briefly summarize it.

[02:59:33] And we'll run that. And again, this is

[02:59:35] now connecting using Braves MCP server

[02:59:38] to connect to the Brave web search API.

[02:59:41] It's asking about the Super Data Science

[02:59:43] podcast. And here it is. Super data

[02:59:46] science hosted by Dr. John Cron and lots

[02:59:48] of stuff about it.

[02:59:51] uh light-hearted interviews with

[02:59:52] renowned guests. Uh uh now we're going

[02:59:55] to our uh third MCP server. And this is

[02:59:59] an example of how easy it is. You can

[03:00:02] just go to somewhere like mcp.so

[03:00:05] and search for MCP servers. And there's

[03:00:07] so many. There's actually there were

[03:00:09] more than 20 that offer financial market

[03:00:12] data, but I already know Polygon. That's

[03:00:13] a that's a very uh um reputable provider

[03:00:17] of of market data. And so it made a lot

[03:00:19] of sense to use their official MCP

[03:00:21] server. And I've got instructions here

[03:00:23] for you to use it yourself. And it's

[03:00:24] free if you go with the free plan.

[03:00:26] There's also a paid plan that I'm using

[03:00:28] here. And this is the command that

[03:00:30] basically takes Polygon's official

[03:00:33] GitHub version of this MCP server and

[03:00:37] runs it locally. So, even though we're

[03:00:39] looking at market data, it's running,

[03:00:41] the MCP server is going to be running on

[03:00:43] my box, as John explained, which is by

[03:00:45] far the most common way to run MCP

[03:00:48] servers. And look at all of these tools.

[03:00:51] So, it provides a ton of tools. It

[03:00:54] includes tools to get the the most

[03:00:55] recent trade. It can get crypto trades

[03:00:58] uh if you if you want to go in that

[03:01:00] direction. Uh it can get uh details

[03:01:02] about tickers. It can get technical

[03:01:03] analysis. it can get I believe in here

[03:01:06] somewhere is uh uh financial reports and

[03:01:09] so there's a lot of stuff in there. So

[03:01:12] let's let's use these tools. It's again

[03:01:15] just as simple as one line of code to to

[03:01:18] add that to our agent. Uh and so let's

[03:01:22] say uh what's the share price of of

[03:01:25] Apple and give that to an agent that's

[03:01:27] equipped with the Polygon MCP server.

[03:01:35] And it's taking a while.

[03:01:42] Let it do its thing.

[03:01:46] Be interesting to see in the trace. But

[03:01:47] here we go. We've got we've got the

[03:01:48] results. The current share price is is

[03:01:50] $212 apparently. And here's more

[03:01:53] information that it's got about today's

[03:01:55] change, opening price, high and low, and

[03:01:57] volume. So, it probably did a fair bit

[03:01:59] of looking up to to to gather the

[03:02:01] different bits of information. So, we've

[03:02:03] looked at a bunch of different MCP

[03:02:06] tools, and we're about to give all of

[03:02:09] that functionality to be able to do any

[03:02:10] of those things, web searches, looking

[03:02:13] up market data, using uh different uh uh

[03:02:17] uh web browser techniques. And we're

[03:02:19] going to give it all to some agents. And

[03:02:21] let's see in total how many we have. So,

[03:02:24] this is now gathering all those

[03:02:26] different MCP servers, listing all of

[03:02:28] the tools, and adding them all up. So,

[03:02:30] in total, we've got six MCP servers, and

[03:02:33] that covers 44 different tools. And

[03:02:36] we're now going to build our application

[03:02:38] that's going to use all 44 of them. So,

[03:02:42] this is where the Autonomous Traders

[03:02:45] project comes to life. And what I'm

[03:02:46] really going to be doing here is showing

[03:02:48] you the Python code that backs this up,

[03:02:50] showing you how it makes decisions and

[03:02:52] also showing you how you build a sort of

[03:02:53] well ststructured agent project. Um, and

[03:02:57] then we'll be testing it out, giving it

[03:02:59] a shot. So, uh, it's going to use all of

[03:03:02] the MCP, uh, servers that we've talked

[03:03:05] about. And you may have, when you're

[03:03:06] doing the maths, you might have noticed

[03:03:08] that I mentioned six MCP servers, but

[03:03:10] I'd actually only showed you five of

[03:03:12] them. And that's because I added in one

[03:03:14] extra one, which is the return of the

[03:03:16] push notification tool because I love it

[03:03:19] when this this goes ping and that's just

[03:03:20] too cool. We have to end with that. So I

[03:03:22] have to now turn my phone off silent

[03:03:23] again uh because we're hoping that our

[03:03:26] agents are going to be able to send a a

[03:03:27] push notification when they make trades.

[03:03:30] Uh which is going to be fun. I want to

[03:03:32] start by taking you to a Python module

[03:03:35] called traders.py. And obviously all of

[03:03:38] this is in the repo for you to look at.

[03:03:40] Um this module is the module which which

[03:03:44] creates the two agents that we're using

[03:03:47] the two different types of agent. One of

[03:03:49] them is a research agent that goes and

[03:03:52] analyzes and works on doing market

[03:03:54] analysis and research. And one of them

[03:03:56] is a trader agent that goes and uh

[03:04:00] actually uh makes decisions, trading

[03:04:02] decisions. And at the end of at the end

[03:04:05] of it, it there's there's just uh

[03:04:07] there's something that creates each

[03:04:08] agent, passing in all of the MCP

[03:04:10] servers, and there's something that runs

[03:04:12] each agent. But otherwise, this is

[03:04:14] pretty short and boilerplate. The only

[03:04:16] thing that's new here is that I've also

[03:04:18] got some code that allows me to not only

[03:04:20] use OpenAI's models, but also use

[03:04:22] DeepSeek, Grock, and Gemini. And that

[03:04:25] answers a question someone had for me,

[03:04:27] which is does OpenAI agents SDK only

[03:04:30] allow you to use OpenAI's models? And

[03:04:33] the answer is not at all. But they

[03:04:35] absolutely allow you to use different

[03:04:37] models. And this code here will show you

[03:04:40] exactly how to do it. There's also a

[03:04:42] guide in the guides folder that can show

[03:04:44] you how you can hook up a model of your

[03:04:46] choosing to the OpenAI agents SDK,

[03:04:49] including local models running with

[03:04:51] Olama running on your computer. So

[03:04:54] that's in this uh code. Now, one thing

[03:04:57] you might notice is that there's there's

[03:04:58] no prompt details here. There's no text.

[03:05:01] And that's because I've sort of taken a

[03:05:03] leaf out of Cruz's book and I've

[03:05:05] separated out my text into a separate

[03:05:08] Python module, which is just a good

[03:05:10] practice for for for uh agent

[03:05:13] engineering. So if I just uh switch over

[03:05:16] see that, sorry, switch over to another

[03:05:19] class here. There's one called

[03:05:21] templates, another module. And basically

[03:05:24] any of my code that produces prompts,

[03:05:27] whether it's the instructions or whether

[03:05:29] it's just the prompt itself, I've

[03:05:31] separated it out into one uh function

[03:05:34] here. And this is a good practice to

[03:05:37] follow. It's it's got a sort of a nod to

[03:05:39] the way that crew has you separate

[03:05:41] things out into YAML, but even if you're

[03:05:43] not using crew, you can still follow

[03:05:44] this practice and design your agent

[03:05:46] systems so that your prompt templates

[03:05:48] are in one place. Um, and that allows

[03:05:51] you to change them in one place and to

[03:05:52] and to to manage them and look at them

[03:05:54] like that. Now, the other thing that's

[03:05:55] here as well ties to a question that

[03:05:57] came up in module one, which is this

[03:06:00] module traces.py.

[03:06:02] And this is a module which is where I am

[03:06:05] plugging in to some functionality that

[03:06:07] OpenAI agents SDK has where you can

[03:06:10] write your own tracer. If you don't want

[03:06:13] it to be tracing in their screens, but

[03:06:15] you would rather capture that

[03:06:17] information from traces and be able to

[03:06:19] store it in a database or in a file

[03:06:20] system or in log files, then you can

[03:06:22] write a custom tracer and you can

[03:06:25] register it. And that way your tracer

[03:06:27] will be used either instead of or in

[03:06:30] addition to OpenAI's tracers. And that

[03:06:32] is what I've done here. And I'm I'm not

[03:06:35] going to go through this in detail

[03:06:36] because this is probably something only

[03:06:37] a few people would want to do. But if if

[03:06:39] you'd like to, it's good to look at

[03:06:41] this. and we will use this because I

[03:06:42] want to surface it onto the user user

[03:06:44] interface onto the UI because I want us

[03:06:46] all to be able to see what the agents

[03:06:47] are thinking while they're thinking it.

[03:06:49] And this is a cool way to do that. That

[03:06:51] is the those are the the the main

[03:06:53] classes uh that we have for our agents.

[03:06:57] And there's just a couple more before I

[03:06:59] give you the reveal and we see the

[03:07:01] application, we bring it up and I have

[03:07:03] my moment of truth when this thing

[03:07:05] either works or or uh or doesn't or

[03:07:08] you're already in that 20%. uh so uh

[03:07:10] yeah keep fingers crossed. So first of

[03:07:14] all uh I want to explain that in our uh

[03:07:18] application we are going to create four

[03:07:21] instances of our trader um trader agent

[03:07:25] so that we have four traders and I have

[03:07:27] named them Warren George Ray and Kathy

[03:07:32] and those names are by some people are

[03:07:35] smiling and nodding recognize them as

[03:07:37] they are a nod to their role models uh

[03:07:40] Warren the recently retired Warren

[03:07:42] Buffett

[03:07:43] George for George Soros, Ray for Ray

[03:07:45] Dalio, and Kathy for Kathy Wood, uh,

[03:07:48] crypto and and tech investing at Arc

[03:07:52] Investments. So, these are four

[03:07:54] luminaries of the trading world. And I

[03:07:58] haven't just used their names. I've I've

[03:08:01] taken more than that. In this Python

[03:08:03] module reset, which you run the first

[03:08:05] time, I set their trading strategies and

[03:08:08] I asked them to to to try and and pay

[03:08:12] homage to their role model, to their

[03:08:14] namesake. And so Warren is a

[03:08:16] valueoriented investor, prioritizes

[03:08:19] long-term wealth creation. George Soros

[03:08:21] is aggressive and bold and macro trader

[03:08:24] who actively seeks market mispricings.

[03:08:27] Uh Rey is systematic. And uh Kathy is of

[03:08:32] course crypto and new tech focused. So

[03:08:35] these are the framings of our four

[03:08:37] traders. But I do also give them a tool

[03:08:40] which allows them to change this

[03:08:41] strategy over time because I wanted them

[03:08:43] to be truly autonomous. They start uh in

[03:08:46] this way but they have the ability to

[03:08:48] change what they do over time. I also I

[03:08:50] I want to show you just two more Python

[03:08:53] modules and then we get to run this. uh

[03:08:56] MCP params is one module where I have

[03:08:59] separated out all of the MCP all of the

[03:09:01] six servers and 44 tools that we use. So

[03:09:05] you can look through this and you can

[03:09:06] add to this. So one of the great to-dos

[03:09:09] for all of you when you have this

[03:09:10] running is you can add in equip your

[03:09:13] agents with more allow them to have more

[03:09:15] powers so that they can be better

[03:09:17] traders and you simply do it in this

[03:09:19] module MCP params.

[03:09:22] And then last but not least is this

[03:09:24] module trading floor. And this is where

[03:09:27] it actually uh runs our trading floor.

[03:09:29] There's a few constants. Should it run

[03:09:32] every how how many minutes should it

[03:09:34] should it go trading for? And right now

[03:09:37] it's uh it's set to uh run every 60

[03:09:40] minutes, but I'm going to change this to

[03:09:42] every minute. We'll make sure that it's

[03:09:43] going to be aggressively trading while

[03:09:45] we watch. uh uh run even when the market

[03:09:49] is closed is is uh set in the

[03:09:51] environment variables but but by default

[03:09:53] I have it so that it will stop trading

[03:09:55] when the market's closed so that it's uh

[03:09:57] not trading all the way through the

[03:09:58] night. I forgot to do that once and uh

[03:10:00] went to sleep and I forgot that it was

[03:10:02] still messaging my phone and I was

[03:10:04] annoyed.

[03:10:07] I was annoyed when some midnight trading

[03:10:10] activity happened.

[03:10:12] So yeah, watch out for that. Uh, and

[03:10:15] then you can choose whether you're using

[03:10:16] many LLMs or just using GPT4. And um,

[03:10:21] and that's really it. And then and then

[03:10:22] this this is the the the loop. This is

[03:10:25] the loop where it simply runs the

[03:10:27] traders.

[03:10:29] Okay.

[03:10:31] So, is everyone ready? We're now going

[03:10:33] to give this a try. So, I'm going to

[03:10:35] start by launching the user interface so

[03:10:37] we can see how it looks. And then when

[03:10:38] the user interface is up, I'm going to

[03:10:40] kick off the trading floor and let them

[03:10:42] do some trading. and we'll see how they

[03:10:44] perform. So, we're going to

[03:10:47] uh bring up a terminal,

[03:10:52] go into here, uvun

[03:10:56] app.py.

[03:11:00] So, this is going to be hopefully a user

[03:11:03] interface for our traders.

[03:11:07] And they've been running for about a

[03:11:08] week now. I I set them off a week ago,

[03:11:11] so we'll see how they're doing right

[03:11:13] now. Hold on a second. Let me make this

[03:11:15] a bit bigger for you

[03:11:20] and zoom out. So, this is going to be a

[03:11:23] bit hard for people at the back to see,

[03:11:25] but but you can run it on your own

[03:11:26] computers. And let me tell you what we

[03:11:29] are seeing here. So, what we're seeing

[03:11:32] is our four traders are represented by

[03:11:35] these four columns. Warren, George, Ray,

[03:11:38] and Kathy. Warren is powered by GPT41

[03:11:42] Mini. George by Deepseek V3. Ray by

[03:11:46] Gemini 25 Flash, the very latest but

[03:11:50] cheaper version of Gemini. And Kathy,

[03:11:52] since since Kathy is is is

[03:11:54] cryptofocused, high-tech, I thought that

[03:11:56] that Elon Musk's uh Gro 3 was the right

[03:11:59] right choice for Kathy. So, that's who

[03:12:01] powers Kathy. And what's kind of cool is

[03:12:04] that these have been running for a week

[03:12:06] and as it stands right now, all four of

[03:12:08] them have made pretty healthy profits.

[03:12:11] Uh you can see uh Kathy is in the lead

[03:12:14] uh with uh 11,000 uh sorry with with

[03:12:18] 1,000 they were given $10,000 to start

[03:12:20] with. I should have explained they were

[03:12:21] all given $10,000 to start with and

[03:12:23] Kathy has made $1,300

[03:12:26] of profit. Now, it's worth having a a

[03:12:29] caveat that the markets have been quite

[03:12:31] good to us in the last week.

[03:12:34] Uh, and so they they've had a bit of a,

[03:12:36] as you can see for the way that this has

[03:12:38] gone up. And you can see they've had

[03:12:39] their bad days as well as their good

[03:12:40] days. Um, but they have been running.

[03:12:44] And now that you've seen this, what I'm

[03:12:46] going to do now is actually kick them

[03:12:48] off and see what happens. So, I'm going

[03:12:50] to create a new terminal window. Go into

[03:12:54] the third into trading floor and I'm

[03:12:56] going to say UV run trading floor.py.

[03:13:00] Kick that off. Let it do its thing. Oh,

[03:13:04] the market is closed.

[03:13:06] All right, stop that. We're going to

[03:13:08] have to tell it that it can trade even

[03:13:09] when the market says closed.

[03:13:13] After hours. We could do that because um

[03:13:17] uh hang on.

[03:13:23] Uh

[03:13:27] we can go to trading floor.

[03:13:38] Here we go. Run even when market is

[03:13:41] closed. We're going to make that true.

[03:13:47] And now try this again.

[03:13:52] Off it goes.

[03:13:56] Let's go back here and watch what

[03:13:58] happens.

[03:14:01] And they're off. Things are happening.

[03:14:03] The red that you see there, I know you

[03:14:05] can't see what it's actually saying, but

[03:14:06] I can, is when it's actually calling the

[03:14:08] MCP code, and that's actually doing some

[03:14:11] looking up of our accounts. And then the

[03:14:14] uh each of the different colors

[03:14:15] represents it doing a different action

[03:14:17] that you'll be able to look at. Uh the

[03:14:19] uh yellow is is when it's actually

[03:14:21] generating. Uh the green is when it's

[03:14:23] running a web search.

[03:14:25] The light blue cyan color is running

[03:14:29] something. So all four of them are

[03:14:31] considering their options and deciding

[03:14:33] whether to take trades. And you can see

[03:14:36] that there are holdings down below. And

[03:14:39] actually, if we scroll down, there's

[03:14:40] also their their transaction history at

[03:14:42] the very bottom.

[03:14:45] So, we're going to let this run for a

[03:14:46] bit while they analyze the market.

[03:14:48] They'll be looking up, using their

[03:14:50] different tools, all 44 of them, to

[03:14:53] research the market to look up stock

[03:14:56] prices and to make some decisions. What

[03:14:59] we're hoping to see is that at the end

[03:15:01] of this, they will make some trades.

[03:15:03] While they're doing this, we can also

[03:15:05] have a look in the uh OpenAI traces.

[03:15:15] You can see here that we've got four

[03:15:17] traces. Warren trading, Ray trading,

[03:15:20] George trading, and Kathy trading.

[03:15:23] Did you hear that? That was them just

[03:15:25] making a trade.

[03:15:28] Uh someone just did a trade. We'll go

[03:15:29] and have a look. You can see if you look

[03:15:31] in here, each of the different traces

[03:15:34] you can have a look at will show you all

[03:15:35] of the different trading going on as

[03:15:37] they list their tools, as they find out

[03:15:38] what's going on. I'm going to go back to

[03:15:41] the uh to here. Uh let's see. Well, I'll

[03:15:45] read my my push notification to tell you

[03:15:47] who did what. Oh, there's another one.

[03:15:50] Uh okay, so someone just I see. So, uh,

[03:15:56] someone sold five shares of AMD and

[03:15:59] they're still going on.

[03:16:04] All right. So, while that's still

[03:16:06] running and while more trading is

[03:16:07] happening and we can watch over time

[03:16:09] what happens to their chart, I want to

[03:16:12] remind you of the big to-do that is now

[03:16:15] sitting with all of you. This is really

[03:16:17] cool, but it's only cool if you see it

[03:16:20] happening yourself and if you're part of

[03:16:22] it and understanding what's going on.

[03:16:24] And of course, the trades are not

[03:16:25] actually executed. It's all just

[03:16:27] happening in our simulation. So, it's

[03:16:29] great fun to watch. So, the to-do for

[03:16:32] all of you now is to to in your own time

[03:16:35] come back through this and just run

[03:16:37] those two commands to kick this off and

[03:16:40] let let this run and see what happens

[03:16:43] and uh see if you can you can replicate

[03:16:45] this kind of success uh and see if it

[03:16:48] actually is makes some money. uh and uh

[03:16:51] at the same time you should try and add

[03:16:54] some more tools yourself to try and add

[03:16:56] in more and see what more functionality

[03:16:59] you can give it and whether you can do

[03:17:01] more and if you're able to add in some

[03:17:02] great tools then by all means submit a

[03:17:04] PR to me to add to the repo because I

[03:17:07] would love to include your tools in

[03:17:09] there too people from this we can add in

[03:17:12] your tools and together we can build

[03:17:14] something that has more and more

[03:17:16] functionality so please do do that and

[03:17:18] do send in updates with more

[03:17:20] functionality you give it. And so well,

[03:17:23] thank you.

[03:17:27] [Applause]

[03:17:32] And so with that, I'm going to leave

[03:17:34] this up here trading for a little bit

[03:17:35] longer uh while I hand back to John to

[03:17:39] uh to wrap it up. Brilliant. Wasn't that

[03:17:41] great? You'll still have Ed up again uh

[03:17:43] because we're going to have questions at

[03:17:44] the end. Now, I've been standing up here

[03:17:47] for five and a half hours. telling you

[03:17:50] that there were three modules and we

[03:17:51] just finished the third module. Isn't it

[03:17:53] time for me to move over? Well, there's

[03:17:54] a secret fourth module which and some

[03:17:58] people have been asking me over lunch. I

[03:17:59] got lots of questions about this. So, I

[03:18:01] know it's something that's on people's

[03:18:03] minds.

[03:18:05] And so,

[03:18:07] the secret fourth module is about the

[03:18:09] implications of all of this,

[03:18:12] looking forwards

[03:18:15] at where we're going. So remember I had

[03:18:16] this slide up that it's never been a

[03:18:19] better time to develop AI agents and I

[03:18:21] talked about all the reasons why it's

[03:18:23] never been a better time and I also you

[03:18:26] know after you've built your own after

[03:18:28] you have your own trader running and

[03:18:30] you're comfortable with agents and

[03:18:31] adding in your own tools hopefully

[03:18:33] you'll get started on thinking of ways

[03:18:36] that you can be transforming your life

[03:18:38] personally you can be transforming

[03:18:41] enterprises

[03:18:42] government organizations

[03:18:44] charities

[03:18:45] uh making socially impactful uh use of

[03:18:49] this tremendous power that we all have

[03:18:52] access to here. You can be making, you

[03:18:55] know, uh a return on investment for your

[03:18:58] businesses in AI. You can be seriously

[03:19:01] changing the world uh with this kind of

[03:19:03] technology that we already have today.

[03:19:05] And every six months, we're going to

[03:19:07] leap forward in terms of what the LLMs

[03:19:09] that power these agentic frameworks can

[03:19:12] do. And on top of that, we'll come up

[03:19:14] with easier and easier abstractions just

[03:19:16] like uh Ed pointed out how he had to be

[03:19:18] making the MCP client code himself. Um

[03:19:21] and then as of a month ago, that

[03:19:23] changed. So these abstractions will

[03:19:25] continue and continue and continue

[03:19:26] giving you as people, you know,

[03:19:29] listening to this kind of hands-on

[03:19:31] 4-hour workshop, the power, more and

[03:19:34] more and more power concentrates inside

[03:19:36] of you to be making a big impact in the

[03:19:38] world.

[03:19:40] Now there will be uh workforce changes

[03:19:43] as a result of that. So the good news is

[03:19:47] that at least for the few coming years

[03:19:51] more jobs will be created by AI than

[03:19:53] lost. So every wave of automation that

[03:19:56] has happened in human history has

[03:19:59] displaced people but it has created more

[03:20:02] jobs than it lost. Some people think

[03:20:04] that this time is different because all

[03:20:06] of the previous waves of automation were

[03:20:10] uh basically removing the need for

[03:20:12] physical labor and now cognitive labor

[03:20:16] suddenly looks the most vulnerable and

[03:20:18] so maybe that will create something

[03:20:20] different but probably it won't. We'll

[03:20:23] probably figure out things to do and in

[03:20:25] the meantime work will probably continue

[03:20:28] to get more and more pleasant like it

[03:20:30] has for centuries. So two centuries ago,

[03:20:34] 99% of people were subsistence farming

[03:20:39] and that was a lot of work. It was a lot

[03:20:41] of stress. It didn't always work out.

[03:20:43] One in every two children would die

[03:20:45] before the age of five. Uh and thanks to

[03:20:49] automation, thanks to technology, thanks

[03:20:51] to laws, thanks to democracy, we have

[03:20:55] you know this great wealth today that we

[03:20:57] have the option to instead of be tilling

[03:21:00] the fields. We can spend a few days

[03:21:02] sitting at a data science conference

[03:21:04] learning about AI agents that can

[03:21:07] automatically do even more work. And so

[03:21:10] uh you know and all the while you know

[03:21:12] you get to sit in comfortable air

[03:21:13] conditioning and you can check your

[03:21:16] email when you want to. You can phone

[03:21:17] your family when you want to. It's all

[03:21:19] getting nicer and nicer and nicer. So, I

[03:21:21] think that that trend will continue. It

[03:21:23] will continue to get nicer and nicer,

[03:21:25] but

[03:21:26] funding for reskilling programs is key

[03:21:29] because the pace of change is going to

[03:21:31] go faster and faster. More and more

[03:21:35] kinds of specific tasks and if enough

[03:21:38] specific tasks in a specific role, then

[03:21:41] that whole role will be replaced. So

[03:21:44] funding for reskilling programs is key

[03:21:46] to success. Looking further down the

[03:21:49] down the line, maybe we'll we'll need

[03:21:51] things like a universal basic income or

[03:21:53] something like that. But uh that's still

[03:21:55] some years away. Right now we stand at

[03:21:57] basically historic um unemployment lows

[03:22:00] in most western economies. So I think

[03:22:02] that you know that's largely good news

[03:22:04] when you have the chance to press your

[03:22:06] local elected official for a reskilling

[03:22:08] program. Great. But now what about you?

[03:22:10] You raised your hands at the beginning

[03:22:11] of the session. Most of you are data

[03:22:13] scientists and if machine I when I

[03:22:17] showed you a chart right at the

[03:22:18] beginning of how every seven months the

[03:22:22] the uh cognitive length of a task that

[03:22:25] can be automatically completed. I told

[03:22:26] you at that time that that was actually

[03:22:28] based on the kinds of tasks exactly like

[03:22:31] running machine learning models

[03:22:32] generating code which is what a lot of

[03:22:34] us do in this room. And so you might be

[03:22:37] particularly thinking what can I do for

[03:22:40] my career given that this kind of

[03:22:41] technology exists and is going to get

[03:22:43] better and better to futureproof my own

[03:22:45] career. And so the first thing of course

[03:22:47] is to listen to a great podcast uh and

[03:22:50] stay on top of AI trends. That's

[03:22:53] something easy and maybe fun you can do

[03:22:55] especially if you find a light-hearted

[03:22:56] program that makes you giggle every once

[03:22:58] in a while. And another great thing is,

[03:23:02] as you saw today, focusing on

[03:23:03] multi-agent orchestration and

[03:23:05] management. So, it's the kind of skills

[03:23:07] that actually we're taught today. Also,

[03:23:08] Ed has even more of in his 17our Udemy

[03:23:10] course. This if you can figure out how

[03:23:14] to be getting teams of agents to work

[03:23:16] for you or your organization, that's

[03:23:19] going to be an invaluable skill as well.

[03:23:22] This sounds kind of contrary to the

[03:23:24] previous two points. So on the one hand

[03:23:26] we're moving faster and faster and so

[03:23:29] there's more and more abstractions. It

[03:23:30] seems like it's more and more valuable

[03:23:32] to be kind of at the cutting edge

[03:23:34] focusing on these abstractions agentic

[03:23:36] frameworks MCP. But at the same time

[03:23:39] don't underestimate the power of

[03:23:41] foundational subjects. So here I'm

[03:23:43] talking about things like linear

[03:23:44] algebra, calculus, probability,

[03:23:47] statistics, algorithms and data

[03:23:49] structures, optimization.

[03:23:51] Those kinds of subject areas I have seen

[03:23:54] time and again. I've been blown away by

[03:23:55] some of the most brilliant people that

[03:23:57] Ed and I have had the pleasure to work

[03:23:58] with. People like Vince Patio, Sean

[03:24:00] Kosla. These people were masters at

[03:24:05] taking foundational knowledge that they

[03:24:07] had and realizing that they could use

[03:24:10] fundamental linear algebra to

[03:24:12] dramatically by orders of magnitude

[03:24:14] increase the compute time and decrease

[03:24:17] the compute cost of some AI

[03:24:20] functionality in production. Once you

[03:24:22] start pushing at the cutting edge, you

[03:24:25] these the you can be digging down into

[03:24:27] the weeds of how these things work and

[03:24:29] be making huge performance optimizations

[03:24:32] and just be able to have more

[03:24:33] flexibility and literally do magic

[03:24:36] as a result of uh understanding

[03:24:39] foundational subjects. I do happen to

[03:24:40] have uh uh content online on all of

[03:24:45] those subjects u which will be easy to

[03:24:47] find. I'm not going to plug it directly.

[03:24:48] A lot of it is on my YouTube channel.

[03:24:50] Develop domain expertise. So this is

[03:24:52] specific to whatever you do. You work at

[03:24:53] an insurance company, you work at a

[03:24:55] healthcare provider. Understanding that

[03:24:57] business and its needs, understanding

[03:24:59] that domain expertise. So not just

[03:25:01] having your deep expertise in data

[03:25:03] science, but broad exposure across your

[03:25:06] domain. That is going to be invaluable

[03:25:08] as a data scientist as well. Developing

[03:25:10] human AI collaboration skills. So this

[03:25:12] is related to the multi- aent

[03:25:13] orchestration in a way, but it also it

[03:25:16] it doesn't need to be multi- aent. When

[03:25:18] I what I mean here with human AI

[03:25:19] collaboration skills, we're also talking

[03:25:21] about things like using LLMs wherever

[03:25:24] you can to be having a conversation to

[03:25:26] providing it to provide it with lots of

[03:25:28] context on problems that you're solving.

[03:25:30] You can be accelerating your own

[03:25:32] abilities uh you know code generation of

[03:25:34] course you should be taking advantage of

[03:25:36] tools like um like cursor which Ed uh

[03:25:39] demoed today. And I think this is my

[03:25:41] final bullet so I'm going to uh

[03:25:43] trepidaciously say finally. Um, also,

[03:25:47] uh, honing your communication and

[03:25:49] influence skills within an organization

[03:25:50] is key. So being able to not only

[03:25:55] understand the tech and your domain

[03:25:57] expertise and have this ability to come

[03:26:01] up with worldchanging, gamechanging,

[03:26:04] enterprise revolutionizing agentic

[03:26:07] ideas, but also being able to convince

[03:26:10] people that they should invest in that

[03:26:13] idea, time, resources, capital um so

[03:26:16] that you can make that and like I said

[03:26:18] near the beginning of this lecture,

[03:26:20] start small, get that little bit of

[03:26:23] success, be able to show return on

[03:26:25] investment in a relatively small AI

[03:26:27] project and then leverage that success

[03:26:29] to be tackling grander and grander

[03:26:32] projects and so you have this flywheel

[03:26:34] moving within your organization that

[03:26:36] allows you to make a bigger and bigger

[03:26:38] impact. And if we can do that together,

[03:26:41] if all of us in this room, maybe the

[03:26:43] people watching this on YouTube in the

[03:26:44] future, hello. Um, if all of us

[03:26:50] spend time on this magic that we are

[03:26:54] able to at any other time in history, if

[03:26:57] you could see that us sitting here in

[03:26:59] this room or us watching this video had

[03:27:02] the power that we have today, that is

[03:27:04] that would be magic. It's unbelievable.

[03:27:08] Um, before

[03:27:11] the GPT models came out, I didn't think

[03:27:16] it was a given that we would have the

[03:27:18] kinds of capabilities of like a GPT 3.5

[03:27:20] maybe in our lifetimes.

[03:27:23] And now all of a sudden, this magic is

[03:27:25] with us. If you can harness that and

[03:27:28] make an impact with it, we can in our

[03:27:32] lifetimes be living in a world that is

[03:27:36] uh so the best term is like a protopia

[03:27:39] where you're the idea of utopia. Thomas

[03:27:41] Moore, a British guy from centuries ago,

[03:27:43] he coined the term utopia. It actually

[03:27:45] means not place. It is an impossible

[03:27:48] place. But Protopia is this idea of

[03:27:52] continuous iteration and improvement and

[03:27:55] AI agents play a big part in that. The

[03:27:58] first thing that we need to crack is

[03:28:00] abundant energy. So if we have the

[03:28:01] potential for limitless intelligence,

[03:28:05] you combine that with unlimited energy

[03:28:07] effectively

[03:28:08] then that is a huge you know

[03:28:11] multiplicative effect. abundant super

[03:28:14] cheap super intelligence multiplied by

[03:28:17] abundant cheap energy that is a formula

[03:28:20] for crazy positive change in our world

[03:28:23] and AI can play a role in that energy

[03:28:26] transition making solar panels more

[03:28:28] efficient making battery storage more

[03:28:30] efficient uh allowing the liquid plasma

[03:28:33] to be contained by computational systems

[03:28:36] within a commercialgrade nuclear fusion

[03:28:39] reactor as opposed to the fision that we

[03:28:41] have today you know having a bunch of

[03:28:43] suns on our planet providing abundant

[03:28:45] energy. That changes everything. And

[03:28:47] once we have that, then we can have high

[03:28:49] quality nutrition for everyone on the

[03:28:51] planet. Um, we can have extended

[03:28:54] lifespans, uh, potentially dramatically

[03:28:58] extending our lifespans. Something

[03:29:00] there's a lot of people out there who

[03:29:01] think that aging is a disease like any

[03:29:03] other. Not every living animal ages. We

[03:29:07] don't necessarily have to resign

[03:29:08] ourselves to that fate. high quality

[03:29:10] education in the local language for

[03:29:12] everyone who wants to learn it uh and

[03:29:15] learn anything they want. Freedom from

[03:29:16] violence, freedom of expression,

[03:29:19] sustainability,

[03:29:21] cultural preservation, a sense of

[03:29:23] exploration for individuals, um and a

[03:29:26] sense of community. All of these things

[03:29:28] are possible in our lifetimes. This kind

[03:29:30] of protopia protopia that I'm

[03:29:32] envisioning and it can begin with, you

[03:29:34] know, the decisions you make today. the

[03:29:36] way that you harness the power, the

[03:29:37] magic that you have.

[03:29:40] So, thank you. That's the end.

[03:29:42] [Applause]

[03:29:43] [Music]

[03:29:46] [Applause]

[03:29:52] Yeah. So, thank you uh thank you to Ed.

[03:29:54] I'm going to have kind of my my contact

[03:29:55] stuff here and then Ed can go through

[03:29:57] his as well. We'll stay on for questions

[03:29:59] until 4:30. Um you know, and pass the

[03:30:02] mic around to get those as well. Um, so

[03:30:05] my name is John uh at johncone.com. You

[03:30:08] can sign up for my email newsletter.

[03:30:09] Pretty much all the content I create is

[03:30:11] free and so you can stay up to date on

[03:30:12] my latest with that. Connect with me on

[03:30:15] LinkedIn. I will I'll I might be able Ed

[03:30:18] accepts everyone. I don't accept

[03:30:19] everyone. Uh but if you mention that you

[03:30:21] were in this training today or we met at

[03:30:22] ODSC East or whatever, just mention ODSC

[03:30:25] in some way in your connect request and

[03:30:27] I will definitely uh accept that. My

[03:30:29] YouTube channel will be putting this

[03:30:31] video up from today. We have

[03:30:32] professional uh we have a professional

[03:30:34] film crew here. So, thank Lucy uh who's

[03:30:37] our director of photography. Thank you,

[03:30:38] Lucy. And Amanda's our second camera. Uh

[03:30:41] and it seems like everything went super

[03:30:43] smoothly. So, this is going to be a

[03:30:44] really nice uh edited uh thing. I'll put

[03:30:47] it up on my YouTube. There's also stuff

[03:30:48] on linear algebra and calculus on my

[03:30:50] channel if you're interested in that.

[03:30:52] Why Carrot? My company um we will be

[03:30:56] today. I'm not actually doing hiring,

[03:30:57] but it would be nice to start

[03:30:58] pipelining. We specialize in things like

[03:31:01] generative AI, agentic solutions for

[03:31:03] enterprises. And so do feel free uh to

[03:31:07] you know you can you can send me on

[03:31:09] LinkedIn a resume or johnycare.com

[03:31:12] send me a resume or talk to me here at

[03:31:14] the drinks afterward. And of course, uh,

[03:31:17] if you're actually looking for some

[03:31:19] consulting all the way from strategy all

[03:31:21] the way through to implementation, we

[03:31:23] also have representatives here from a

[03:31:24] partner of ours, Biz Love, uh, who are

[03:31:26] experts, long-standing experts at, uh,

[03:31:29] managing organizational chive

[03:31:33] technologies like AI. Um, and so yeah,

[03:31:36] we can do basically anything for your

[03:31:38] business related to AI. Super data

[03:31:39] science podcast. Ed already mentioned it

[03:31:41] many times kindly. Uh, it's the world's

[03:31:43] most listened to data science podcast.

[03:31:44] We do two episodes every week and uh

[03:31:46] have a lot of fun making that. Uh so

[03:31:48] check out the podcast and then I have uh

[03:31:51] I work as an ML practice fellow at

[03:31:54] Lightning AI which means that you here

[03:31:57] sitting in the audience you get a bonus

[03:31:59] for free just from sitting all the way

[03:32:00] to the end. If you take a photo of that

[03:32:03] QR code, it gets you uh it allows you to

[03:32:06] skip the waitness for skip the weight

[03:32:08] list for Lightning AI Studios, which

[03:32:10] provides access to the largest amount of

[03:32:13] compute that you could possibly need for

[03:32:14] training any kind of AI model um

[03:32:17] available immediately. And you get 15

[03:32:19] free compute credits per month uh to

[03:32:22] that Lightning AI Studios platform. And

[03:32:24] if you choose to, you don't need to pay

[03:32:26] for a paid version to get access to

[03:32:28] almost all all the technology. But if

[03:32:30] you want more credits, uh some more

[03:32:32] bells and whistles, there's a pro and

[03:32:33] with this QR code, you get 20% off your

[03:32:36] first month of Pro. So, uh those are all

[03:32:39] of my points. I'll hand over to Ed.

[03:32:41] Thank you.

[03:32:50] Once again, a tough act to follow. I do

[03:32:52] have to say that I've been getting uh

[03:32:54] constant my my phone keeps buzzing with

[03:32:56] trade decisions that are made

[03:32:57] constantly. It's been going for the last

[03:32:59] few minutes. Uh so I'm I'm Ed. Uh I I I

[03:33:03] have this course on Udemy in case you

[03:33:05] might not have mentioned it. Uh this is

[03:33:07] my LinkedIn and yes I I will immediately

[03:33:10] accept. I'll I'll be taking the train

[03:33:12] home in a bit and I will uh follow up

[03:33:14] with anyone that that connects with me.

[03:33:16] That would be fabulous. Uh I also have a

[03:33:18] website where I I have uh make a few few

[03:33:21] posts and have some YouTube stuff. And

[03:33:24] this is a link to the Udemy course and

[03:33:28] it has a coupon in that link uh just

[03:33:31] just exclusively for for people here. Uh

[03:33:34] and so it's also in GitHub as the link

[03:33:37] there. It takes some of what John and I

[03:33:40] went through and it expands on it and it

[03:33:42] also covers Langraph and Autogen as well

[03:33:45] and it goes through that same uh project

[03:33:47] at the end but in a bit more detail and

[03:33:50] uh with with some more updates to it as

[03:33:52] well. Uh and I just want to again uh

[03:33:55] echo John thank you all so much for

[03:33:57] staying till the bitter end. This was

[03:33:59] this was terrific fun and it was it was

[03:34:02] really really enjoyable session. So so

[03:34:04] thank you for spending the basically the

[03:34:06] whole day with us. Uh, and we'll be

[03:34:08] around if you've got questions.

[03:34:10] [Applause]
