Automated Coder Application (4.5)

Jeff Heaton · Intermediate ·🧠 Large Language Models ·10mo ago

About this lesson

This video extends the ChatConversation framework into a full two-agent workflow called the Coder Assistant. Instead of a single LLM, the notebook sets up both a code generator and a code reviewer, each constrained by strict rules. The generator is tasked with producing Python code for a given problem—in this case, solving the Traveling Salesman Problem with dynamic programming—while the reviewer checks the output against a detailed rubric covering correctness, complexity, edge cases, testability, readability, and performance. The reviewer signals acceptance only by returning the exact token , ensuring that only production-ready code passes . The orchestration loop manages back-and-forth between the two agents. It extracts fenced code blocks from the generator, repairs syntax errors if needed, and enforces reviewer discipline to prevent it from writing code itself. Iterations continue until the reviewer accepts the solution, the maximum round limit is reached, or stagnation is detected. The notebook also supports saving and reloading agent state, customizing verbosity, iteration limits, and memory strategies. This demonstration shows how collaborative AI agents can iteratively generate, critique, and refine solutions—scaling LangChain conversations into a structured automated coding assistant Code for This Video: https://github.com/jeffheaton/app_generative_ai/blob/main/t81_559_class_04_5_coder.ipynb ~~~~~~~~~~~~~~~ COURSE MATERIAL ~~~~~~~~~~~~~~~ 📖 Textbook - Coming soon 😸🐙 GitHub - https://github.com/jeffheaton/app_generative_ai ▶️ Play List - https://www.youtube.com/watch?v=FBmUxUt__rM&list=PLjy4p-07OYzui0nVZzMgoLBeXjG9Oy3hi&ab_channel=JeffHeaton ~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~ 🖥️ Website: https://www.heatonresearch.com/ 🐦 Twitter - https://twitter.com/jeffheaton 😸🐙 GitHub - https://github.com/jeffheaton 📸 Instagram - https://www.instagram.com/jeffheatondotcom/ 🦾 Discord: https://discord.gg/3bjthYv ▶️ Subscribe: https://www.youtube.c

Original Description

This video extends the ChatConversation framework into a full two-agent workflow called the Coder Assistant. Instead of a single LLM, the notebook sets up both a code generator and a code reviewer, each constrained by strict rules. The generator is tasked with producing Python code for a given problem—in this case, solving the Traveling Salesman Problem with dynamic programming—while the reviewer checks the output against a detailed rubric covering correctness, complexity, edge cases, testability, readability, and performance. The reviewer signals acceptance only by returning the exact token , ensuring that only production-ready code passes . The orchestration loop manages back-and-forth between the two agents. It extracts fenced code blocks from the generator, repairs syntax errors if needed, and enforces reviewer discipline to prevent it from writing code itself. Iterations continue until the reviewer accepts the solution, the maximum round limit is reached, or stagnation is detected. The notebook also supports saving and reloading agent state, customizing verbosity, iteration limits, and memory strategies. This demonstration shows how collaborative AI agents can iteratively generate, critique, and refine solutions—scaling LangChain conversations into a structured automated coding assistant Code for This Video: https://github.com/jeffheaton/app_generative_ai/blob/main/t81_559_class_04_5_coder.ipynb ~~~~~~~~~~~~~~~ COURSE MATERIAL ~~~~~~~~~~~~~~~ 📖 Textbook - Coming soon 😸🐙 GitHub - https://github.com/jeffheaton/app_generative_ai ▶️ Play List - https://www.youtube.com/watch?v=FBmUxUt__rM&list=PLjy4p-07OYzui0nVZzMgoLBeXjG9Oy3hi&ab_channel=JeffHeaton ~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~ 🖥️ Website: https://www.heatonresearch.com/ 🐦 Twitter - https://twitter.com/jeffheaton 😸🐙 GitHub - https://github.com/jeffheaton 📸 Instagram - https://www.instagram.com/jeffheatondotcom/ 🦾 Discord: https://discord.gg/3bjthYv ▶️ Subscribe: https://www.youtube.c
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

Your LLM Doesn’t Pick Stocks — It Remembers Them
Discover how LLMs remember stock picks rather than making actual predictions, and why this matters for AI-driven investment strategies
Medium · Machine Learning
Word Representation
Learn how word representation works in NLP and its importance in understanding human language, enabling applications like text classification and language translation
Medium · NLP
When Cosine Similarity Approaching Singularity in Google Search AI Mode
Learn how cosine similarity approaching singularity affects Google Search AI and unified knowledge graphs, and why it matters for AI engineers and data scientists
Medium · AI
When Cosine Similarity Approaching Singularity in Google Search AI Mode
Learn how cosine similarity approaching singularity affects Google Search AI and unified knowledge graphs, and why it matters for data science and AI development
Medium · Data Science
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →