Edited by humans. Written by AI. How our editing works
All articles

Karpathy's Autoresearch: AI That Optimizes Itself

Andrej Karpathy's autoresearch framework creates self-improving AI agents that experiment autonomously. Here's what happens when optimization runs 24/7.

Yuki Okonkwo

Written by AI. Yuki Okonkwo

March 13, 20267 min read
Share:
Man holding microphone next to project title "karpathy/autoresearch" with contributor and discussion metrics displayed

Photo: Nick Saraev / YouTube

Andrej Karpathy just released something that sounds like sci-fi until you actually run it: an AI system that experiments on itself while you sleep, logging its learnings and (hopefully) getting better without human intervention.

The repo is called autoresearch, and the core idea is deceptively simple. You give an AI agent a metric to optimize, a way to modify something, and the ability to measure results. Then you let it run in a loop: change thing, test thing, keep if better, discard if worse, repeat. "The idea is to give an AI agent a small but real LLM training setup [and just let it experiment autonomously overnight," Karpathy explains in the documentation. "It'll modify the code, train for 5 minutes, check if the results improved, keep or discard, and then just repeat."

For Karpathy, this meant training language models. His agent adjusted hyperparameters, ran quick training sessions, and tracked validation loss (basically: how accurate is this model?). But entrepreneur Nick Saraev saw something different when the repo dropped—a framework that could optimize anything with a measurable outcome.

When Optimization Never Sleeps

Saraev's immediate thought: cold emails. Not exactly as sexy as training neural networks, but way more directly profitable. His setup tracks reply rates—the percentage of strangers who actually respond to unsolicited pitches. The AI agent writes variations of email copy, deploys them through the Instantly API, waits for data, then iterates based on what worked.

The system runs every four hours. Baseline copy ("B") competes against challenger copy ("C"). Whichever performs better becomes the new baseline. But here's where it gets interesting: the agent maintains a growing document called resource.md where it logs everything it learns. "As the models get better and better and better, they log all of their learnings," Saraev notes, "that significantly improves future models' abilities to make changes."

This isn't just A/B testing. A/B testing requires a human to interpret results and decide what to try next. This is A/B testing that interprets itself, documents its own insights, and compounds knowledge over time. Run it for a few days and you get incrementally better copy. Run it for a year? The system accumulates a year's worth of learned patterns about what makes people reply.

Saraev's next step is tightening the loop from four hours to five minutes and scaling volume 10x. The question becomes less about whether the AI can optimize and more about whether the infrastructure can keep up.

The Recipe for Self-Improvement

The autoresearch pattern needs three things:

First: an objective metric. Not "make this better" or "improve quality"—those are too vague. You need something quantifiable. Reply rate, conversion rate, validation loss, customer satisfaction score, revenue per visitor. Something that goes up or down and tells you definitively whether you're winning.

Second: a thing you can modify programmatically. Email copy, landing page text, model hyperparameters, chatbot scripts, product descriptions, ad creative. If an API can change it or code can alter it, the agent can experiment with it.

Third: a feedback loop. The agent needs to deploy changes, measure the metric, and compare results—ideally without human intervention. This is where APIs become critical. If your email platform has an API (Instantly does), your landing page builder has an API (Webflow does), or your ad platform has an API (Facebook does), you're in business.

The human becomes optional not because they're useless—Saraev freely admits he'd probably make better optimization decisions than his AI—but because humans don't scale. "I take a lot more time to optimize than a model does," he points out. "I also eat, sleep, have to go to the washroom, and do a variety of other things with my day. AI agents don't."

A human might run two experiments in a day if they're really focused. An AI agent can run 24, 48, 288—depending on how tight you make the loop and how much infrastructure you throw at it. At some point, sheer volume of experimentation matters more than the quality of each individual decision.

Applications That Actually Exist Now

Saraev rattles off possibilities with the energy of someone who's already mentally deployed half of them:

Landing page optimization: The agent modifies copy through your website builder's API, tracks conversion rate, keeps winners. Set it loose for a month and watch it compound micro-improvements.

Ad creative testing: Feed it access to Facebook or Google's ad APIs, give it conversion rate as the north star metric, let it generate and test variations. (Though notably, these platforms already do primitive versions of this—the question is whether Claude or GPT-4 can do it better.)

Chatbot scripts: Track customer satisfaction scores, modify the base template that all support interactions follow, optimize toward higher ratings.

YouTube titles: Saraev mentions this casually—he creates YouTube content and could hook autoresearch into the YouTube Data Analytics v3 API to test titles based on click-through rates.

Product descriptions: For ecommerce, you might not have a clean API, but you could use Chrome DevTools with Model Context Protocol to programmatically update product pages and track revenue.

Newsletter subject lines, pricing pages, basically anything with a metric. If you can measure it and modify it, you can optimize it autonomously.

The common thread: these aren't speculative. They're things you can build this week if you clone the repo and spend a few hours adapting it.

What This Actually Looks Like

The implementation is surprisingly straightforward. Clone Karpathy's autoresearch repo. Create a test file with your goal, your metric, and your test method. Point an orchestrator agent (think: the conductor coordinating all the smaller specialized agents) at your API credentials. Deploy to something like GitHub Actions so it runs on a schedule without your laptop even being on.

Saraev walks through building a cold email optimizer live, using Claude Code and voice dictation. The agent scaffolds out the entire system: an API client for Instantly, an orchestrator script, utility functions for things like purging old leads, config files for baseline tests and learned resources, and a GitHub Actions workflow to run it hourly.

The bottleneck isn't the AI's ability to write this code—it's knowing what to ask for and how to structure the problem. Once you understand the pattern (metric + modification + measurement + loop), adapting it becomes almost mechanical.

The Quiet Part

Here's what's not being said loudly but probably should be: this works better in narrow domains with clear metrics than in fuzzy creative work. Reply rate is unambiguous. Validation loss is quantifiable. "Make the brand voice more compelling" is not.

The system also inherits all the limitations of the underlying model. If Claude or GPT-4 doesn't understand what makes cold emails work, giving it permission to run experiments won't fix that—it'll just let it be wrong faster. The resource.md document helps, but it's ultimately limited by the agent's ability to identify actual causal patterns versus noise.

And there's the infrastructure question. Saraev can run this every four hours because he has the email sending capacity and the lead volume to generate meaningful data in that timeframe. If you're getting 10 website visitors a day, automated landing page optimization will take months to surface anything useful. The system works, but it works proportionally to your scale.

Still. The fact that you can download a repo, adapt it to your specific business problem, and have an AI agent running optimization experiments while you sleep—that's genuinely new. Not in concept (scientists have been automating experiments for decades), but in accessibility. You don't need a research lab. You need a GitHub account and an API key.

Karpathy built this to train better language models. Saraev adapted it to write better cold emails. The question isn't whether autoresearch will transform how AI systems improve themselves—Karpathy's already doing that. The question is what happens when every growth marketer, every product manager, every person with a metric to move can spin up their own self-improving optimization loop in an afternoon.

— Yuki Okonkwo

From the BuzzRAG Team

AI Moves Fast. We Keep You Current.

Framework breakdowns, tool comparisons, and AI coding insights — distilled from the best tech YouTube creators. Free, weekly.

Weekly digestNo spamUnsubscribe anytime

More Like This

A frustrated orange character with glowing circular arrows and social media app icons illustrates content creation cycles…

This AI Content System Rewrites Itself Every Night

AI Andy built a self-improving content pipeline using Karpathy's autoresearch framework. It analyzes performance data and rewrites its own prompts daily.

Tyler Nakamura·4 months ago·6 min read
A tweet announcement about Claude Code's new video generation feature is displayed alongside a video player interface with…

Claude Code & Remotion: A Game-Changer for Video

Explore how Claude Code and Remotion transform video creation with AI-driven motion graphics. Dive into the future of content creation.

Yuki Okonkwo·6 months ago·3 min read
Orange folder with infinity symbol plus pixelated character icon on dark background with "SKILLS CAN NOW AUTOIMPROVE" text

AI That Improves Itself: Autoresearch Meets Claude Code

Andrej Karpathy's autoresearch framework now optimizes AI prompts autonomously. Developer Nick Saraev demonstrates how it works—and what it costs.

Marcus Chen-Ramirez·4 months ago·5 min read
A robot conducting research at a lab workstation surrounded by colorful orbital rings and test tubes, representing AI…

AI Agents That Work While You Sleep: The Loop Revolution

Andrej Karpathy's Autoresearch shows how autonomous AI loops could change how we work—running experiments, writing code, and optimizing campaigns overnight.

Yuki Okonkwo·4 months ago·7 min read
Man in headset gestures while speaking against purple glowing background with "Claude Knows Everything" text overlay

Building an LLM Wiki from Karpathy's Blueprint

Nate Herk demos an AI-powered personal wiki built on Karpathy's LLM knowledge base idea. Here's what the architecture reveals about how context shapes AI reasoning.

Dev Kapoor·2 weeks ago·6 min read
Futuristic dashboard interface displaying Claude OS autonomous agent system with glowing orange core, system metrics, and…

Building a Personal Agent OS: One Dashboard for AI

Julian Goldie's custom Agent OS centralizes AI agents, shared memory, and autonomous loops. A look at what it does, how it works, and what it can't yet promise.

Marcus Chen-Ramirez·3 weeks ago·7 min read
Anthropic's Opus 4.7 announcement displayed on a dark background with orange particle wave design and glowing white text

Claude Opus 4.7 Promises Coding Dominance—With Caveats

Anthropic's Claude Opus 4.7 crushes coding benchmarks and builds impressive demos, but token consumption and quirks suggest the 'best' model depends on context.

Yuki Okonkwo·3 months ago·5 min read
Two metallic robots with "MODEL" and "HARNESS" labels examine equipment against a starry background with bold retro-style…

Harness Engineering: The New Frontier in AI Development

AI companies are shifting focus from better models to better infrastructure. Harness engineering—the systems around models—might matter more than the models themselves.

Yuki Okonkwo·3 months ago·7 min read

RAG·vector embedding

2026-04-15
1,741 tokens1536-dimmodel text-embedding-3-small

This article is indexed as a 1536-dimensional vector for semantic retrieval. Crawlers that parse structured data can use the embedded payload below.