LLM Export
Docsmith can export your documentation as plain text files for use with LLMs and AI agents.
Enabling the export
The export is enabled by default. To turn it off, pass false:
Docsmith::make()
->source(__DIR__ . '/md')
->output(__DIR__ . '/dist')
->title('Project Docs')
->siteUrl('https://acme.github.io/project')
->llmsExport(false)
->build();
Generated files
Three files are written to the output directory:
llms.txt
A directory listing per the llms.txt standard:
# Project Docs
> Description.
## Docs
- https://example.com/installation: Installation
- https://example.com/guides/configuration: Configuration
llms-full.txt
Every page rendered as plain text and concatenated:
# Installation
Install the package with composer...
---
# Configuration
Set environment variables...
export/docs.md
Every page's raw Markdown merged into a single file with frontmatter metadata.
Requirements
siteUrl must be set for correct URL generation in llms.txt.
If no index.md exists in the source directory, the generated landing page is included in the export.