Step-by-Step CrewAI Agent Build - Real Use Case! (Part 1)

00:28:31
https://www.youtube.com/watch?v=twzgEBabOBk

摘要

TLDRVideoclipul îl învață pe privitor cum să construiască un portal educațional AI de la zero folosind Crew AI, incluzând modele ca GPT-4 și perplexity, pentru a crea conținut educațional automatizat. Procesul începe cu configurarea unui mediu Python, instalarea Crew AI și integrarea diverselor API-uri pentru gestionarea sarcinilor. Autorul trece prin problema gestionării mediilor Python, dar folosește Lang Trace pentru a urmări costurile și performanța. De asemenea, explorează metode de accesare a datelor fără scraping web și ajustează agenții pentru a genera conținut detaliat. În viitor, dorește să adauge funcționalități suplimentare precum generarea automată de imagini și un agent de revizuire a conținutului.

心得

  • 🎓 Construirea unui portal educațional AI de la zero cu Crew AI.
  • 🤖 Utilizarea modelelor GPT-4 și perplexity pentru generarea conținutului.
  • 🔧 Configurarea și gestionarea unui mediu Python pentru proiecte AI.
  • 🛠️ Integrarea API-urilor pentru îmbunătățirea funcționalității.
  • 📊 Lang Trace pentru urmărirea costurilor și performanței AI.
  • 🌐 Alternative la scraping web cu ajutorul API-urilor.
  • 💡 Ajustarea agenților AI pentru conținut mai detaliat.
  • 📈 Modelul 01 Mini oferă rezultate mai bogate dar cu un cost ridicat.
  • 🔍 Necesitatea testării diverselor modele și costuri.
  • 🖼️ Planuri de extindere cu funcționalități de generare a imaginilor.

时间轴

  • 00:00:00 - 00:05:00

    În acest videoclip, autorul își propune să construiască un portal educațional automatizat folosind Crew AI, pornind de la zero. Acest portal va cuprinde ghiduri educaționale despre inteligența artificială, de la noțiuni de bază până la tutoriale avansate, fiecare ghid fiind completat de imagini și instrucțiuni detaliate. Pentru început, autorul își configurează mediul Python și instalează Crew AI și alte tehnologii necesare.

  • 00:05:00 - 00:10:00

    Autorul continuă cu configurarea Crew AI pentru a crea aplicația de bază în scopul portalului educațional. Selectează OpenAI ca furnizor și alege un model economic, GPT 40 mini, pentru a începe. Se confruntă cu întrebări legate de gestionarea mediului Python, dar reușește să aibă Crew AI funcțional, executând sarcini de cercetare și raportare de bază. De asemenea, menționează un sponsor, Mamut, care oferă acces la diverse modele AI.

  • 00:10:00 - 00:15:00

    După ce Crew AI este operațional, autorul întâmpină dificultăți în integrarea LangTrace din cauza problemelor de mediu Python, dar le remediază prin reinstituirea corectă a mediului. În continuare, își propune să utilizeze API-ul Perplexity pentru a facilita cercetarea web fără a apela la web scraping, însă întâmpină erori de conectare la API şi explorează documentația pentru a le rezolva.

  • 00:15:00 - 00:20:00

    La sfârșit, autorul reușește să integreze cu succes un alt model API și realizează o cercetare extinsă asupra modelelor mari de limbaj. Cu ajutorul lui Perplexity, obține un raport complus, dar decide să folosească un alt instrument de căutare mai eficient și să integreze Serper pentru a căuta informații actualizate pe web și pentru a îmbunătăți calitatea și cantitatea rapoartelor generate de Crew AI.

  • 00:20:00 - 00:28:31

    În ultima parte a videoclipului, autorul îmbunătățește definițiile agenților și sarcinile pentru a obține conținut educațional mai detaliat și relevant, schimbând modelele AI către versiunea mai costisitoare 01 pentru mai multă calitate. În urma testelor, observă creșterea costurilor dar, de asemenea, și îmbunătățirea semnificativă a calității raportului. Autorul intenționează să adauge un agent de revizuire și generarea de imagini în viitor.

显示更多

思维导图

Mind Map

常见问题

  • Ce este Crew AI?

    Crew AI este o platformă utilizată pentru a construi aplicații AI, permițând integrarea diverselor modele și gestionarea sarcinilor AI.

  • Care este scopul acestui video?

    Scopul video-ului este de a demonstra construirea unui portal educațional AI de la zero, utilizând Crew AI și alte tehnologii.

  • Ce modele AI sunt folosite în video?

    Video-ul utilizează modele AI precum GPT-4, perplexity, și 01 Mini pentru diferite sarcini în cadrul aplicației.

  • Care sunt pașii principali în construcția portalului educațional AI?

    Pașii principali includ configurarea unui mediu Python, instalarea Crew AI, integrarea cu API-uri (OpenAI, perplexity), și configurarea sarcinilor și agenților pentru a crea conținut educațional.

  • Ce dificultăți întâmpină autorul în gestionarea mediului Python?

    Autorul întâmpină dificultăți în gestionarea mediilor Python, inclusiv probleme cu modulele care nu sunt recunoscute sau instalate corect.

  • Cum ajută Lang Trace în acest proiect?

    Lang Trace este utilizat pentru a urmări interacțiunile și costurile API-urilor folosite în proiect, asigurându-se astfel de o gestionare eficientă.

  • Ce alternative la web scraping sunt discutate?

    În loc de web scraping, video-ul explorează utilizarea API-urilor precum perplexity și serper dev pentru accesarea datelor de pe web.

  • Cum îmbunătățește autorul conținutul generat de AI?

    Autorul ajustează agenții și sarcinile pentru a genera conținut educațional mai detaliat și mai relevant.

  • Care este avantajul utilizării modelului 01 Mini?

    Modelul 01 Mini oferă rezultate mai detaliate și comprehensive, dar la un cost mai ridicat comparativ cu alte modele.

  • Ce funcționalități suplimentare dorește autorul să adauge?

    Autorul dorește să adauge un agent de revizuire pentru a verifica acuratețea conținutului și să integreze generarea de imagini.

查看更多视频摘要

即时访问由人工智能支持的免费 YouTube 视频摘要!
字幕
en
自动滚动:
  • 00:00:00
    in this video we're going to build
  • 00:00:01
    something from absolute scratch using
  • 00:00:03
    crew AI this is going to be a real world
  • 00:00:06
    use case this is something that I need
  • 00:00:08
    to build I'll explain what it is and I
  • 00:00:10
    will show you step by step exactly how I
  • 00:00:13
    go about building it a lot of this stuff
  • 00:00:15
    I don't know exactly how I'm going to
  • 00:00:16
    build I'm going to be testing it I'm
  • 00:00:18
    going to be making mistakes and I'm
  • 00:00:19
    going to share it all with you we're
  • 00:00:20
    likely going to be using open AI models
  • 00:00:22
    including GPT
  • 00:00:24
    401 we're going to be using perplexity I
  • 00:00:27
    have a lot of ideas about how this
  • 00:00:29
    should go and so let me tell you what
  • 00:00:30
    we're going to be building today
  • 00:00:32
    something that me and my team have been
  • 00:00:33
    thinking about is building out an
  • 00:00:35
    educational portal basically all the
  • 00:00:37
    information that you need to become
  • 00:00:40
    proficient at AI everything from the
  • 00:00:42
    very Basics to very complex tutorials
  • 00:00:45
    and we want to automate a lot of it for
  • 00:00:47
    at least the first drafts so we're
  • 00:00:49
    looking to build out usually text based
  • 00:00:50
    educational content and tutorials
  • 00:00:53
    there's going to be images as well
  • 00:00:54
    stepbystep guides and I want a crew to
  • 00:00:56
    put that together for me so with that in
  • 00:00:58
    mind let's get started started so I'm
  • 00:01:01
    going to try to use cursor today I have
  • 00:01:04
    not really used cursor a lot in the past
  • 00:01:06
    I'm usually using VSS code but let's use
  • 00:01:08
    cursor and we're going to take this as
  • 00:01:10
    far as we can today we might make this a
  • 00:01:12
    part one out of two or three we'll see
  • 00:01:14
    so we'll take it as far as we can so the
  • 00:01:16
    first thing we need to do let's just
  • 00:01:18
    spin up a new cond environment because
  • 00:01:20
    python environment management is hard so
  • 00:01:23
    cond create - nedu python equals 3.12
  • 00:01:27
    proceed yes all right now we're just
  • 00:01:29
    going to act activate the new
  • 00:01:30
    environment cond to activate edu there
  • 00:01:32
    we go now let's install crew AI so pip
  • 00:01:36
    install crew AI all right so it's
  • 00:01:38
    installing crew AI next we're going to
  • 00:01:40
    install length trce so pip install
  • 00:01:42
    length tr- python D SDK okay so this is
  • 00:01:45
    all going into that cond environment
  • 00:01:47
    that we just created again always use
  • 00:01:50
    Python environment management whether
  • 00:01:52
    it's VM or cond or something else
  • 00:01:55
    because python environment management is
  • 00:01:57
    the bane of my existence all right so we
  • 00:01:59
    got both of those installed now
  • 00:02:01
    installing crew and getting it set up
  • 00:02:03
    really could not be easier so what we're
  • 00:02:04
    going to type is crew AI create crew and
  • 00:02:07
    we're going to call it edu the edu crew
  • 00:02:10
    and then hit enter and so what this is
  • 00:02:11
    going to do is create the skeleton of an
  • 00:02:13
    app for us it's going to put together
  • 00:02:14
    all the files we need and it just makes
  • 00:02:16
    things really easy and here we go
  • 00:02:18
    already so it downloaded everything we
  • 00:02:20
    need select the provider to set up so
  • 00:02:21
    we're actually going to use a number of
  • 00:02:23
    different providers today but let's
  • 00:02:25
    start with open AI okay so select a
  • 00:02:27
    model to use we'll use GP t40 mini we
  • 00:02:31
    want speed and we want low cost at least
  • 00:02:34
    for the start we'll experiment with
  • 00:02:36
    higher end more expensive models soon
  • 00:02:38
    okay now we need an API key so I'm on
  • 00:02:41
    open AI create a new key we're going to
  • 00:02:43
    call this edu and I'll create secret key
  • 00:02:46
    copy paste it in hit enter and there we
  • 00:02:49
    go so you could see it created all the
  • 00:02:51
    files that we need right away now we
  • 00:02:53
    need to open up this folder where all of
  • 00:02:55
    these things were created so let's do CD
  • 00:02:57
    edu and then aside from that we click
  • 00:02:59
    open a folder we're going to go to the
  • 00:03:01
    desktop select edu and there we go we
  • 00:03:04
    now have our crew up and running then I
  • 00:03:06
    just make sure the edu conduit
  • 00:03:08
    environment is active so there it is so
  • 00:03:10
    it should be working now here we can see
  • 00:03:12
    we have main.py crew. py the config
  • 00:03:15
    includes agents. yaml and tasks. yl now
  • 00:03:19
    out of the box it comes with two agents
  • 00:03:22
    and two tasks that it knows how to
  • 00:03:24
    execute so let's just take a look and
  • 00:03:27
    we're going to run it just to make sure
  • 00:03:28
    it works so we have the res Arch task
  • 00:03:30
    and the reporting task and basically
  • 00:03:32
    what it's going to be doing is research
  • 00:03:34
    on a topic and then giving us a report
  • 00:03:37
    in markdown on that topic we can see the
  • 00:03:40
    agents right here we have a researcher
  • 00:03:42
    agent and a reporting analyst agent
  • 00:03:45
    let's see what happens so before we run
  • 00:03:47
    it let's do crew aai install hit enter
  • 00:03:50
    okay so it's getting everything we need
  • 00:03:52
    installed we notice a new environment
  • 00:03:54
    has been created do you want to select
  • 00:03:56
    it for the workspace folder now I always
  • 00:03:59
    get confused at this question because I
  • 00:04:01
    was already in an environment I believe
  • 00:04:03
    it's asking me what environment the
  • 00:04:05
    actual code editor should be in so I'm
  • 00:04:06
    going to click yes we might have to fix
  • 00:04:08
    that later unfortunately and yeah if
  • 00:04:10
    anybody knows how to make python
  • 00:04:12
    environment management easier let me
  • 00:04:13
    know in the comments cuz still after
  • 00:04:15
    almost two and a half Decades of coding
  • 00:04:18
    this is very difficult for me today's
  • 00:04:20
    video is brought to you by mamut mammut
  • 00:04:23
    AI brings all of the best models
  • 00:04:25
    together in one place for one price
  • 00:04:28
    Claude llama G GPT 40 mraw Gemini Pro
  • 00:04:33
    and even
  • 00:04:34
    gpt1 and rather than having to pay for
  • 00:04:37
    each of these AI separately you pay $10
  • 00:04:40
    to mammut and they bring it all together
  • 00:04:42
    in one place plus they have image
  • 00:04:45
    generation mid Journey flux Pro Dolly
  • 00:04:48
    and stable diffusion again all for $10
  • 00:04:51
    models are frequently updated as soon as
  • 00:04:54
    they're released so be sure to check out
  • 00:04:55
    mamut for access to all the best models
  • 00:04:58
    for one low price m m. a that is m a m m
  • 00:05:02
    o u t h. AI thanks again to mamut and
  • 00:05:07
    then let's just test it out crew AI run
  • 00:05:10
    let's see if it works so running the
  • 00:05:12
    crew perfect so it is looking like it's
  • 00:05:13
    going to work okay so we actually got
  • 00:05:15
    some warnings invalid escape sequence
  • 00:05:19
    interesting but it doesn't look like
  • 00:05:21
    that really matters all that much okay
  • 00:05:24
    here we go we have an agent doing the
  • 00:05:27
    research really basic stuff so far we
  • 00:05:29
    just want to make sure it's working all
  • 00:05:31
    right and if we go to the report. MD we
  • 00:05:34
    can see the report was created
  • 00:05:36
    successfully Perfect all right again
  • 00:05:38
    very basic we're not actually hitting
  • 00:05:40
    the web at all we're not using any tools
  • 00:05:42
    you can add tools custom tools right
  • 00:05:45
    here custom tool.i you can add built-in
  • 00:05:48
    tools from Lang chain there's a lot that
  • 00:05:50
    we can do we're not quite there yet all
  • 00:05:52
    right now that we know it's working
  • 00:05:54
    let's make sure we can get Lang trce
  • 00:05:55
    installed correctly so I'm going to go
  • 00:05:57
    to Lang trace. I already have an account
  • 00:06:00
    let's sign in I'm going to create a
  • 00:06:03
    project this is going to be called edu
  • 00:06:06
    and as the project type I'm going to
  • 00:06:08
    select crew AI create project Okay click
  • 00:06:11
    setup project generate API key so I'm
  • 00:06:14
    going to select this initialization code
  • 00:06:16
    right here copy and we're going to put
  • 00:06:19
    that in
  • 00:06:20
    main.py at the very top right below the
  • 00:06:24
    import okay so it looks like L Trace
  • 00:06:26
    python SDK is not installed we did
  • 00:06:30
    install it of course python environment
  • 00:06:32
    issue so I'm going to try using the
  • 00:06:34
    built-in AI so AI fix and chat here we
  • 00:06:37
    go install the module okay look how slow
  • 00:06:40
    that's going all right we'll come back
  • 00:06:42
    to that in a moment so I suspect the
  • 00:06:45
    environment that is being used for the
  • 00:06:47
    actual editor is not the environment
  • 00:06:48
    that we installed everything on because
  • 00:06:50
    we have it installed so now let's see
  • 00:06:52
    what environment we're using so I'm
  • 00:06:53
    going to hit command shift p we're going
  • 00:06:55
    to look for interpreter python select
  • 00:06:58
    interpreter and we're going to to look
  • 00:07:00
    for our edu so there it is right there
  • 00:07:02
    so let's select that and perfect now
  • 00:07:05
    it's not underlined that was the issue
  • 00:07:07
    and it should be installed now so let's
  • 00:07:10
    run it again and let's see crew aai run
  • 00:07:13
    so I didn't save it in time so I'm going
  • 00:07:15
    to abort that and let's try to run it
  • 00:07:17
    one more time this time I actually saved
  • 00:07:19
    it all right yeah we're still getting
  • 00:07:21
    Ling Trace no module found issue I ran
  • 00:07:25
    into this exact same thing yesterday I
  • 00:07:27
    don't really understand but let's see so
  • 00:07:30
    it definitely looks like we're on the
  • 00:07:32
    correct environment at least for the
  • 00:07:34
    editor now why isn't it being found is
  • 00:07:37
    the question so I'm going to hit cond of
  • 00:07:38
    list I think that's it let's look for
  • 00:07:41
    Lang trace and there it is so it is in
  • 00:07:44
    the list so why isn't this working all
  • 00:07:46
    right I don't know what to do here so
  • 00:07:49
    let's see what happens if I just
  • 00:07:51
    actually instead of doing crew AI run
  • 00:07:53
    let's see what happens if I just run it
  • 00:07:55
    from main.py might not be the yeah okay
  • 00:07:58
    no module Maybe crewp is the right place
  • 00:08:00
    to start it
  • 00:08:02
    from nope all right after battling with
  • 00:08:06
    python environments for the last 25
  • 00:08:09
    minutes I think I finally got it working
  • 00:08:12
    yes there we go okay so what I had to do
  • 00:08:15
    is essentially get rid of cond wipe the
  • 00:08:17
    VM environment start from scratch and
  • 00:08:20
    then just make sure that the python
  • 00:08:22
    version matched make sure that the Lang
  • 00:08:24
    Trace SDK was installed properly the C
  • 00:08:27
    module was installed properly and now
  • 00:08:29
    now it works there we go so we have a
  • 00:08:32
    new report right there now let's get
  • 00:08:35
    back into the edu project and Lang trace
  • 00:08:37
    and there we go finally we got it
  • 00:08:39
    working okay all right so the next thing
  • 00:08:42
    I want to do is get perplexity installed
  • 00:08:45
    I don't really want to deal with web
  • 00:08:47
    scraping cuz that's always really hard
  • 00:08:49
    to do and so I'm going to try to use
  • 00:08:51
    perplexities API and just let it do the
  • 00:08:54
    research for me now I've not done this
  • 00:08:56
    before with crew so we'll see if it
  • 00:08:57
    works so here's perplexity let's
  • 00:08:59
    generate a new API key copy now we have
  • 00:09:02
    perplexity so the first thing I need to
  • 00:09:04
    do is set up a new llm and in the crew
  • 00:09:07
    aai docs it actually tells you how to do
  • 00:09:09
    it so we should be able to do it pretty
  • 00:09:11
    easily so we're going to copy this code
  • 00:09:13
    right here let's switch back to cursor
  • 00:09:15
    and we should be able to just paste it
  • 00:09:17
    in right here I'm going to move this
  • 00:09:20
    import I don't need to say this again so
  • 00:09:23
    I'm simply going to grab llm and add it
  • 00:09:25
    to the end there and we're going to be
  • 00:09:27
    defining a new llm perlex
  • 00:09:29
    I definitely want to use a different
  • 00:09:31
    model than this and then we also need
  • 00:09:32
    our API key here I don't need this cuz
  • 00:09:35
    we're going to Define it below so two
  • 00:09:38
    things let's figure out which model we
  • 00:09:40
    want to use and then let's also input
  • 00:09:43
    the API key there all right so API key
  • 00:09:46
    is right there and now let's figure out
  • 00:09:48
    what model we want to use so right here
  • 00:09:50
    learn more supported models now this is
  • 00:09:52
    very unhelpful when I click supported
  • 00:09:54
    models this is the page it takes me to
  • 00:09:55
    so not great but let's see if we can
  • 00:09:58
    find out Which models are available docs
  • 00:10:02
    supported models okay there we go so
  • 00:10:05
    interesting we are only going to be able
  • 00:10:08
    to use these models okay let's start
  • 00:10:13
    with this one llama 3.1 sonar large this
  • 00:10:16
    is kind of the perplexity based models
  • 00:10:19
    so I'm just going to copy it we'll see
  • 00:10:20
    switch back to cursor we're going to use
  • 00:10:24
    there we go llama 3.1 all right so let's
  • 00:10:28
    see if we can get this to work now now
  • 00:10:29
    the researcher we're going to add a new
  • 00:10:32
    parameter here llm equals and I'm
  • 00:10:35
    actually going to rename this to
  • 00:10:37
    perplexity llm and look at that that's
  • 00:10:40
    so nice cursor so I'm just going to hit
  • 00:10:43
    tab tab and it just fills out everything
  • 00:10:45
    for me that's so nice all right so let's
  • 00:10:49
    give it a try let's just see if that
  • 00:10:50
    works so I'm going to run it again so
  • 00:10:52
    now the researcher should have access to
  • 00:10:54
    the perplexity API and hopefully Lang
  • 00:10:57
    Trace also captures it all right right
  • 00:10:59
    so we got some errors let's see what
  • 00:11:01
    happened so I'm not sure what happened
  • 00:11:04
    there so I'm going to just copy all
  • 00:11:07
    these issues and ask it to tell me
  • 00:11:09
    what's going on add to chat what's the
  • 00:11:11
    error getting a 404 error which doesn't
  • 00:11:14
    sound right no it it is it's inputting
  • 00:11:18
    the right code here so either we didn't
  • 00:11:20
    set this up right or possibly it's not
  • 00:11:22
    an open AI compatible API endpoint but I
  • 00:11:25
    I think it is all right so what I'm
  • 00:11:26
    going to do just to make sure it works
  • 00:11:27
    is let's switch back to the previous
  • 00:11:31
    version of what it had here so we'll use
  • 00:11:32
    mraw 7B instruct okay I'll hit save
  • 00:11:36
    let's see if we can get this to work and
  • 00:11:38
    then we know we've narrowed down the
  • 00:11:40
    issue nope same thing ah I see I deleted
  • 00:11:43
    this part okay so add that back in hit
  • 00:11:46
    save and let's run it again running the
  • 00:11:48
    crew all right error again perplexity
  • 00:11:51
    exception 404 all right let's just make
  • 00:11:53
    sure that we can actually hit the API
  • 00:11:55
    successfully so I'm going to say write
  • 00:11:56
    me code to test this API endpoint to
  • 00:11:58
    make sure it's working all right so I'm
  • 00:12:00
    going to copy all of this let's create a
  • 00:12:03
    new file paste it in and I'll save it
  • 00:12:07
    test.py great let's run it all right
  • 00:12:10
    yeah so we're still getting a 404 error
  • 00:12:12
    code why is that it's pretty obvious
  • 00:12:14
    we're hitting the perplexity API
  • 00:12:16
    incorrectly let's check out the
  • 00:12:17
    documentation all right so I'm going to
  • 00:12:19
    copy the code and actually ask
  • 00:12:20
    perplexity what I'm doing wrong all
  • 00:12:22
    right there are several issues with it
  • 00:12:24
    here is the corrected code all right the
  • 00:12:28
    correct endpoint is that fine messages
  • 00:12:32
    expects an array okay let's just see if
  • 00:12:34
    that works so we're getting a new error
  • 00:12:35
    at least invalid model okay that's true
  • 00:12:39
    so let's change out the model name now
  • 00:12:41
    all right so let's use this model again
  • 00:12:43
    let's see if we can get this to work so
  • 00:12:45
    here's for the model boom let's hit play
  • 00:12:47
    and I think that's working this time
  • 00:12:49
    there we go perfect okay so now we know
  • 00:12:52
    it works so let's see how we can get
  • 00:12:55
    this to work back in our crew code so
  • 00:12:58
    I'm going to to instead just put the
  • 00:13:00
    model name the base URL let's leave the
  • 00:13:03
    same let's see if we have to add chat
  • 00:13:05
    completions to it so let's do crew AI
  • 00:13:08
    run okay yes perplexity exception 404 so
  • 00:13:13
    SL chat SL completions let's see if that
  • 00:13:16
    fixes it one more time let's run it nope
  • 00:13:19
    that did not work okay so I'm going to
  • 00:13:20
    set it back now slv1 still let's try
  • 00:13:25
    asking perplexity again so now I say I
  • 00:13:27
    I'm trying to get crew AI to use the
  • 00:13:29
    perplexity API and getting a 404 error
  • 00:13:31
    using this code so enter let's see if
  • 00:13:33
    that can give us the solution okay
  • 00:13:36
    here's the corrected code the base URL
  • 00:13:38
    should be without V1 okay let's try that
  • 00:13:41
    let's remove the V1 right there okay add
  • 00:13:44
    the correct endpoint ah I see okay let's
  • 00:13:48
    add the correct endpoint hopefully that
  • 00:13:51
    is a thing and make sure you're using
  • 00:13:53
    one of the supported models wow I got to
  • 00:13:55
    say perplexity is excellent as a coding
  • 00:13:58
    assistant all right let's give it a try
  • 00:14:00
    now let's see if that works and if not
  • 00:14:03
    we'll pipe it back in and see if it can
  • 00:14:06
    correct it again so crew AI run let's go
  • 00:14:10
    is it working I think it might be
  • 00:14:12
    working it's definitely doing something
  • 00:14:15
    yes yes it worked amazing all right good
  • 00:14:19
    progress and let's see what we were able
  • 00:14:22
    to get out of it this time are we going
  • 00:14:24
    to get better research let's find out
  • 00:14:26
    okay so putting together everything now
  • 00:14:28
    good let's the report okay so we have
  • 00:14:30
    report. MD here we go comprehensive
  • 00:14:33
    report on current and emerging large
  • 00:14:35
    language models GPT 40 with multimodal
  • 00:14:38
    capabilities Falcon 180b which is kind
  • 00:14:40
    of old llama 2 llama 3 dbrx so basically
  • 00:14:44
    gave me a list of models that's okay all
  • 00:14:48
    right let's check the traces let's just
  • 00:14:50
    make sure everything looks good there so
  • 00:14:52
    I'll go over to Lang Trace let's refresh
  • 00:14:54
    the page and here we go so we can see
  • 00:14:57
    that it is using interesting Lama 3.1
  • 00:15:00
    one yep okay so that's right the large
  • 00:15:02
    versions it's using GPT 40 mini let's
  • 00:15:05
    click into it we can see the traces here
  • 00:15:08
    and then we can also see the cost over
  • 00:15:11
    here look at that absolutely just cheap
  • 00:15:15
    great great great okay so let's
  • 00:15:18
    experiment with some models now let's
  • 00:15:20
    use the bigger version of the perplexity
  • 00:15:22
    model to see if we get better results so
  • 00:15:25
    we'll take the huge version right there
  • 00:15:27
    and let's use use that right there we're
  • 00:15:30
    still going to use GPT 40 mini to put
  • 00:15:33
    together the report but let's see let's
  • 00:15:36
    actually take a look at what we're
  • 00:15:37
    getting back from perplexity and let's
  • 00:15:40
    go back to the trace so let's click in
  • 00:15:43
    let's see where it's actually grabbing
  • 00:15:46
    the perplexity here's open AI where's
  • 00:15:48
    perplexity okay so one thing that's not
  • 00:15:51
    actually clear is if the perplexity API
  • 00:15:54
    is actually using live web data because
  • 00:15:57
    all of the information it gave me like
  • 00:15:59
    nitron I guess that's more recent but
  • 00:16:03
    like Bloom and Falcon 180b these are old
  • 00:16:06
    models so let me see let's see if we can
  • 00:16:08
    change it to make sure we're getting the
  • 00:16:10
    latest and actually I'm going to ask
  • 00:16:12
    perplexity if it uses the web through
  • 00:16:14
    the API so does the perplexity API
  • 00:16:16
    search the web like the regular
  • 00:16:18
    interface does so it doesn't support Pro
  • 00:16:20
    search that's okay it does use the same
  • 00:16:23
    search subsystem it currently only
  • 00:16:25
    supports the sonar models the API search
  • 00:16:28
    cap capabilities are more limited okay
  • 00:16:30
    so that's fine maybe search is available
  • 00:16:33
    through the chat GPT API all right so is
  • 00:16:36
    chat GPT search available through the
  • 00:16:37
    open AI API let's see no it is not okay
  • 00:16:41
    so I think we're going to have to use
  • 00:16:45
    something else to do web search so let's
  • 00:16:47
    ask what's the best web search tool for
  • 00:16:52
    crew AI all right serper Dev tool EXA
  • 00:16:55
    duck duck search or duck ducko search
  • 00:16:58
    should say let's use serper I think
  • 00:17:01
    that's fine so we need to install crew
  • 00:17:04
    AI tools so let's do that so pip install
  • 00:17:07
    crew AI brackets tools hit enter nope
  • 00:17:10
    that did not work what what am I doing
  • 00:17:13
    wrong here okay ah I got it wrong okay
  • 00:17:16
    so there's no quotes there let's try to
  • 00:17:18
    install it again boom there we go okay
  • 00:17:21
    so now that that's installed first I'm
  • 00:17:24
    just going to comment out this
  • 00:17:25
    perplexity llm let's comment this out
  • 00:17:29
    okay so now it's using GPT 40 mini still
  • 00:17:31
    but now we're going to give it the
  • 00:17:32
    ability to actually search the web okay
  • 00:17:34
    so it actually gives us a good example
  • 00:17:36
    here so let's go ahead and copy that all
  • 00:17:39
    right so here we're going to paste that
  • 00:17:43
    so from crew AI tools import and we
  • 00:17:47
    really only need the serer dev tool so
  • 00:17:49
    let's get rid of these other ones for
  • 00:17:51
    now all right so we will need a serer
  • 00:17:53
    API key okay so serer dodev let's do
  • 00:17:57
    sign up and here we are okay let's see a
  • 00:18:01
    python example we don't really need that
  • 00:18:04
    we just really need the API key so let's
  • 00:18:07
    grab one copy all right so let's set
  • 00:18:11
    this so let's put the key there so we
  • 00:18:14
    set it as an environment variable let's
  • 00:18:17
    go ahead and put this under where we
  • 00:18:19
    actually call the serer tools we don't
  • 00:18:21
    have OS installed or called I should say
  • 00:18:25
    uh AI fix and chat and we just need to
  • 00:18:27
    import it yeah okay so we'll import it
  • 00:18:30
    at the very top under these boom so that
  • 00:18:34
    should work and now we have to
  • 00:18:36
    instantiate the tools so I'll copy that
  • 00:18:39
    under here put it right there okay
  • 00:18:42
    hopefully this is the right order we'll
  • 00:18:43
    fix it if it's not and now for our
  • 00:18:46
    researcher we're going to give the
  • 00:18:47
    researcher a tool tool Search tool
  • 00:18:50
    perfect okay now let's see what happens
  • 00:18:54
    if we just run it like that cre AI run
  • 00:18:57
    okay yeah look at that it is returning
  • 00:18:59
    search results beautiful so now we get
  • 00:19:02
    up-to-date information still kind of
  • 00:19:04
    boring the output it's giving but that's
  • 00:19:06
    okay we just want to make sure this
  • 00:19:07
    stuff is working now all right it's done
  • 00:19:09
    let's look at the report comprehensive
  • 00:19:11
    report on current trends in ai llms
  • 00:19:13
    multimodal ai agentic ai open source
  • 00:19:16
    llms small language models ethics
  • 00:19:18
    enhanced contextual length Okay I think
  • 00:19:21
    this is actually looking better much
  • 00:19:22
    better actually okay next let's give it
  • 00:19:24
    a topic I'm actually going to want to
  • 00:19:25
    use all right so we're not going to use
  • 00:19:26
    perplexity sorry perplexity you're out
  • 00:19:28
    of there we don't need this llm right
  • 00:19:31
    there right now all right so first I'm
  • 00:19:33
    going to get rid of this API key cuz I
  • 00:19:35
    don't want it in my actual code I'm
  • 00:19:36
    going to put it in the environment
  • 00:19:37
    variable okay so help me put this inm I
  • 00:19:40
    know how to do this I'm just going
  • 00:19:41
    through the steps here I kind of like
  • 00:19:43
    using the AI to make it foolproof for me
  • 00:19:45
    okay so add the API key so apply okay so
  • 00:19:49
    let's make sure it's in there boom look
  • 00:19:51
    at that that's so cool okay let's make
  • 00:19:54
    sure M has it it doesn't why don't you
  • 00:19:57
    have it there except cep load. M all
  • 00:20:00
    right so we need to import OS there we
  • 00:20:02
    also need to do Fromm load. M okay that
  • 00:20:07
    should be good now but it's not in here
  • 00:20:10
    oh there we go look at that cursor's so
  • 00:20:12
    good all right so we put all the keys
  • 00:20:15
    here we need one more key now so let's
  • 00:20:17
    go to crew and let's do that here so we
  • 00:20:21
    actually have to run install python. M
  • 00:20:23
    so we'll do that in a moment I'm going
  • 00:20:24
    say put this in the m file okay so serer
  • 00:20:30
    API key apply beautiful okay so yep
  • 00:20:34
    accept it once again we are going to
  • 00:20:36
    need to import M and then we need to add
  • 00:20:41
    this let's apply apply the key to M file
  • 00:20:44
    okay one click it's done all right good
  • 00:20:47
    okay so now we've gotten rid of all our
  • 00:20:49
    API keys from our main files and of
  • 00:20:51
    course let's add it to get ignore and it
  • 00:20:53
    already is okay good now let's run it
  • 00:20:55
    one more time just to make sure
  • 00:20:56
    everything works yes good good good now
  • 00:20:59
    while that's running let's look at some
  • 00:21:00
    of the traces all right so the last run
  • 00:21:03
    it is using GPT 40 mini only we see some
  • 00:21:07
    tool usage really nice look at that all
  • 00:21:09
    right and then let's see the cost too
  • 00:21:11
    it's very inexpensive right now now of
  • 00:21:14
    course if we use one of the 01 models
  • 00:21:15
    it'll become much more expensive but we
  • 00:21:17
    might get a lot better results let's see
  • 00:21:18
    what happens all right so it worked now
  • 00:21:21
    let's look at the report one more time
  • 00:21:23
    cost effective models weaponization
  • 00:21:26
    concerns okay so it actually gave me
  • 00:21:27
    something completely different cuz it's
  • 00:21:29
    such a broad topic that I defined in
  • 00:21:31
    main.py this is the topic AI llms so
  • 00:21:35
    broad now let's do something much more
  • 00:21:37
    specific all right so for the topic I'm
  • 00:21:39
    going to say basics of how retrieval
  • 00:21:41
    augmented generation Works let's run it
  • 00:21:44
    I'm going to do this once and then I'm
  • 00:21:45
    going to switch the model out for 01
  • 00:21:47
    mini and see if we just get a better
  • 00:21:49
    response out of it okay so doing a bunch
  • 00:21:51
    of web search perfect review the context
  • 00:21:53
    you got and expand each topic into a
  • 00:21:55
    full section for a report make sure it's
  • 00:21:57
    detailed and of course we haven't even
  • 00:21:59
    changed the definitions of the agents so
  • 00:22:02
    we'll take a look at that too actually
  • 00:22:04
    before this video is done all right so
  • 00:22:05
    it finished let's look at the report
  • 00:22:07
    retrieval augmented generation
  • 00:22:09
    definition and purpose good two-phase
  • 00:22:11
    operation Good integration with llms
  • 00:22:14
    okay this is actually pretty good it's
  • 00:22:16
    not that expansive so let's just look at
  • 00:22:19
    the definitions agents first your season
  • 00:22:22
    researcher senior data researcher let's
  • 00:22:24
    just say it's a senior researcher cuz I
  • 00:22:26
    don't want it to just be a data
  • 00:22:28
    researcher
  • 00:22:29
    and then uncover Cutting Edge
  • 00:22:31
    developments no so right incredibly
  • 00:22:34
    compelling educational content on this
  • 00:22:36
    topic so actually I'm going to add and
  • 00:22:38
    comprehensive boy I think I'm a convert
  • 00:22:41
    to cursor it is awesome you're a season
  • 00:22:44
    researcher with a knack for uncovering
  • 00:22:46
    the latest developments for uncovering
  • 00:22:48
    so it's not really the latest
  • 00:22:49
    developments so what I'm going to say
  • 00:22:51
    instead is you're a seasoned researcher
  • 00:22:55
    with a knack for putting together the
  • 00:22:58
    most
  • 00:22:59
    relevant information for educational
  • 00:23:02
    content on topic okay known for your
  • 00:23:05
    ability to find the most relevant and
  • 00:23:08
    comprehensive information and present it
  • 00:23:10
    in a clear and concise manner okay and
  • 00:23:12
    then for the reporting analist I think
  • 00:23:15
    I'm going to rewrite it as I'm going to
  • 00:23:17
    leave the name the same I don't want to
  • 00:23:18
    change it so let's say educational
  • 00:23:21
    content creator actually I am going to
  • 00:23:23
    change it here okay educational content
  • 00:23:26
    creator so since we Chang the name there
  • 00:23:27
    let's go to crew
  • 00:23:29
    .p and right there let's change it to
  • 00:23:33
    that okay yes educational content
  • 00:23:36
    creator boom boom okay I think that
  • 00:23:40
    looks good so we have the researcher and
  • 00:23:42
    the content creator now let's make sure
  • 00:23:45
    everything under here looks good create
  • 00:23:47
    detailed reports so create detailed and
  • 00:23:50
    compelling educational content based on
  • 00:23:53
    topic topic and research findings you're
  • 00:23:56
    a meticulous analyst no uh you're a
  • 00:23:59
    educational content creator with a key
  • 00:24:01
    eye for detail you're known for your
  • 00:24:02
    ability to turn complex data and topics
  • 00:24:06
    into clear and concise educational
  • 00:24:08
    content making it easy for others to
  • 00:24:09
    understand and act on the information
  • 00:24:10
    you provide okay perfect let's go to
  • 00:24:13
    task let's see research task conduct
  • 00:24:15
    research make sure you find interesting
  • 00:24:17
    and relevant information for the given
  • 00:24:19
    year is 2024 okay expected output a
  • 00:24:24
    thorough research report on topic agent
  • 00:24:28
    okay reporting task review the context
  • 00:24:31
    you got and expand each topic into a
  • 00:24:33
    full section for a educational content
  • 00:24:36
    piece make sure the report is detailed
  • 00:24:38
    and no so I don't think it's a report
  • 00:24:41
    make sure the content is detailed yep
  • 00:24:43
    okay a fully fledged Report with the
  • 00:24:47
    main topics each with a full section of
  • 00:24:50
    information formatted as markdown great
  • 00:24:53
    reporting analyst that is not correct
  • 00:24:56
    gosh look at that look how it already
  • 00:24:58
    knows I should have switched that
  • 00:25:00
    wonderful all right let's give it a try
  • 00:25:02
    crew a run and then we're going to try
  • 00:25:04
    the 01 model okay so doing a bunch of
  • 00:25:06
    research McKenzie and Company Acorn Labs
  • 00:25:08
    we8 look at that wonderful getting
  • 00:25:11
    scraping in is easy it turns out okay
  • 00:25:15
    conclusion so got a bunch of information
  • 00:25:17
    put together a report great all right so
  • 00:25:19
    it's done let's go back to the actual
  • 00:25:22
    report and let's see what it did
  • 00:25:24
    understanding retrieval augmented
  • 00:25:26
    generation okay so it gives me a summary
  • 00:25:28
    at the top how it works great so
  • 00:25:31
    retrieval phase generation phase output
  • 00:25:34
    okay this is really good I want more
  • 00:25:36
    information though I want it more
  • 00:25:38
    comprehensive so let's see if we can
  • 00:25:40
    coax it into doing that and then I'm
  • 00:25:41
    going to switch it over to 01 all right
  • 00:25:43
    it says concise here so clear and
  • 00:25:46
    comprehensive I don't want concise all
  • 00:25:49
    right in a clear and
  • 00:25:51
    comprehensive manner let's make sure I
  • 00:25:54
    know I say comprehensive a few times so
  • 00:25:56
    let's just make sure doesn't have
  • 00:25:59
    concise anywhere else it doesn't okay
  • 00:26:01
    great now let's use the 01 model and see
  • 00:26:04
    if that works so for the researcher
  • 00:26:07
    that's fine we don't need a great model
  • 00:26:09
    for the actual research or maybe we do
  • 00:26:12
    let's do 01 mini across the board so llm
  • 00:26:16
    equals 01 mini it should just work like
  • 00:26:18
    this we have our researcher let's do it
  • 00:26:21
    here as well there we go okay and let's
  • 00:26:25
    run it again and then I'm going to check
  • 00:26:27
    Lang Trace to check the trace see what
  • 00:26:29
    it cost see how many tokens it used
  • 00:26:31
    let's see if it works all right so it is
  • 00:26:35
    working good good good agents final
  • 00:26:38
    answer so of course we're not going to
  • 00:26:40
    see The Chain of Thought cuz I think
  • 00:26:42
    that would break our interaction using
  • 00:26:44
    crew AI That's okay all right there it's
  • 00:26:47
    done good good good okay so now let's
  • 00:26:50
    check out the report wow look at this
  • 00:26:53
    very nice it gave us different types of
  • 00:26:56
    content this is a very very
  • 00:26:59
    comprehensive report benefits question
  • 00:27:03
    answering systems chat yeah this is by
  • 00:27:06
    far the best results so far
  • 00:27:09
    introduction amazing amazing yep okay
  • 00:27:13
    potential impact so this is fantastic I
  • 00:27:16
    think there's a couple things I want to
  • 00:27:17
    do but I'm going to save it for the next
  • 00:27:18
    video so one thing is let's try some
  • 00:27:21
    other models let's make sure we need the
  • 00:27:23
    01 model maybe we don't seems good
  • 00:27:26
    though I think I also want to implement
  • 00:27:27
    a a reviewer agent so not just output
  • 00:27:31
    something I want an agent to actually
  • 00:27:34
    review the content make sure it is
  • 00:27:36
    accurate make sure that it is explained
  • 00:27:38
    in a really simple way I also want to
  • 00:27:41
    try to get some images maybe we can
  • 00:27:43
    actually create some graphics on the Fly
  • 00:27:45
    that would be awesome so there's a
  • 00:27:47
    number of things that I want to add to
  • 00:27:48
    this so one more thing that I want to
  • 00:27:50
    show you before I wrap up this video
  • 00:27:51
    let's go to Lang Trace now we can see 01
  • 00:27:54
    mini right there so let's scroll across
  • 00:27:57
    this this one cost a lot more 58 cents
  • 00:28:02
    in output cost 4 cents in input cost so
  • 00:28:06
    you can see orders of magnitude more
  • 00:28:09
    expensive to use the 01 Mini model but
  • 00:28:12
    the report itself is also much better so
  • 00:28:15
    that's the tradeoff and I think what
  • 00:28:16
    we're going to have to do is just do a
  • 00:28:18
    bunch of testing different models
  • 00:28:20
    different price points different speeds
  • 00:28:22
    different costs and we'll see what
  • 00:28:24
    happens but for now I think that's it if
  • 00:28:26
    you enjoyed this video please consider
  • 00:28:28
    giving a like And subscribe and I'll see
  • 00:28:30
    you in the next one
标签
  • AI
  • educație
  • aplicații AI
  • Crew AI
  • Python
  • integrare API
  • web scraping
  • modele AI
  • automatizare
  • gestionare medii