docusaurus-llms-txt
v1.4.1
Published
Docusaurus plugin to generate llms.txt and llms-full.txt context files for AI agents (RAG)
Maintainers
Readme
docusaurus-plugin-llms-txt
"SEO for AI Agents"
Automatically generate llms.txt and llms-full.txt files from your Docusaurus documentation. This allows Large Language Models (like ChatGPT, Claude, Cursor, and local LLMs) to ingest your documentation context accurately without hallucinating.
📦 Installation
npm install docusaurus-plugin-llms-txt
# or
pnpm add docusaurus-plugin-llms-txt
## Usage
Add the plugin to your docusaurus.config.ts (or .js):
```ts
import type { Config } from '@docusaurus/types';
import llmsTxt from 'docusaurus-plugin-llms-txt'; // Import the plugin
const config: Config = {
// ...
plugins: [
[
llmsTxt,
{
// Optional: Exclude specific pages or folders
exclude: ['**/secret/**', '**/drafts/**'],
// Optional: Output formats (defaults to ['txt'])
format: ['txt', 'jsonl'],
},
],
],
// ...
};
export default config;Advanced Usage
Frontmatter Exclusion
You can exclude specific pages from llms.txt by adding llms: false to the document frontmatter:
---
title: Secret Page
llms: false
---JSONL Output
If you enable jsonl in the format option, the plugin will generate llms.jsonl in your build folder. This is useful for fine-tuning LLMs with your documentation data.
Output
When you run npm run build, this plugin will generate two files in your build/ folder:
- llms.txt: A standardized Markdown list of all your documentation pages with descriptions.
- llms-full.txt: The full text corpus of your documentation, optimized for RAG (Retrieval-Augmented Generation) and context windows.
Contributing
We welcome contributions! Please feel free to submit a Pull Request.
