Introducing Swarm with Code Examples: OpenAI's Groundbreaking Agent Framework

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 64

  • @epokaixyz
    @epokaixyz 2 місяці тому +21

    Consider this your cheat sheet for applying the video's advice:
    1. Understand routines: Define clear steps for your agents to follow, like a to-do list.
    2. Implement handoffs: Enable agents to seamlessly transfer conversations to other specialized agents.
    3. Utilize agents: Treat them as specialized workers with unique skills.
    4. Leverage tools: Equip your agents with tools that extend their capabilities.
    5. Inject context: Personalize interactions by providing agents with relevant user data.
    6. Explore the Swarm GitHub repository: Dive into the code, examples, and documentation.
    7. Experiment with OpenAI Cookbook: Find recipes and examples for building with OpenAI APIs.

  • @RichardOlowalu
    @RichardOlowalu 2 місяці тому +3

    Thank you very much Sam, this is the first content I have watched from you and I am now following. On Sunday while working with a colleague I realized I needed this functionality and here it is - amazing. Best regards, Richard

  • @____2080_____
    @____2080_____ 2 місяці тому +3

    They’ve been great frameworks that already taken this concept to a far more mature level.
    Of course, this is stuff that we all look at and see if it’s a piece of our puzzle or we continue using what we’ve been using

    • @____2080_____
      @____2080_____ 2 місяці тому

      The really interesting thing that there’s been a product repo out there called “agency swarm“ that is a mature form of what open AI has put out here. 26:13

  • @JBoy340a
    @JBoy340a 2 місяці тому +4

    Thanks Sam. Framework looks interesting

  • @justinwinter
    @justinwinter 2 місяці тому +6

    Really appreciate how light weight this approach is compared to langgraph. Straight Python is a lot easier to grok than 45 layers of abstractions like some of the other frameworks

    • @samwitteveenai
      @samwitteveenai  2 місяці тому

      I totally agree.

    • @gremlinsaregold8890
      @gremlinsaregold8890 2 місяці тому

      @@justinwinter I'd agree... But problem is... Will it be around for any longer than pi*sing time? Openai themselves are not supporting it... That said it's an open source git so the code is there.

    • @justinwinter
      @justinwinter 2 місяці тому

      @@samwitteveenai When you get a chance, might be worth checking out phidata if you haven't already. Just did a few experiments with their framework and it has a lot of flavor of swarm but with some useful declarative abstractions. It's still lightweight enough that it doesn't get in the way. Did a very quick to-do-list tutorial recently on my channel if interested.

  • @micbab-vg2mu
    @micbab-vg2mu 2 місяці тому +6

    Swarm is very easy to use - I am waiting when an option of adding o1 models (as main agent) will be available.

    • @PaulHaster
      @PaulHaster 2 місяці тому

      Can't you just create o1 model and pass it to Swarn constructor?

  • @unclecode
    @unclecode 2 місяці тому

    Few more flights to state and back to your home, you will release your SAAS Flight agent business :D Beautiful content as usual. Thx Sam.

  • @vitalis
    @vitalis 2 місяці тому +3

    people should give agency swarm some credit as well which is what this is based on. Just doing my bit.

  • @adityahpatel
    @adityahpatel Місяць тому

    Hi Sam, Thanks. One quesiton = If an agent has 3 tools and they are to be invoked sequentially. How exactly does the output of tool 1 go into tool 2 as input? I don't see context_variable being updated. So how does that happen magically?

  • @holthuizenoemoet591
    @holthuizenoemoet591 2 місяці тому +3

    Cool, what are some other multi-agent frameworks? can you model economic system with multi-agents?

  • @apester2
    @apester2 2 місяці тому +1

    Handoff + Agents is the separation of concerns for the AI era.

  • @tacticalgaryvrgamer8913
    @tacticalgaryvrgamer8913 2 місяці тому +38

    It's not a framework. It's a glorified example of super basic code. Relax.

    • @amortalbeing
      @amortalbeing 2 місяці тому +1

      @@NathanielKrefman would you name a few? its really appreciated

    • @tornyu
      @tornyu 2 місяці тому +1

      Ok sure, but it's a good design. Call it a pattern if you like but it's good!

    • @requestfx5585
      @requestfx5585 2 місяці тому +3

      ​@@amortalbeingcrewai, autogen, I don't know any other but there are a lot. And swarm is literally a joke, the source code is minimal, probably around 500 lines which is just nothing, you can code it yourself which I have also done and in typescript instead of python. My implementation is more versatile can use multiple models and have model fallback feature so when a model does not work it chooses a different one and auto model select feature which selects a model based on the task (not agent) since an agent does not always require the best model 10/10 times but if it does it switches

    • @amortalbeing
      @amortalbeing 2 місяці тому

      @@requestfx5585 thanks a lot really appreciate it 🌹

    • @theh1ve
      @theh1ve 2 місяці тому

      It's the most underwhelming thing ever, nothing new here move along...

  • @vbywrde
    @vbywrde 2 місяці тому +2

    What I'm curious about though with OpenAI's version is... what differentiates it from AutoGen or Crew AI?

    • @samwitteveenai
      @samwitteveenai  2 місяці тому +3

      I would say that it much more light weight than those, but it is also missing a lot of things like any state system etc.

    • @SHEIK_MOHIDEEN
      @SHEIK_MOHIDEEN 2 місяці тому

      Does crew ai has state system?

  • @drçokbilmiş
    @drçokbilmiş 2 місяці тому

    Is this API KEY has to be gpt-4o? If yes is there any way of using Azure api key?

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w 2 місяці тому

    can we use RAG with this?

  • @43seconds
    @43seconds 2 місяці тому +2

    But their API has rate-limits for Requests-Per-Minute. Wouldn't this completely blow that out?

    • @samwitteveenai
      @samwitteveenai  2 місяці тому +4

      not anymore than any other way to use/create agents.

  • @keithkeith2106
    @keithkeith2106 2 місяці тому

    Don’t laugh at my question! 😊 Might it be possible and practical to use swarm to calculate a multi step mathematical equation with multiple inputs?

  • @nufh
    @nufh 2 місяці тому

    This is so cool.

  • @wesleymogaka
    @wesleymogaka Місяць тому

    I like openAI's nomenclature of Triage, handoffs etc. However you can still do this easily using plain python. I copied this way of agent building and I am currently building a bank chatbot.

  • @mickelodiansurname9578
    @mickelodiansurname9578 2 місяці тому +1

    Basically this is one of those try and example script, rub chin, nod and move on... fine I'll do that, when I'm not busy using production ready stuff.

    • @samwitteveenai
      @samwitteveenai  2 місяці тому +2

      Kinda have to checkout what they are thinking. What are you using for production?

    • @mickelodiansurname9578
      @mickelodiansurname9578 2 місяці тому

      @@samwitteveenai well the plan in Trello (next sprint) is CrewAI... but I'm so 'not all for' depending on new external librarys on a commercial project. The problem is every single AI leveraging library is new. The OPenAI API voice thing also looks fantastic for my use case... then again will they keep it, shelve it, change it? what? It would solve a shed load of latency issues for me... and the agent system the same.... but for all we know OpenAi just up and change direction a month from now. (Project is called BandyBuddy Sam, you can look it up online or here on YT)

    • @mickelodiansurname9578
      @mickelodiansurname9578 2 місяці тому +1

      tried replying there and UA-cam removed the comment... lets see how this one goes?
      Edit: okay well that posted. So the plan is crewAi, but then of course we are locked into depending on a crucial and third party library - and also the OpenAI voice thing looks fantastic for the BandyBuddy project... but again will openAi shelve that? or change it? or increase the price (and its not cheap)... but the agent thing and the voice would solve the latency issue of voice control.

    • @gremlinsaregold8890
      @gremlinsaregold8890 2 місяці тому +1

      ​@@mickelodiansurname9578Cool your building a karaoke app ith AI.. so when will it be ready?

    • @mickelodiansurname9578
      @mickelodiansurname9578 2 місяці тому

      @@gremlinsaregold8890 Well we are 'supposed to have' an MVP by the week leading up to Christmas. If you fancy yourself as a legend in your bedtime, add yourself to the waitlist... and remember... the world is your lobster!

  • @jamesgphillips91
    @jamesgphillips91 2 місяці тому +1

    how is this better than langchain? why would i opt to being vendor locked?

    • @samwitteveenai
      @samwitteveenai  2 місяці тому +3

      I wouldn't say it is vendor lock in too much, this can be changed to work with open models etc and at the end of the day it is just python. In many ways it is easier to make something custom compared to LangChain. That said if you have something that is working no need to switch

    • @jozonas
      @jozonas 2 місяці тому +1

      @@samwitteveenaithis. Life would be so much easier if we noticed that we don’t need to argue about what is better. Thanks for showing us another option to choose from.

    • @jamesgphillips91
      @jamesgphillips91 2 місяці тому +1

      @@samwitteveenai thanks for the answer. Ima try it in my next project!

  • @Sonic2kDBS
    @Sonic2kDBS 2 місяці тому +2

    I think informing the user, if the agent has switched could be the better way. It even could prevent some anger of the user. You then can see, if the Agent didn't get your Reuest or it is another instance, where the Agent can't know. Also if the Agent is switched and you know that and the Agent is asking something, you had already answered, it is more clear, why that is. Some easy hint, like: "Agent switched." would do the job.

    • @samwitteveenai
      @samwitteveenai  2 місяці тому +2

      you could certainly do this in the UI etc. that would be your choice. nothing in the framework is stopping that.

  • @Osxsar
    @Osxsar 2 місяці тому +1

    So why is this better than using one agent?

  • @ibrahimhalouane8130
    @ibrahimhalouane8130 2 місяці тому +4

    This word sounds familiar to me! @vrsen right? building a product on top of ONE vendor's product is high business risk, unless you have a plan to survive somehow? and that's why I wrote to him to decouple his framework from the assistant api.
    Does it work with open LLMs?

    • @samwitteveenai
      @samwitteveenai  2 місяці тому

      out of the box doesn't work with open models but can be changed easily enough. Also there are a few OpenSwarm frameworks out there now as well.

  • @el_arte
    @el_arte 2 місяці тому

    That’s similar to my framework, but not as expressive or cross platform.

  • @impolitevegan3179
    @impolitevegan3179 2 місяці тому

    Are they trying to get the open source benefits without open-sourcing their models? If so, I hope the community does not fall for it.

  • @kevon217
    @kevon217 2 місяці тому +1

    what does a Spanish meow even sound like?

  • @renovacio5847
    @renovacio5847 2 місяці тому

    Groundbreaking?

  •  2 місяці тому

    Still wish we could get away from Python. It's absolutely horrible with its dependencies and versions.

    • @holthuizenoemoet591
      @holthuizenoemoet591 2 місяці тому +3

      what would you use instead?

    • @RichardOlowalu
      @RichardOlowalu 2 місяці тому

      I think that Open AI has a NODE.js example as well...

    •  2 місяці тому

      @@holthuizenoemoet591 Golang most probably. Builds one static executable and is fast.

  • @iceshoqer
    @iceshoqer 2 місяці тому

    Can we stop promoting this word, what weird word to use, Spawn, horror movie like.

    • @samwitteveenai
      @samwitteveenai  2 місяці тому +1

      I certainly didn't pick it. 😀

    •  2 місяці тому +1

      Why? It perfectly encapsulates what it is about.

    • @iceshoqer
      @iceshoqer 2 місяці тому

      No it doesn’t, and there are better words than one trying to sound cool.

    •  2 місяці тому

      @@iceshoqer Ok, whatever...