Creating an AI Agent with LangGraph Llama 3 & Groq

  Рет қаралды 23,289

Sam Witteveen

Sam Witteveen

Күн бұрын

This video picks up from the previous video and we convert the last Agent to be a LangGraph Agent and make it a bit more advanced. Still using Groq & Llama3 70B for the LLM
Colab: drp.li/X3hpZ (code)
🕵️ Interested in building LLM Agents? Fill out the form below
Building LLM Agents Form: drp.li/dIMes
👨‍💻Github:
github.com/samwit/langchain-t... (updated)
github.com/samwit/llm-tutorials
⏱️Time Stamps:
00:00 Intro
00:22 LangGraph Ecosystem
02:17 LangGraph Video
02:30 LangGraph Concepts
05:03 LangGraph Workflow
10:40 The Goal
12:17 Utility Function
12:46 Basic Chains
19:17 Tool Setup
19:39 Setting Up LangGraph State
20:50 Nodes
25:23 Conditional Edges
26:52 Build the Graph

Пікірлер: 53
@wadejohnson4542
@wadejohnson4542 12 күн бұрын
Finally! A presentation on LangGraph that makes sense. Sign me up for any of your courses. I value your work.
@an4aWebBasedSoftware
@an4aWebBasedSoftware 11 күн бұрын
great, solid base concepts! converting from colab to code is the perfect exercise to digest what you explained. Thank you !
@marcintabedzki3578
@marcintabedzki3578 13 күн бұрын
Fantastic intro to langgraph. It's awesome how well you explain this complex topics. Keep up the good work! Cannot wait more real life examples with rag.
@kai_s1985
@kai_s1985 13 күн бұрын
Please make a video where rag is used! Most companies use their own data to answer questions rather than web search.
@samwitteveenai
@samwitteveenai 13 күн бұрын
I will I just realized it was going to be so long (time wise) for this one after explaining the LangGraph stuff. Probably next vid or early next week.
@austinpatrick1871
@austinpatrick1871 12 күн бұрын
Yes I 100% agree
@adithiyag4616
@adithiyag4616 11 күн бұрын
Replace the tool like search with custom chain(which does rag) Congratulations, you successfully implemented RAG using agents
@akhilsrivastava3371
@akhilsrivastava3371 12 күн бұрын
Superb intro. Thanks for making such amazing content
@sayanosis
@sayanosis 13 күн бұрын
Excellent video as always ❤
@mr.daniish
@mr.daniish 9 күн бұрын
I have finally understood LangGraph!
@teprox7690
@teprox7690 12 күн бұрын
Thank you so much. I'm so happy that I found your content! ❤❤❤❤
@samwitteveenai
@samwitteveenai 10 күн бұрын
Thanks, glad it is helpful
@el_arte
@el_arte 13 күн бұрын
In this contrived example, it doesn’t look like LangGraph adds a lot of value, but requires quite a bit of setup. I mean, a simple script with no opaque marshaling and a few conditionals could achieve the same thing.
@yac7571
@yac7571 7 күн бұрын
Could you elaborate on this? Instead of using langgraph here, how would you write this application?
@dylanlapierre9000
@dylanlapierre9000 6 күн бұрын
I was thinking this same thing. I actually built a moderately complex rag chatbot with various conditionals as you mention calling what I guess you can think of as tools. It really makes me rethink what the term “AI AGENT” even means.
@jerryyuan3958
@jerryyuan3958 11 күн бұрын
Great work
@Munk-tt6tz
@Munk-tt6tz 9 күн бұрын
I've learned so much from you, thank you so much!!!
@SolidBuildersInc
@SolidBuildersInc 8 күн бұрын
Thanks for your Birds Eye View of tying it all together. It has definitely relaxed my mind to have a structured approach that makes since. With this structure, I wonder if it can be built from a control sheet.............. which would introduce a DRY/RAD approach for AI.
@maggiethedog
@maggiethedog 9 күн бұрын
Hi Sam. I love your content! I don't know if this is the proper way to report this, but in the colab notebook, the function def for 'route_to_rewrite' has the line 'research_info = state["research_info"]' which throws a runtime error, and the variable is not referenced in this module. Removing that line fixes the problem. Keep up the fantastic work Sam!
@samwitteveenai
@samwitteveenai 7 күн бұрын
thanks I will update it. I tend to write these pretty quick 😀
@freedtmg16
@freedtmg16 13 күн бұрын
Dude keep it up. This is gold i only ask you build this stuff in a codebase like you might see in production. I find it really difficult to transfer code from ipynb to a vscode project, call it a mental block, and maybe I'm alone in feeling like this.
@AndreiSheard
@AndreiSheard 12 күн бұрын
I only have an iPad and an android phone so the fact he's doing all of this in Colab at the moment is a god- send haha A lot of other youtubers covering this stuff use VSCode. But, he's a great communicator so I definitely understand your request.
@jdallain
@jdallain 13 күн бұрын
Really great examples for routing. It’s kinda hard to get that down from the LangGraph examples
@riveww
@riveww 13 күн бұрын
Awesome vid Sam! Question on the Schema Parsing and retrying that you do. It looks like moving on from a node requires the LLM to output a particular schema (like JSON with particular keys). Are there easy integration points with Pydantic/Instructor so we can be sure of our output schemas with retry logic while getting the benefits of LangGraph’s simple flow abstractions?
@Alan0707
@Alan0707 12 күн бұрын
It's great ! BTW, if there's a complex graph, it's hard to build the relations without a map
@daniell.6463
@daniell.6463 10 күн бұрын
Great video! I really like how clean and professional your diagrams look. What tool are you using to create them? I've tried Graphviz before but the results just aren't as polished and engaging. Would love to know your process for making such appealing visuals. Keep up the awesome work!
@samwitteveenai
@samwitteveenai 10 күн бұрын
thanks for the kind words I am using Excalidraw for the diagrams. Super easy to use as well. Check it out.
@daniell.6463
@daniell.6463 6 күн бұрын
@@samwitteveenai thank you!
@theh1ve
@theh1ve 13 күн бұрын
Would you say Sam it would be better to use LangGraph from the get go. It seems straight forward enough and it wpuld appear you can get up and running quickly. I just dont see the point going through CrewAI first then transition to LangGraph? Another great video too love your work!
@el_arte
@el_arte 12 күн бұрын
⁠I slept over this and I now see a trend where people are obsessed with having any API interaction assisted or mediated by a LLM. It reminds me of the era of XML, when everyone wanted to use XML markup for everything, including network protocols. There’s a need to enable LLMs to interface with tools to extend their capabilities, but forcing natural language into every interaction seems a little weird. And, defining graphs to gate-keep reasoning flows seems brittle and limiting.
@chainweaver
@chainweaver 9 күн бұрын
This is fantastic. Can the steps in LangGraph be captured by Langsmith? is there a way you could show this. Debugging through Langsmith these steps would be awesome
@andreyseas
@andreyseas 12 күн бұрын
This is great. BTW, what do you use for a tool to design these flows to explain them?
@samwitteveenai
@samwitteveenai 10 күн бұрын
Thanks for the kind words I am using Excalidraw for the diagrams. Super easy to use as well. Check it out.
@samansaadzadeh1833
@samansaadzadeh1833 9 күн бұрын
Thanks for video, I was getting key error when test for the other email when it needs to use the def route_to_rewrite(state). look like the research_info key is not required for def route_to_rewrite(state).
@chainweaver
@chainweaver 9 күн бұрын
Curious whether this could also work in a Chatbot experience. So in this example you had an email trigger the event but could this work if a user wanted more functionality but within a Chat experience. Maybe you might have some ideas on how that might actually work.
@peterdecrem5872
@peterdecrem5872 12 күн бұрын
Thank you for the video. I think the graph allows to go write_draft_email->categorize_email->rewrite_email and rewrite_email assumes that state contains research_info (which I would not based on this path) or did i misread that? This seems to be a way to sidestep the lack of langchain tool support in groq (which I did not find - although there is tool support ) Thank you.
@samwitteveenai
@samwitteveenai 10 күн бұрын
It does a check after the categorize email if it needs research and then does research then a draft email and then another decision point for if it needs to rewrite. It is not using tools support as a function call, just using that Llama3 can handle JSON well and using that. You could also write some checking and retrying in there as well.
@TzaraDuchamp
@TzaraDuchamp 11 күн бұрын
Excellent explanation Sam, thanks. I have run the script with other models on Groq and got some errors. Have you tried to run it with models like "Mixtral-8x7b-32768", and "Gemma-7b-It"? Your last implementation with CrewAI seemed more robust, for me it ran with all models on Groq.
@samwitteveenai
@samwitteveenai 10 күн бұрын
This is super interesting as I didn't try this with those models, but I have done a bunch of stuff with Gemma and found it needed quite a bit of fine tuning to get it going with Agents. Thanks for testing it with the other models.
@TzaraDuchamp
@TzaraDuchamp 10 күн бұрын
Yes, your code runs without errors with Gemma, but that model and Llama 3 8b can't handle the agentic aspect with the given code. They report 'Agent stopped due to iteration limit or time limit.'. This adversely affects the BTC price inquiry mail response. Mixtral 8x7b runs well and handles the agentic aspect. Llama 3 70b can become a bit congested (waiting list, though haven't had it with the API) due to popularity, so it's a good option to have. I would be interested in you exploring Llama 3 8b's agentic prowess.
@FinGloss
@FinGloss 13 күн бұрын
Can you show how to integrate with Gmail and to run locally with our own data ? Also, how to train on our own data. THANKS
@stephenzzz
@stephenzzz 13 күн бұрын
Sam, question if you don't mind. My wife wants to have her sales information content incorporated behind a chat/RAG to answer questions from her content. Which system out there do you think would work best, that is low code for a non-dev. Ideally next part will be to access this via a membership website.
@samwitteveenai
@samwitteveenai 13 күн бұрын
I am not up really on all the latest no code solutions, and privacy would be a big issue here. I do think Notion has done some really nice cool things with their adoption of RAG across all your databases etc
@jarad4621
@jarad4621 9 күн бұрын
Can we use this process somehow to search the web and do research? Can't find this anywhere
@ps3301
@ps3301 11 күн бұрын
Instead of email, u should try to demonstrate langgraph using stock research agents!
@samwitteveenai
@samwitteveenai 10 күн бұрын
Have thought about doing this. Might take another look at it.
@thedatascientist-lg4ls
@thedatascientist-lg4ls 9 күн бұрын
That's great, how about using an email from an account other than typing and passing the email prompt as it happens in the real world.
@Salionca
@Salionca 13 күн бұрын
Dark mode, please. Thanks.
@54peace
@54peace 13 күн бұрын
Can I implement the same logic using JS instead??
@samwitteveenai
@samwitteveenai 13 күн бұрын
I think so but I haven't got around to trying LangGraph in JS.
@nhtna4706
@nhtna4706 13 күн бұрын
What is groq’s role here ?
@samwitteveenai
@samwitteveenai 11 күн бұрын
It's serving the Llama3 70B model on their platform. Gives you much faster inference speeds
@greendsnow
@greendsnow 13 күн бұрын
Does anybody have unlimited groq api? Mine is not active.
Adding RAG to LangGraph Agents
23:57
Sam Witteveen
Рет қаралды 6 М.
LangGraph Crash Course with code examples
39:01
Sam Witteveen
Рет қаралды 50 М.
The World's Fastest Cleaners
00:35
MrBeast
Рет қаралды 116 МЛН
Лизка заплакала смотря видео котиков🙀😭
00:33
Let's all try it too‼︎#magic#tenge
00:26
Nonomen ノノメン
Рет қаралды 18 МЛН
Master CrewAI: Your Ultimate Beginner's Guide!
1:00:18
Sam Witteveen
Рет қаралды 51 М.
How to AUTOMATE LINKEDIN POSTS with CrewAI | CrewAI Tutorial
22:39
The Neural Maze
Рет қаралды 3,8 М.
How To Connect Llama3 to CrewAI [Groq + Ollama]
31:42
codewithbrandon
Рет қаралды 19 М.
"okay, but I want Llama 3 for my specific use case" - Here's how
24:20
World’s Fastest Talking AI: Deepgram + Groq
11:45
Greg Kamradt (Data Indy)
Рет қаралды 28 М.
Python Advanced AI Agent Tutorial - LlamaIndex, Ollama and Multi-LLM!
53:57
LangGraph 101: it's better than LangChain
32:26
James Briggs
Рет қаралды 29 М.
Airpods’un Gizli Özelliği mi var?
0:14
Safak Novruz
Рет қаралды 727 М.
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Рет қаралды 2,8 МЛН
#Shorts Good idea for testing to show.
0:17
RAIN Gadgets
Рет қаралды 1,1 МЛН
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 295 М.
M4 iPad Pro Impressions: Well This is Awkward
12:51
Marques Brownlee
Рет қаралды 4,3 МЛН
Эволюция телефонов!
0:30
ТРЕНДИ ШОРТС
Рет қаралды 4,9 МЛН
Компьютерная мышь за 50 рублей
0:28
dizzi
Рет қаралды 2,2 МЛН