AutoGPT 运行原理解析 (English)
AutoGPT 运行原理解析 (English)
Generated: 2026-06-24 05:47:48
---
You’ve probably seen that scene before—last spring, AutoGPT suddenly took over my feed, GitHub stars jumped by ten thousand in a day, and everyone in my朋友圈 was shouting, “AGI is finally here!” That night, I was totally hooked. I got up in the middle of the night, logged into my cloud server, and set the whole thing up.
Installed dependencies, got the API key—took about half an hour. Then, with great ceremony, I typed in my very first task:
“Find me the most popular AI tweets this week.”
See, just that one sentence. I leaned back, ready to witness history.
And what happened? I stared at the screen for a full ten minutes. It went into a trance—Googling, browsing websites, writing files… all by itself, talking to itself the whole time. Eventually, it did produce a report. But guess what?
That single task cost me two dollars.
At that moment, one thought hit me: AutoGPT isn’t AGI at all. It’s nothing more than a brilliantly packaged, elegantly self-talking—clever minion.
At its core, there are just three things: make GPT do multiple-choice questions, help it remember what it needs to remember, and hand it a Swiss Army knife. Everything else is pure illusion.
---
Point One: Its “Memory” Is Just as Flawed as Ours—Remembers What’s Recent, Dumps the Old
You see, if you’ve used ChatGPT, you know it can only remember so much conversation at once. AutoGPT works exactly the same way—the context window is a hard ceiling.
I dug into the source code and found a critical piece of code: it maintains a list of all dialogue called fullmessagehistory. Each time it sends a request, it loads from the latest message backward until it can’t fit any more. Recent messages stay, older ones get kicked out automatically—exactly like your short-term memory, it remembers what just happened and forgets everything old.
The first time I ran a task, by the fifth iteration it had suddenly forgotten what it had found earlier. That’s because the token limit was reached, and the earlier observations got wiped out. Later I turned on the Memory feature, connected it to a Pinecone vector database, and only then did it essentially get an external hard drive—able to dig up old stuff by similarity.
But there’s a big trap you have to know: if you don’t configure Pinecone and rely only on the built-in history, AutoGPT is basically a goldfish—after ten rounds of conversation, it can’t even remember its own task goal.
---
Point Two: GPT Only Does the Multiple-Choice Part; the Real Work Is Done by a Predefined Toolbox
A lot of people think AutoGPT runs purely on GPT-4, writing code in its own head, executing it directly, manipulating the browser. Dead wrong.
Take a look at the output format—it’s always a custom piece of JSON:
THOUGHTS: ...
REASONING: ...
PLAN: ...
CRITICISM: ...
NEXT ACTION: COMMAND = google ARGUMENTS = {'input': '...'}
AutoGPT takes that, extracts the COMMAND and arguments, then looks it up in a pre‑written Python function. For example, google maps to googlesearch(), writeto_file maps to file writing. Every command is a pre-written, controllable, extensible component implemented by a programmer.
So what does GPT actually do? Only “what to do next.” The hands that do the work are just a bunch of ordinary functions.
What’s clever about this design? What if GPT starts spouting nonsense? Say it orders a crawl of a nonexistent website—the command component will just return an error. AutoGPT feeds that error back as a new observation, letting GPT re‑plan.
I’ve seen it stubbornly try to execute a nonexistent command, going through a loop of error, feedback, error again, until it finally gives up. The most ridiculous time, it tried three times in a row to call a send_email command I had never even registered. Each time it errored, each time it retried, and then it went silent. So don’t buy into the “autonomous self-healing” myth—hit an edge case and you’ll get an infinite loop just as easily.
---
Point Three: A Well‑Written Prompt Is What Makes GPT Look Like a “Strategic Brain”
In AutoGPT’s source code, there’s a file called prompt.txt containing a long system‑level instruction. It defines the role, constraints, available commands, and output format. The most intriguing part I found were a few “self‑criticism” instructions:
- “Your short‑term memory is limited; immediately save important information to a file.”
- “If you’re not sure what you’ve done before, recalling similar events can help you remember.”
- “No user assistance.”
- “Only use commands listed inside double quotes.”
I tried removing the “CRITICISM” section. And what happened? GPT started outputting plans randomly, skipping the reflection step entirely, and the task quality plummeted. You see, this prompt isn’t just decoration—it’s the core scheduling logic.
Some might say, “Isn’t that just writing an employee manual for GPT?” Yes, exactly. The vast majority of AutoGPT’s “intelligence” comes from that manual. There’s no novel architecture. If you swap in another agent with a well‑crafted prompt, you’ll get exactly the same results.
---
Counterargument: Is It at Least a Prototype of AGI?
I admit that the agent paradigm Lillian Weng proposed—LLM + memory + planning + tools—is the right direction. Many people use that framework to compare against AutoGPT and say it’s the prototype of AGI.
But the current implementation is far too crude. Look:
- Its “planning” only produces the next step based on the current observation; there’s no real long‑term planning ability.
- Its “memory” relies on an external database, and the timing of injecting it into the prompt isn’t always optimal.
- Its “tools” list must be manually configured by developers; it has no ability to discover tools on its own.
What’s even more practical is the cost. I ran a moderately complex task: analyze three competitor websites and produce a comparison report. It cost about 8 dollars and took 20 minutes, with me having to type y several times to confirm because it timed out. If every task requires human supervision, does that really qualify as autonomous driving?
So my judgment is: AutoGPT is a landmark demo. It proves that an LLM can solve multi‑step tasks through a “think–act–observe” loop. But it’s more like a shell script with a scheduler on steroids. A true AGI? We’re still light‑years away.
---
Some Practical Advice
If you really want to play with it, don’t jump straight into production. Start with low‑cost tasks—write a blog outline, do a simple research. Be sure to set token limits and choose the right model. The default gpt-3.5-turbo gets stupid on complex tasks, while gpt-4 hurts your wallet.
Also, dig into the source code, especially prompt.txt and commands.py. Change the return format of one command, and the whole agent’s behavior will shift. The playability of this thing far exceeds its practicality—but it’s exactly that playability that lets us glimpse the shape of future agents.
Maybe in two or three years, each of us will have a “digital employee” of our own: tell it the goal, and it breaks it down, finds information, calls APIs, and delivers the result. At that point, when we look back—
AutoGPT was that clumsy, expensive, crash‑prone fool… the first one brave enough to stand up and point the way.
So don’t mind that it’s a toy right now. Sometimes, the first fool who dares to stand up and point the way matters more than all the clever followers who come later.
Cael Lee
Full-stack developer with 8+ years of experience. Currently building AI-powered developer tools. I've tested 20+ AI API providers and coding assistants.