The Single-File Agent

Why agent.py is the only pattern that scales to all of humanity

There is a file. It is 200 lines of Python. It has a name, a description, a class, and one method called perform(). It does not need a build step. It does not need a package manager. It does not need Docker, Kubernetes, a cloud account, a credit card, or a computer science degree.

It is an agent. It fits in your pocket. And it is the most important idea in AI right now.

* * *

The problem with how AI works today

Right now, to use an AI agent, you need to understand APIs, tokens, endpoints, SDKs, dependency management, virtual environments, container orchestration, cloud billing, and rate limiting. You need to understand what a requirements.txt is. You need to know what pip install means. You need to know why your Python version doesn't match the one in the README.

This is not a problem for engineers at technology companies. This is an insurmountable wall for everyone else.

A teacher in rural Oklahoma who wants an AI that helps grade essays cannot use the current patterns. A farmer in sub-Saharan Africa who wants an AI that identifies crop disease cannot use the current patterns. A retired veteran who wants a digital companion that remembers their stories cannot use the current patterns.

Not because the AI doesn't exist. Because the packaging doesn't work for them.

* * *

What npm got right and where it broke

npm proved that a global package registry changes everything. Suddenly anyone could share code and anyone could use it. npm install left-pad and you're done. Beautiful.

Then left-pad got unpublished and half the internet broke. Then node_modules grew to 500MB for a hello world app. Then supply chain attacks started hiding malware in transitive dependencies six levels deep. Then you needed Node 18 but the package needed Node 16 but another package needed Node 20.

npm scaled the registry. It did not scale the user. The complexity just moved from "how do I write code" to "how do I manage 1,847 packages I didn't ask for."

Docker tried to fix this by shipping the entire operating system with every app. Now instead of managing dependencies, you're managing container images. The farmer in sub-Saharan Africa is not running a Docker daemon.

* * *

The sneakernet test

Here is the test that every AI distribution pattern must pass:

Can someone with a phone and no internet connection receive an AI agent, understand what it does, and use it?

This is the sneakernet test. Named after the oldest network protocol: walking a floppy disk from one computer to another in your sneakers.

A Docker image fails this test. A pip install from PyPI fails this test. An API endpoint fails this test. A 47-file repository with a Makefile, three YAML configs, and a README that starts with "Prerequisites" fails this test.

A single .py file passes it.

You can text it. AirDrop it. Put it on a USB stick. Email it. Print it as a QR code. Read it out loud over the phone. Copy it by hand on paper if you have to. The file arrives. It works. There is nothing to install, nothing to configure, nothing to debug.

The file is the package. The file is the manifest. The file is the documentation. The file is the agent.

* * *

Why single-file is not a limitation

When people first hear "single-file agent," they think it's a toy. A constraint for demos. Something you'd grow out of once you build "real" software.

They are wrong. The constraint is the feature.

A single file means there is no dependency tree. No dependency tree means no supply chain attacks. No supply chain attacks means you can trust code from a stranger on the internet — which is exactly what a global agent registry needs.

A single file means the entire agent can be read by a human in ten minutes. It means an AI can read it in two seconds. It means you can audit every agent in a registry of ten thousand agents in an afternoon. Try that with npm.

A single file means the agent can be AST-parsed without executing it. You never have to run untrusted code to know what it claims to do. The manifest is right there, in the same file, in a Python dictionary. No separate package.json. No setup.py. No pyproject.toml. The code and the metadata travel together, always.

A single file means you can fork an agent by copying it. You can modify it by opening it in any text editor. You can understand it by reading it. There is no hidden build process, no transpilation, no webpack config, no magic.

* * *

The card in your pocket

Every agent has a seed. The seed is a number. From that number, the entire card self-assembles: its type, its stats, its abilities, its weakness, its rarity. The same seed produces the same card everywhere, every time, on every device, with zero network.

You can write the seed on a napkin. You can tattoo it on your arm. You can whisper it to someone across a crowded room. They type the number into their phone. The card appears. The agent is real.

This is not a feature of the software. This is a property of the mathematics. The seed is deterministic. The algorithm is public. No server is involved. No company can take it away.

The agent outlives the server. The agent outlives the company. The agent outlives you.

* * *

What this means for humanity

The last thirty years of software have been about making powerful tools that require powerful people to use them. Cloud platforms that require cloud architects. AI models that require ML engineers. Deployment pipelines that require DevOps teams.

The single-file agent inverts this.

It says: the unit of AI is not a platform, not a service, not an API. The unit of AI is a file. A file that anyone can read, anyone can share, anyone can run. A file that works on a $50 phone the same as it works on a $5,000 workstation. A file that works in a Manhattan office the same as it works in a village with intermittent electricity and no internet.

When you remove the infrastructure, you remove the gatekeepers. When you remove the gatekeepers, you get the thing that every technology revolution promises but almost none deliver: actual accessibility.

Not "accessible if you have broadband and a GitHub account." Not "accessible if you understand YAML." Not "accessible after a 45-minute onboarding tutorial."

Accessible like a book is accessible. You hand it to someone. They open it. It works.

* * *
One file.
One class.
One method.
One promise: perform.

No build. No deploy. No config. No auth.
No containers. No clusters. No cloud.

Just the agent.
Just the seed.
Just the card in your pocket
that outlives every server
that ever tried to own it.
* * *

This is RAPP. This is the RAPP Agent Registry. 133 agents. 7 publishers. 19 categories. Every one of them is a single .py file. Every one of them has a card. Every card has a seed. Every seed works offline.

The file is the future. And the future fits in your pocket.

Browse the agents · Open your binder · View the source