Navigate Select ESC Close

Build an AI Agent From Scratch in Python - Tutorial for Beginners

2025-03-14 Education
569.5k
12.7k
462
Tech With Tim
Tech With Tim
2.0m subscribers

Unlock all features

FREE: Get instant access to 10 AI summaries, chats, or transcripts per day.

Description

Thanks to Microsoft for sponsoring this video! Submit your #CodingWithCopilot story for a chance to be featured in an upcoming video! In this video, you'll learn how to build an AI agent from scratch in Python. I'll walk you through everything step-by-step. This will be very beginner friendly, and you'll learn how to make something quite interesting in Python with some popular frameworks like LangChain. I'll show you how to use various LLMs like Claude or GPT, how you can give the agent access to various tools, and how you can structure the output of the agent so you can use it in your code. 🎞 Video Resources 🎞 Code in this video: https://github.com/techwithtim/PythonAIAgentFromScratch Learn Python Virtual Environments: https://www.youtube.com/watch?v=Y21OR1OPC9A Get Your Anthropic API Key: https://console.anthropic.com/settings/keys Get Your OpenAI API Key: https://platform.openai.com/api-keys ⏳ Timestamps ⏳ 00:00 | Overview 00:35 | Agent Demo 01:38 | Setup/Requirements 06:53 | Basic Code Setup/Imports 08:37 | Using Claude or GPT 10:00 | Getting Your API Key 11:32 | Basic LLM Functionality 12:43 | Structured Output/Models 15:42 | Prompt Templates 17:33 | Creating & Running the Agent 21:00 | Output Parsing 23:39 | Adding Prebuilt Tools 30:48 | Custom Tool Calling Hashtags #CodingWithCopilot #Sponsored

Top Comments (10)

@TechWithTim 2025-03-15

Want free coding challenges, sign up for my newsletter! https://techwithtim.net/newsletter

24 4 replies
@jorgeherrera1074 2025-06-08

Definitely the term “from scratch” has shifted in meaning over time.

222 6 replies
@ali_elkzaz1 2025-11-24

Fantastic video! I just built my first AI agent, and integrating it with Pneumatic Workflow was a breeze. Such a good match for productivity!

35
@Bisheswar.99 2025-11-24

The step-by-step format is great! I have a setup with Pneumatic Workflow for managing workflows, and the no-code aspect makes it super beginner-friendly!

22
@KNIGHTGAMING9900-o2c 2025-11-25

the coding part was clearer than i expected

3
@souvikdey279 2025-05-03

This was extremely helpful. I was scrolling through YouTube to get some help on creating agents. Found this gem! Thanks Tim!

7
@davedamerjian6035 2026-04-04

Tim ive been documenting videos on Google ADK and A2A protocol and running into your video has allowed me to "step back" and review some fundamentals on Agent creation using this langchain. Did I get all of it, no, did I get some of it, yes, could I get all of it if I watched this a few times, absolutely, do I need to do that right now, no, will I in the future, probably. The "review" of langchain was good for me as I have definitely touched on it before but as you progress you sort of forget stuff from the past thats important to know, and theres always different "layers" of understanding since you dont "get" everything the first time. Layered learning. Thanks a lot.

3
@johnpaine4316 2025-03-15

Outstanding video (again) Tim! I'm a civil engineer with an intertest in coding, not a coder or IT pro. Your approach is ideal, and much more useful than many other videos. With your instruction, I can actually do something very useful. Thank you!

74 2 replies
@Craftandcooking-t2b 2025-11-24

this made it way easier than i thought

1
@AmontepNew-s2k 2026-01-26

You knocked it out of the park with this one!

0

Unlock the Data Inside
Turn Videos into Knowledge

  • Get FREE 10/day: transcripts, summaries, chats
  • Chat with videos, export text & PDF
  • $1 free API credit for RAG, chatbots & research

Free forever plan • All features unlocked

App screenshot