Building AI Agents in Pure Python - Beginner Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • Want to get started as a freelancer? Let me help: www.datalumina...
    Additional Resources
    📚 Just getting started? Learn the fundamentals of AI: www.skool.com/...
    🚀 Already building AI apps? Get our production framework: launchpad.data...
    💼 Need help with a project? Work with me: www.datalumina...
    🔗 GitHub Repository
    github.com/dav...
    🔗 Other links
    www.anthropic....
    platform.opena...
    🛠️ My VS Code / Cursor Setup
    • The Ultimate VS Code S...
    ⏱️ Timestamps
    2:45 Basic API Call
    5:10 Structured Output
    8:00 Using Tools
    18:31 Memory and Retrieval
    24:35 Building an AI Calendar Agent
    34:59 Prompt Chaining
    37:56 Routing Requests
    41:57 Parallelization
    46:18 Deploying Your AI Application
    📌 Description
    In this tutorial, we’ll cover everything you need to start building AI agents in pure Python. We’ll start with the essential building blocks and then dive into workflow patterns for more reliable systems. To follow along, basic Python skills are recommended, along with familiarity with the OpenAI SDK and an API key. I highly recommend cloning the GitHub repository so you can work through the code step by step. Watch me go through it first, then try it yourself to reinforce your understanding. I move quickly to cover a lot in 45 minutes, but you can always pause, rewind, or ask ChatGPT for help.
    👋🏻 About Me
    Hi! I'm Dave, AI Engineer and founder of Datalumina®. On this channel, I share practical tutorials that teach developers how to build production-ready AI systems that actually work in the real world. Beyond these tutorials, I also help people start successful freelancing careers. Check out the links above to learn more!

ความคิดเห็น • 78

  • @sapiensmagno
    @sapiensmagno 7 วันที่ผ่านมา +44

    it's clear to see that you build real world production apps unlike most people making videos about hot tools out there. most of these tools don't work as expected, are very unstable to use in production and make things more complex than they need to be. congrats for your sensible approach

    • @pchernik
      @pchernik 6 วันที่ผ่านมา +2

      100%. Great to see in-depth quality videos like this! One downside of the "AI revolution" is all the "make money fast with AI" videos out there that LOOK professional, but lack any depth.

    • @daveebbelaar
      @daveebbelaar  6 วันที่ผ่านมา

      Appreciate it! 🙏🏻

    • @radhikawadhawan4235
      @radhikawadhawan4235 5 วันที่ผ่านมา

      @@daveebbelaar 100@ agree, that this channel is one of the few channels who actually make practical sense

  • @Dominator837
    @Dominator837 6 วันที่ผ่านมา +4

    You are one of a kind sir. It is rare when I am learning from someone and nearly everything explained "clicks" immediately. You got me up to speed so fast on building with AI. Thank you! I may actually buy your launchpad (which I've never done before haha)

  • @ArnoJansen
    @ArnoJansen 4 วันที่ผ่านมา +3

    What is your weather policy:
    {"answer":"We do not have a weather policy as we are an e-commerce store and do not have control over external weather conditions. However, our delivery times may be affected by inclement weather or other external factors.","source":0}
    Than you by the way for this great tutorial ! I learned so much from this

  • @alvarogonzalez2112
    @alvarogonzalez2112 6 วันที่ผ่านมา +3

    One of the best current communicators of AI content.

  • @jdmcivicrrr
    @jdmcivicrrr 4 วันที่ผ่านมา +4

    This is an awesome video. I've been learning to use pydanticAi, but I really appreciate you showing how to build agent workflows from scratch as it can be really useful to know. Would love to see more content like this as frameworks such as langchain and crewAi are so high-level, you don't know what's happening. Pure python or even pydanticAi is the way to go! ❤

  • @MuhammedBasil
    @MuhammedBasil 6 วันที่ผ่านมา +1

    This is the most comprehensive tutorial I found on llm agents. Thank you !
    Looking forward to learn a lot from you.

    • @daveebbelaar
      @daveebbelaar  6 วันที่ผ่านมา

      Awesome, thank you!

  • @luizosorio
    @luizosorio 6 วันที่ผ่านมา

    Thank you so much, Dave! This video taught me all the essential concepts I needed to develop my application using LLMs. Your clear explanations and practical insights are incredibly valuable, and I'm sure you're helping far more people than you can imagine. Keep up the amazing work!

  • @lLvupKitchen
    @lLvupKitchen วันที่ผ่านมา

    I envy the people who can watch this as they start building with LLMs. I've wasted so many hours using pre-made systems trying to figure out what's happening inside the box. This is the way to go.

  • @micbab-vg2mu
    @micbab-vg2mu 7 วันที่ผ่านมา +6

    Thanks for the video - at the moment I use pure Python as well - )

    • @RobShocks
      @RobShocks 7 วันที่ผ่านมา

      Totally, more control, more understanding

    • @wesleymogaka
      @wesleymogaka 6 วันที่ผ่านมา

      Same here!

  • @skyrayzor3693
    @skyrayzor3693 7 วันที่ผ่านมา +2

    Your videos are at next lvl, easy and simple to understand. Keep up the good work. Thank you for wonderful content.👍

  • @MicaelPereira
    @MicaelPereira 6 วันที่ผ่านมา

    Thank you for the videos! finding videos on AI systems/solutions that are actually useful and reliable is not easy. This is orders of magnitude better than 99% of videos I've watched on AI "agents".

  • @EmaSuriano
    @EmaSuriano 6 วันที่ผ่านมา

    Such a nice video! I totally agree with you every single week there is a new framework to build agent with IA and it's become very overwhelming sometimes. Thanks a lot for the clear explanation and for taking the time to make this long video. I watched entirely and followed your code locally as well :)

    • @daveebbelaar
      @daveebbelaar  6 วันที่ผ่านมา

      Yes! Thank you!

  • @pavellegkodymov4295
    @pavellegkodymov4295 4 วันที่ผ่านมา

    Brilliant way of explanation! Purified value, with no unnecessary complications.

  • @habiabie38r43h8ndzn
    @habiabie38r43h8ndzn 6 วันที่ผ่านมา

    Great!! Keep making videos like this ! I have always wondered how it works . You make it lot easier and clear path to study further . Thanks !!!

  • @Malxelemento
    @Malxelemento 6 วันที่ผ่านมา

    I like your approach. I tought the same as you and I fall into the trap of pydanthic ai (pydanthic made it so it should be “native”) but is still too young and now im sticking to native and close to original platform as possible. Thanks for the vids. Love youe content 🎉

  • @bencipherx
    @bencipherx 3 วันที่ผ่านมา

    I have a simple question, take for instance you built a multi tool agent, where human feedback is allowed, and of course has memory. How do you make the model not skip overlapping questions.
    Example:
    Human: I need to make some purchase
    AI: what would you like to buy
    Human: do you guys have any coupon
    AI: yes we do, pls check this link
    (Normally AI is supposed to revert back to unanswered question here, but my AI built using PydanticAI won’t do this, even with a reasoning model.)
    Human: thank you
    AI: you’re welcome, I’m here if you need any other thing.

  • @SolutreanHypothesis
    @SolutreanHypothesis 7 วันที่ผ่านมา +1

    really great content, as usual on your channel, thank you!

    • @daveebbelaar
      @daveebbelaar  7 วันที่ผ่านมา

      I appreciate that!

  • @awakenwithoutcoffee
    @awakenwithoutcoffee 7 วันที่ผ่านมา +1

    👏excellent like usual

  • @IzzazIskandar
    @IzzazIskandar 4 วันที่ผ่านมา

    Great tutorial, can’t wait to try. Thanks so much for your work, it helps me in mine.

  • @deepak5074
    @deepak5074 7 วันที่ผ่านมา +1

    great video need more like such video and deployment too

  • @BigTuna_Kahuna
    @BigTuna_Kahuna 6 วันที่ผ่านมา

    This is amazing. Thank you so much for sharing this knowledge. It helps tremendously.

  • @philgeek572
    @philgeek572 7 วันที่ผ่านมา +1

    Excellent video as always! What documentation would you suggest to understand how to do message and response handling for a local LLM package (like ollama) instead of the openai package?

    • @daveebbelaar
      @daveebbelaar  6 วันที่ผ่านมา

      Check this out: python.useinstructor.com/examples/ollama/

  • @stuboo
    @stuboo 7 วันที่ผ่านมา +4

    Superb as always. Hopefully we'll get to see you teach the orchestrator pattern as well. Thanks, Dave.

    • @daveebbelaar
      @daveebbelaar  7 วันที่ผ่านมา +1

      Thanks! You can check out the code in the repo. There's an example there. It's a little trickier. We don't really use it in our production applications yet.

  • @christiannmas
    @christiannmas 7 วันที่ผ่านมา

    Amazing video! Thanks for all the info you are putting out.

  • @ying7526
    @ying7526 4 วันที่ผ่านมา

    Super cool you explained the common patterns

  • @jamalmazar8826
    @jamalmazar8826 6 วันที่ผ่านมา

    Great video, extremely useful thank you. Would love more videos on pydantic

  • @ZLibrary-k6r
    @ZLibrary-k6r 6 วันที่ผ่านมา

    Awesome contribution 👍

  • @thatfootyman2
    @thatfootyman2 วันที่ผ่านมา

    As a student, i want to learn about the AI agents and where to apply them. Is there any way to test these API’s w free of cost ? I tried to do an API call and it just showed error - free credits already used up :/ This was the first API call and I was kinda excited to see the output. Is there anyway to use these API’s for free for a bit to test them out ? Great video btw 💯

  • @pankajbokdia
    @pankajbokdia 5 วันที่ผ่านมา

    Lovely video! Thank you so much for sharing :)

  • @uxaiagency
    @uxaiagency 7 วันที่ผ่านมา

    Super, voorbij de hype. Thanks Dave!

  • @anigarzat7
    @anigarzat7 5 วันที่ผ่านมา

    Great video thanks! How do you run your Python scripts on internet on the web?

  • @Teapot_418
    @Teapot_418 6 วันที่ผ่านมา

    People use tools like LangChain or Vercel AI SDK mainly because they can easily switch between different AI services. You usually only need to change one line to use a different service.

    • @daveebbelaar
      @daveebbelaar  6 วันที่ผ่านมา +4

      We use the Instructor Library for that. LiteLLM or PydanticAI are also good options for this. I didn't cover that in this video, but those are good to unify the API call.

  • @iliassafilal5041
    @iliassafilal5041 5 วันที่ผ่านมา

    What do you think about open operator
    Is it considered as an AI agent or no?

  • @Adrian-dp7vq
    @Adrian-dp7vq 6 วันที่ผ่านมา

    Thanks a lot.

  • @cassette-guy
    @cassette-guy 7 วันที่ผ่านมา +1

    Great video, thanks a lot!
    iyo, what are the downsides of platforms such as n8n?

    • @alexanderderiy1182
      @alexanderderiy1182 6 วันที่ผ่านมา

      takes way longer to create and debug all the nodes - ironically

    • @cassette-guy
      @cassette-guy 6 วันที่ผ่านมา

      @@alexanderderiy1182 got it!
      It seems that it's made for shorter and personal workflows rather than running an agency based on it.
      I think n8n is good for showing prototypes to less technical people before moving on to more solid solid solutions like the one offered here.

  • @milutinke
    @milutinke 6 วันที่ผ่านมา

    How reliable structured outputs are now?
    I remember when I used to work with GPT 4, I had to give it a really good prompt, an example of generated JSON and then try-catch around parsing and have a retry mechanism if the output was not correct.

    • @daveebbelaar
      @daveebbelaar  6 วันที่ผ่านมา +1

      With Pydantic it's really reliable

    • @milutinke
      @milutinke 6 วันที่ผ่านมา

      @@daveebbelaar Thanks.

  • @shubhammate245
    @shubhammate245 6 วันที่ผ่านมา +2

    can you make tutorial on making ai voice assistant for customer cares and other stuff using python and chatgpt

    • @bilalharoon-g4f
      @bilalharoon-g4f 6 วันที่ผ่านมา

      Yes , it will be great if you can create a video for AI voice assistant

  • @divyv20
    @divyv20 4 วันที่ผ่านมา

    Hey Dave , really nice video! I was wondering if I could help you with more Quality Editing in your videos with good pricing & turnaround time and will also make a highly engaging Thumbnail which will help your video to reach a wider audience ! Lmk what you think ?

  • @mosheezderman3778
    @mosheezderman3778 6 วันที่ผ่านมา

    @dave I also noticed that tools never get included when I use response_format
    example:
    completion_2 = client.beta.chat.completions.parse(
    model="gpt-4o",
    messages=messages,
    tools=tools,
    response_format=KBResponse,
    )
    WehenI remove response_format tools get included. Maybe bug in open AI

  • @RakeshRout-x8w
    @RakeshRout-x8w 2 วันที่ผ่านมา

    How to provide a memory or context awareness to it?can you help us do that?

  • @nitingaur1707
    @nitingaur1707 4 วันที่ผ่านมา

    how env var are loading for you? for me I have to use dotenv like below
    from dotenv import load_dotenv
    load_dotenv(dotenv_path="./.env") # take environment variables from .env

  • @mosheezderman3778
    @mosheezderman3778 6 วันที่ผ่านมา

    @dave Great video. thank you for sharing. In your tools example I dont think we need to append message in the tool call loop:
    for tool_call in completion.choices[0].message.tool_calls:
    name = tool_call.function.name
    args = json.loads(tool_call.function.arguments)
    messages.append(completion.choices[0].message)
    I believe it need to be outside the for loop?

  • @petarvukovic1181
    @petarvukovic1181 6 วันที่ผ่านมา

    But what about graph parallele execution without sequential execution.I meant what is your opinion about langgraph and graph state frameworks?

  • @Aleksandr-e9e
    @Aleksandr-e9e 4 วันที่ผ่านมา

    Hi!
    following your example, I'm running at VSCode win10 the code line by line in the Interactive Window.
    However, instead of seeing all the intermediate variable values like you do, I only see two lines: import os and ['Alice', 'Bob'].
    I can't get it to show the results of the other lines without using print(). Any ideas what might be wrong?

  • @AbhayBisht-eb6qd
    @AbhayBisht-eb6qd 2 วันที่ผ่านมา

    isnt the sequential and router flow more like a ai powered pipeline ?

  • @uniqueavi91
    @uniqueavi91 5 วันที่ผ่านมา

    The data freelancing is not available in the Asia region, if its freelancing, may I join the North America community being physically present in Asia?

  • @SulavSingh
    @SulavSingh 3 วันที่ผ่านมา

    Awesome breakdown, Dave! 🔥 Love how you structured this for real-world AI builds. We’re working on LLMShotgun-an automation & prompting tool for devs-and would love to explore a collab. Think your audience would find it useful? Would be great to chat!

  • @dom2555
    @dom2555 6 วันที่ผ่านมา +3

    Is it me or this way of being "agentic" is mostly irrelevant/hype/cope? If I need to code 5000 functions and use an llm just to interface in natural language with the user to retrieve values of variables and build the entire logic myself, it's mostly the same old way of doing stuff... I need the llm to *write* the functions (and they will), else sure, I can make user experience a bit more pleasant in certain cases, but I might as well just build a workflow/use buttons and input trees, etc. the good "old" (current) way.

    • @AScientist-dr7lu
      @AScientist-dr7lu 6 วันที่ผ่านมา

      Yeah I will agree upon this , I feel we are not utilising Ai at its fullest with this. also we are limited with token window like one can’t afford this llm services into his workflows without spending huge money and more problem I see it’s over reliance on llm service providers it can became potential single point of failure if llm service goes down

    • @dom2555
      @dom2555 6 วันที่ผ่านมา

      @@AScientist-dr7lu + it opens all sorts of dead ends in the flowchart, while usually you'd validate user inputs and variables values.

    • @Patrick-wn6uj
      @Patrick-wn6uj 5 วันที่ผ่านมา

      The thing you get the power of language understanding, imagine how hard it would be to scrape a web page and write some code to make sense of it, discard irrelevant info and remain with the exact info you need from that page, but with context and a prompt that is like eating a cheese cake for an llm

    • @dom2555
      @dom2555 5 วันที่ผ่านมา

      @@Patrick-wn6uj all that stuff is already automated, nothing to do with "agentic" ai that many VCs and pumpers in the field are coping with.

  • @yvesete7949
    @yvesete7949 3 วันที่ผ่านมา

    Super cool video and very helpful. I can program (python, C, C++, etc) but I am not a developer. Working with an API is not a problem but I could not figure yet out how to program such an agent and run it locally on a LLM. Can any body help or know a youtube video about it?

  • @Amazon-Best-Deals-1
    @Amazon-Best-Deals-1 6 วันที่ผ่านมา +2

    "Let your hustle speak louder than your doubts."

  • @is_adjekofori
    @is_adjekofori 5 วันที่ผ่านมา

    who has a link to the antropic blog post

    • @daveebbelaar
      @daveebbelaar  5 วันที่ผ่านมา

      www.anthropic.com/research/building-effective-agents

  • @Cine95
    @Cine95 5 วันที่ผ่านมา

    Great video but No need to use openai when you have much cheaper and better models out there

  • @marekdzurak1867
    @marekdzurak1867 6 วันที่ผ่านมา

    not all Hearoes wear a cap