Another insane use case with Claude Code | Self-Improving AI Agents
Key Takeaways
The video demonstrates building a self-improving agentic system with Claude Code sub agents and slash commands, showcasing an evaluator-optimizer architecture for generating high-quality content.
Full Transcript
Hey everyone. So yesterday I posted something about sub agents and how you can combine that with flash commands to get more reliable results from your cloud code sub aents and I actually wanted to explore this idea a little bit further. What more advanced agentic architectures we can explore. One idea that I use a lot is this idea of evaluator optimizer. The idea is that we have an evaluator which assesses how good the content that's generated by our agent or your agentic workflow. In this case, we have a really simple example of an agent that creates a post given a URL. So, this would be something like for X or any other social media platform. So, this creates a post draft. The post evaluator assesses it based in some criteria rubric that I've provided the agent. Then, it provides some feedback. If the post generator generates something of high quality, then we are going to approve that post. And finally, we're going to get an output. So, how to orchestrate something like this inside of cloud code? That's what I want to show in this video. So here I'm on cloud code and I've already set up my post evaluator agent and post generator agent. The post generator agent basically just creates this task to generate a spicy engaging and technical post for the X platform and it needs to keep the length to 200 to 300 words and then I have the post evaluator agent and this one is tasked to assess the output of the post generator agent given some criteria. it needs to produce a score between zero and 100 for each one of these dimensions and then provide a final score. Once we can produce that final score, then we can sort of assess whether the post that was generated by the post generator can be approved. I did not put that logic here because what I found with any evaluator agent that I've created, it tries to take shortcuts and introduces biases. For example, it was just output a really high score just to meet that criteria. So I wanted to leave that logic out of the agent and put that somewhere else. So where would I put that? And this is where the idea of slash commands comes into play. So I have the logic baked here. But I also have additional highlevel instructions for how these agents should interact with each other. In this case, because we want to generate the post and also use this evaluator to provide feedback. All of that instruction is here. And notice that I have this loop here which is iterate over a step one to three until the post evaluator agent grades the post with a score of 90 or higher. So that logic that I was explaining is something that I baked into this flash command. If we get an approved post, we'll save that in a folder. And that's pretty much it. So this is building on that idea that I posted about yesterday of using sub agents and orchestrating the way the sub agents communicate and complete tasks. In this case, I am interested in creating this loop. So I'm testing the idea. This is the first iteration of it. So it's not perfect, but essentially what I want is I want to be able to create more complex interactions between the sub agents. And so I'm not going to leave that orchestration to cloud code to decide because this is a really custom agentic workflow that I'm interested in developing just to show you how that works. Now I was just use the slash command post generator and then provided a URL. The URL is now provided as an argument and the two agents can then start to perform the task. So the post generator would generate the post. The evaluator agent will evaluate the post. Then the evaluator agent sends that feedback to the post generator and then we do the iteration order loop that ensures that on every iteration hopefully there is an improvement on the post. Let's look at a concrete example of how these sub aents interact with each other and whether this actually works. You can see here that the post generator generated a post and then the post evaluator evaluated it. It gave it a 77.5 score which doesn't meet the 90 threshold. So then it's going to send that back to the post generator as feedback and then it's going to try to improve. You can see here improve post based on feedback. One thing I want you to pay attention here is the number of tokens. Because this use case is sending back and forth information, you could expect that the amount of tokens used is going to be really high. So be very careful when you're playing around with this particular architecture. There's a lot of little optimizations that I can implement between these sub agents. But this is the first iteration. I definitely have a lot to improve. You can see that the post generator, the post evaluator, post generator, post evaluator again, and it scores very close to 90. And then it says okay I need to go again and iterate over this. So it generates the post again. It does the evaluation again. You can see that now it's 83. After a few iterations something really interesting happened. Basically the agent decide that it was consistently getting a score in the 80s. So it decided to just finalize and then save the result. Finally the result was saved. Now this is not ideal because we still want to meet that 90 threshold. But what I found out is that it's really hard to actually get over 90. And so in a way you can argue that this is okay. But if you really want to be more strict, you should definitely instruct it here. It needs to be over 90. If it's not over 90 after like 10 iterations, then close the loop or something like that. You can put more conditions if you want. That's the power of having detailed instructions. So after that, it's just save the post and we can take a look at the post here. These are just the scores, but let me just show you the output here. And this post is related to the famous Antrophic blog post on AI agents. So definitely spicy. Antropic just dropped the nuclear take. Every dev needs to hear the dirty truth. your rap plus function calling not an agent that lchin monstrosity workflow pretending to be smart real agents equal systems that control their own execution flow but these are just the design patterns and then there's some reality check then hot take your intelligent system probably needs human in the loop not another abstraction layer that's funny who's ready to delete their overengineer agent stack and start fresh so a lot of really spicy takes here and I really like the output so far but definitely can be improved as I said this is just a first it situation showing you that you can do more with slash commands and sub agents inside of cloud code I hope you enjoyed this content. Let me know if you're interested in more videos like this below. And I'll be doing a full breakdown of all the agents and some other cool ideas for my Pro Academy members. So, I'll see you all soon.
Original Description
Learn how to build with AI Agents in my academy: [https://dair-ai.thinkific.com/](https://dair-ai.thinkific.com/)
Use code YOUTUBE20 to get an extra 20% off.
---
Building a self-improving agentic system with Claude Code sub agents and / commands.
#claude #ai #tech #coding
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Elvis Saravia · Elvis Saravia · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
101 ways to solve search (by Pratik Bhavsar)
Elvis Saravia
TLDR Generation of Scientific Documents | ML Interview #1 with Isabel Cachola
Elvis Saravia
Sentiment Analysis: Key Milestones, Challenges and New Directions
Elvis Saravia
Discriminative Adversarial Search for Abstractive Summarization (by Thomas Scialom)
Elvis Saravia
Question Understanding: COVID-Q: 1,600+ Questions about COVID-19
Elvis Saravia
Getting Started with NLP
Elvis Saravia
Building tools and frameworks for large-scale social media mining (by Dr. Juan M. Banda)
Elvis Saravia
TextAttack: A Framework for Data Augmentation and Adversarial Training in NLP
Elvis Saravia
Dive into Deep Learning (Study Group): Introduction to Deep Learning | Session 1
Elvis Saravia
Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Elvis Saravia
How I read and annotate ML papers
Elvis Saravia
Keep Learning ML (Session 1) | DSV, CompLex, Modern tools for emotions
Elvis Saravia
Dive into Deep Learning (Study Group): Preliminaries | Session 2
Elvis Saravia
Keep Learning ML #2 | Language-conditioned policy learning, Effective ML Testing, EagerPy
Elvis Saravia
Dive into Deep Learning (Study Group): Linear Neural Networks | Session 3
Elvis Saravia
Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Elvis Saravia
Keep Learning ML #3 | Contrastively Trained Structured World Models
Elvis Saravia
Dive into Deep Learning (Study Group): Deep Learning Computation with PyTorch | Session 5
Elvis Saravia
Dive into Deep Learning (Study Group): Convolutional Neural Networks | Session 6
Elvis Saravia
Dive into Deep Learning (Study Group): Modern CNNs | Session 7
Elvis Saravia
101 ways to solve neural search with Jina
Elvis Saravia
(Hopefully-Reusable) Life Lessons for PhD Students in NLP
Elvis Saravia
How to save the world and forward your career in 5 easy steps | Women in NLP Talks
Elvis Saravia
Prompt Engineering Overview
Elvis Saravia
Getting Started with the OpenAI Playground
Elvis Saravia
LM-Guided Chain of Thought
Elvis Saravia
Elements of a Prompt
Elvis Saravia
Reasoning with Intermediate Revision and Search with LLMs #chatgpt #ai #llms #science #programming
Elvis Saravia
General Tips for Designing Prompts
Elvis Saravia
Efficient Infinite Context Transformers #ai #machinelearning #research #llms #science
Elvis Saravia
Best Practices and Lessons Learned on Synthetic Data for Language Models #ai #machinelearning #genai
Elvis Saravia
Reducing Hallucinations in Structured Outputs via RAG #chatgpt #ai #llms #programming
Elvis Saravia
Basic Prompt Examples for LLMs
Elvis Saravia
LLM In Context Recall is Prompt Dependent #llms #ai #chatgpt #machinelearning
Elvis Saravia
Zero-shot Prompting Explained
Elvis Saravia
RAG Faithfulness #llms #ai #gpt4
Elvis Saravia
Understanding LLM Settings
Elvis Saravia
Llama 3 is here! | First impressions and thoughts
Elvis Saravia
Llama 3 is Here! #ai #llms #llama3
Elvis Saravia
Microsoft introduces Phi-3 | The most capable small language model?
Elvis Saravia
Microsoft introduces Phi-3! #ai #llms #microsoft
Elvis Saravia
Make Your LLM Fully Utilize the Context #ai #llms #machinelearning
Elvis Saravia
When to Retrieve? #ai #llms #machinelearning
Elvis Saravia
Training an LLM to effectively use information retrieval
Elvis Saravia
State-of-the-art open-source LLM judges #ai #machinelearning #gpt4
Elvis Saravia
Better and Faster LLMs via Multi-token Prediction
Elvis Saravia
AlphaMath Almost Zero #ai #science #machinelearning
Elvis Saravia
SWE-Agent | An LLM-based Software Engineering Agent
Elvis Saravia
[LLM NEWS] AlphaFold 3, xLSTM, OpenAI's Model Spec, DeepSeek-V2, OpenDevin CodeAct 1.0
Elvis Saravia
LLM-powered tool for web scraping #ai #chatgpt #engineering
Elvis Saravia
Learn about LLMs in this NEW course #ai #chatgpt #engineering
Elvis Saravia
[LLM NEWS] KANs, Gemma 10M Context, OpenAI Updates?, Automatic Prompt Engineering, Tokenizer Arena
Elvis Saravia
[LLM News] GPT4-o, Project Astra, Veo, Copilot+ PCs, Gemini 1.5 Flash, Chameleon
Elvis Saravia
Enhancing Answer Selection in LLMs #ai #machinelearning #engineering
Elvis Saravia
On exploring LLMs #ai #promptengineering #chatgpt
Elvis Saravia
Transformers Can Do Arithmetic with the Right Embeddings #ai #machinelearning #engineering
Elvis Saravia
[LLM News] xAI Series B, Codestral, LLM Guide, AutoGen Course, Symbolic Chain-of-Thought
Elvis Saravia
PR-Agent #ai #gpt4 #software
Elvis Saravia
Extracting features from Claude 3 Sonnet
Elvis Saravia
Has prompt engineering been solved?
Elvis Saravia
More on: Agent Foundations
View skill →Related Reads
📰
📰
📰
📰
I tested a new Debian Linux loaded with local AI - see if it's right for you
ZDNet
Threads users can now chat with Meta AI in their DMs
TechCrunch AI
Beyond RAG: Task-aware knowledge compression for enterprise AI on AWS
AWS Machine Learning
Four Vectors, One Record: How I Split Embeddings Before They Hit Search
Dev.to · Daniel Romitelli
🎓
Tutor Explanation
DeepCamp AI