-
Notifications
You must be signed in to change notification settings - Fork 43
Add LLM-friendly documentation export for improved AI context #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
carletex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Pablo, thanks for the PR. I think this is a cool feature to have. If we can generate both llm files on build it would be amazing, so we don't need to anything special when creating a PR (and doing it on build it's probably better than generating them with a GitHub action, as I initially suggested)
I started to review the PR but got discouraged. There are a bunch of things that don't make sense/confusing/under-optimized (I'm guessing vibe coding) in 500+ lines of code. In this particular case (SE-2 docs) not sure if it makes sense to spend the required time to do a proper review.... which is a bit sad. So maybe if it works, we should just move forward.
What we need to change is the hardcoded part, there are parts that don't make sense to me. Happy to give some feedback there.
But let's see what others think too.
|
How about we have some very basic generation script that conforms to anthropics formatting: Here is the branch: |
portdeveloper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from maybe extracting the frontmatter removal logic to a separate function, and some other minor improvements i think this looks pretty good! We can always refactor it further I believe
|
Viem has a pretty sweet plugin script that parses markdown into abstract syntax tree Wasn't too hard for us to port into vuepress Thanks again for the head start friends ❤️ |
We were thinking about migrating to vocs #124 but porting this script is a good option to explore too, tysm @MattPereira !! ♥ |
See llmstxt website for extra llms.txt / llms-full.txt files context.
Based on @portdeveloper idea and initial iteration, I've added a feature to generate an LLM-friendly version of our documentation that helps AI assistants like Claude and ChatGPT better understand our Scaffold-ETH 2 project.
What this PR does:
llms-full.txtfile containing all our documentation in a format optimized for LLMs The doc will be accessible at/llms-full.txt_category_.jsonfiles (in the folders where this file exists)Implementation details:
Added three scripts:
generate-llms-txt.js: Core logic for processing markdown filesgenerate-llms-full.js: Standalone script for manual generationllms-txt-plugin.js: Docusaurus plugin for automatic generation during buildsAdded an npm script:
npm run generate-llmsfor easy manual generationMaybe we can get rid of the standalone script / manual generation when this is mature?
How to test:
npm run generate-llmsstatic/llms-full.txtfilenpm run buildto verify the plugin worksThis is the generated file if you just want to review the content: llms-full.txt
Examples of other projects generating a txt file for llms: