Building a Thinking Machine: My Gemma 2 9B Reflection Agent

Опубликовано: 21 Февраль 2026
на канале: Adam Lucek
2,662
69

Is Gemma 2 - 9B the new best local model? Let’s put that to the test! In this video we create a reflection agent that runs Gemma 2 through a series of complex tasks, analyzing YouTube data and synthesizing findings into a report, applying what’s been analyzed to new title generations, and self reflecting at each step to ensure quality responses and additional instructions if necessary!

This gives a comprehensive overview of Gemma 2 9B’s ability for advanced synthesis, novel generation, and reasoning, all while making my job a little easier 😉

This title was generated using the program with the ‪@tested‬ channel, let me know if you think its any good!

I put these resources and videos together with my own cash and time to help those interested gain the knowledge needed to build with and understand artificial intelligence. If you want to support the channel and see more like this, consider leaving a Super Thanks donation!

Resources:
Code: https://github.com/ALucek/gemma2-yt-a...
Gemma 2 Release Blog: https://blog.google/technology/develo...
Gemma 2 Technical Report: https://storage.googleapis.com/deepmi...
Ollama Model Page: https://ollama.com/library/gemma2
YouTube Data API Setup: https://developers.google.com/youtube...

Chapters:
00:00 - Intro
01:07 - Reflection Agent Overview & Idea
03:23 - Ollama Dependencies Setup
03:48 - Data Pipeline: YouTube Data
04:19 - Data Pipeline: Channel Detail Function
07:17 - Prompting: Setup & Special Tokens
09:48 - Prompting: Report Generation
13:14 - Prompting: Title Generation
15:50 - Prompting: Reflection Step
18:17 - Agent Building: LangGraph Introduction
20:22 - Agent Building: Graph State Setup
21:31 - Agent Building: Node 1 - Channel Details
23:21 - Agent Building: Node 2 - YouTube Report Generation
24: 25 - Agent Building: Node 4 - Reflection Step
27:16 - Agent Building: Node 3 - Title Generation
29:00 - Graph Building: Connections Overview
29:55 - Graph Building: Connecting Nodes
31:22 - Graph Building: Reflection Conditional Edge Logic
33:43 - Graph Building: Compiling & Visualizing
35:15 - Output: Running the Agent!
36:41 - Output: Looking at the Generation
38:05 - Output: LangSmith Trace
40:03 - Output: Trace w/Reflections
41:11 - Closing Thoughts About Gemma 2 9B

#ai #artificialintelligence #coding