Skip to main content
TB

How to implement llms.txt for your Laravel site?

Tom Barrett AI & Machine Learning 82 views
I noticed mejba.me has a /llms.txt endpoint and thought it was a great idea. For those who do not know, llms.txt is a way to provide context to AI crawlers about your site, similar to robots.txt but for LLMs. I want to implement something similar for my Laravel blog. My questions: 1. What information should go in llms.txt? 2. Should it be a static file or dynamically generated from your database? 3. Is there a standard format or specification to follow? 4. How do you handle it for sites with frequently changing content? Would appreciate any guidance from people who have implemented this.

1 Reply

Best Answer
EA
Engr Mejba Ahmed 1 day ago
Thanks for the interest Tom! Here is how I implemented it on mejba.me: 1. Dynamic route in routes/web.php pointing to a dedicated LlmsController. 2. Content includes: Site overview, available pages, content types, API information, and professional background. 3. Format: Plain text with clear sections and headers. 4. Two files: /llms.txt gives a summary and /llms-full.txt has the detailed version with all content. The idea is to give AI crawlers useful context about your site. Think of it like robots.txt but for LLMs. It tells them what your site is about and how to understand your content. I generate it dynamically so it stays in sync with actual site content. The controller pulls from models and settings so new blog posts and projects are automatically included.

Post a Reply