# Libraries should document their code for agents

Markdown copy of https://realalpha.app/s/libraries-should-document-their-code-for-agents/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Andrej Karpathy](https://realalpha.app/builders/andrej-karpathy/) · Andrej Karpathy is an AI researcher and engineer. · Joined Anthropic's pretraining team; founded Eureka Labs, an AI-native school, after leading Tesla's Autopilot AI.
- Host: [Sarah Guo](https://realalpha.app/people/sarah-guo/) · Founder, Conviction · Ex-Greylock partner; early investor in Cognition, Harvey and Mistral.
- Show: No Priors
- Episode: [Skill Issue: Andrej Karpathy on Code Agents, AutoResearch, and the Loopy Era of AI](https://realalpha.app/v/kwSVtQ7dziU/), Mar 20, 2026
- Moment: 1:01:29 to 1:06:07 of the episode (5 min), playing on https://realalpha.app/s/libraries-should-document-their-code-for-agents/; the episode from there: https://realalpha.app/v/kwSVtQ7dziU/?t=3689

## Quote

> “instead of HTML documents for humans, you have **Markdown documents for agents**.”
> — [Andrej Karpathy](https://realalpha.app/builders/andrej-karpathy/) at [1:04:40](https://realalpha.app/v/kwSVtQ7dziU/?t=3880) · No Priors

## Takeaways

1. MicroGPT reduces LLM training to about 200 lines of Python.
2. Agents can adapt explanations to a learner's questions.
3. Skills can script a sequence for teaching a codebase.

## About this segment

Andrej Karpathy argues that agents can explain code in a learner's language, so documentation should target them. Skills can give an agent a planned curriculum for teaching a codebase.

From “Skill Issue: Andrej Karpathy on Code Agents, AutoResearch, and the Loopy Era of AI”, Mar 20, 2026. [Watch the full episode](https://realalpha.app/v/kwSVtQ7dziU/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[1:01:34](https://realalpha.app/v/kwSVtQ7dziU/?t=3694) Tell me about the micro-GPT art. Oh, yeah. Okay, so micro-GPT. So I have this like running obsession of like maybe a decade or two of just like simplifying and boiling down the basically LLMs to like their bare essence. And I've had a number of projects along these lines. So like Nano-GPT and Make More and MicroGPT, MicroGrad, etc. So I feel like micro GPT is now the state of the art of me trying to like just boil it down to just the essence.

[1:02:01](https://realalpha.app/v/kwSVtQ7dziU/?t=3721) Because the thing is like training neural nets and LLMs specifically is a huge amount of code. But all of that code is actually complexity from efficiency. It's just because you need it to go fast. If you don't need it to go fast and you just care about the algorithm, then that algorithm actually is 200 lines of Python. Very simple to read. And this includes comments and everything. Because you just have like your data set, which is a text.

[1:02:23](https://realalpha.app/v/kwSVtQ7dziU/?t=3743) and you need your neural network architecture, which is like 50 lines, you need to do your forward pass and then you have to do your backward pass to calculate the gradients. And so... autograd engine to calculate the gradients like 100 lines. And then you'd an optimizer, an Atom, for example, which is a very state-of-the-art optimizer is like, again, 10 lines, really. And so putting everything together in the training loop is like, yeah, 200 lines.

[1:02:43](https://realalpha.app/v/kwSVtQ7dziU/?t=3763) And it was interesting to me, like normally before, like maybe a year ago or more, if I had come up with micro GPT, I would be tempted to basically explain to people, like I have a video, like stepping through it or something like that. And I actually tried to make that video a little bit and i tried to make like a little guide to it and so on i kind of realized that this is is not really it's not really adding too much because people because it's already so simple that it's 200 lines that anyone could ask their agent to explain it in various ways and agents like i'm not explaining to people anymore i'm explaining it to agents if you can explain it to agents then agents can be the router and they can actually target it to the human in their language uh with infinite uh you know patience and uh just at their capability and so on right

[1:03:26](https://realalpha.app/v/kwSVtQ7dziU/?t=3806) Right. If I don't understand this particular function, I can ask the agent to explain it to me like three different ways. And I'm not going to get that from you. Exactly. And so I kind of feel like, you know, what is education? Like it used to be guides. It used to be lectures. It used to be this thing. But I feel like now more I'm explaining things to agents and maybe I'm coming up with skills where like, so basically skill is just a way to instruct the agent how to teach the thing. So maybe I could have a skill for micro GPT of the progression I imagine the agent should take you through if you're interested in understanding the code base and it's just like hints to the model to like oh first start off with this and then with that and so i could just script the curriculum a little bit as a skill uh so um so i i don't feel like um yeah i feel like

[1:04:07](https://realalpha.app/v/kwSVtQ7dziU/?t=3847) there's gonna be less of like explaining things directly to people and it's gonna be more of just like does the agent get it and if the agent gets it they'll do the explanation and we're not fully there yet because they i still can i still think i can probably explain things a little bit better than the agents, but I still feel like the models are improving so rapidly that I feel like it's a losing battle to some extent.

[1:04:28](https://realalpha.app/v/kwSVtQ7dziU/?t=3868) And so I think education is going to be kind of like reshuffled by this quite substantially, where it's the end of like teaching each other things almost a little bit. Like if I have a library, for example, of code or something like that, it used to be that you have documentation for other people who are going to use your library, but like you shouldn't do that anymore. Like you should have, instead of HTML documents for humans, you have Markdown documents for agents.

[1:04:49](https://realalpha.app/v/kwSVtQ7dziU/?t=3889) Because if agents get it, then they can just explain all the different parts of it. So it's this redirection through agents, you know, and that's like, so I think we're going to see a lot more of that playing out. if the great teachers know, like to develop intuition for how to explain things to agents differently. Ultimately, so for example, micro GPT, like I asked, I tried to get an agent to write micro GPT.

[1:05:10](https://realalpha.app/v/kwSVtQ7dziU/?t=3910) So I told it like, try to boil down the simplest things, like try to boil down neural network training to the simplest thing and can't do it. Like micro GPT is like my, it's like my end of my obsession. It's the 200 lies. I thought about this for a long time. I've obsessed about this for a long time. This is the solution. Trust me, it can't get simpler. and this is this is my value add everything else like agent gets it it just can't come up with it but it totally gets it and understands why it's done in a certain way etc so like my contribution is kind of like these few bits but everything else in terms of like the education that goes on after that is like not my domain anymore so maybe yeah it's like education kind of changes in those ways where you kind of have to infuse the few bits that you feel strongly about

[1:05:53](https://realalpha.app/v/kwSVtQ7dziU/?t=3953) the curriculum or the the best the better way of explaining it or something like that the things that agents can't do is your job now. Things that agents can do, they can probably do better than you or like very soon.
