Remix.run Logo
gorbypark 2 days ago

There's an attempt to kinda have these things documented for AIs, called llms.txt, which are generally hosted on the web.

In theory, an AI should be able to fetch the llms.txt for every library and have an actual authoritative source of documentation for the given library.

This doesn't work that great right now, because not everyone is on board, but if we had llms.txt actually embedded in software libraries...it could be a game changer.

I noticed Claude Code semi regularly will start parsing actual library code in node_modules when it gets stuck. It will start by inventing methods it thinks should exist, then the typescript check step fails, and it searches the web for docs, if that fails it will actually go into the type definition for the library in node_modules and start looking in there. If we had node_modules/<package_name>/llms.txt (or the equivalent for other package managers in other languages) as a standard it could be pretty powerful I think. It could also be handled at the registry level, but I kind of like the idea of it being shipped (and thus easily versioned) in the library itself.

AlecSchueler 2 days ago | parent [-]

> In theory, an AI should be able to fetch the llms.txt for every library and have an actual authoritative source of documentation for the given library.

But isn't the entire selling point of the LLM than you can communicate with it in natural language and it can learn your API by reading the human docs?

languid-photic 2 days ago | parent [-]

Yes, but I think part of the reason for llms.txt is optimize context. eg beyond content, the human docs often have styling markup which wastes tokens.

AlecSchueler 2 days ago | parent [-]

Hmm, sounds like LLMs.txt might be nicer for humans to read all well.

gorbypark a day ago | parent [-]

Sometimes they are! I use the expo docs as a human all the time. Some project however seem to really "minify" their docs and are less readable. I'm not quite sure how minifying really saves space as it seems like they are just removing new lines as the docs are still in markdown...

Good for humans example: https://docs.expo.dev/llms-full.txt

Bad for humans example: https://www.unistyl.es/llms-small.txt