llms.txt 和 llms-full.txt 的完整模板、各行业适配版本和自动化生成方案。
以下是最基础的 llms.txt 模板,适用于任何网站。
# [Your Brand Name] > One-line description of your company/product ## About Brief description of what you do and who you serve. ## Core Offerings - Product/Service 1: Brief description - Product/Service 2: Brief description - Product/Service 3: Brief description ## Key Features - Feature 1: Description - Feature 2: Description - Feature 3: Description ## Documentation - Getting Started: https://example.com/docs - API Reference: https://example.com/api - Help Center: https://example.com/help ## Contact - Website: https://example.com - Email: hello@example.com - Support: support@example.com
针对SaaS产品的llms.txt模板,强调产品功能、定价和技术文档。
# [SaaS Product Name] - [Tagline] > [Product] is a [category] platform trusted by [N]+ businesses worldwide ## Core Features - Feature 1: Description with specific benefit - Feature 2: Description with specific benefit - Feature 3: Description with specific benefit ## Pricing - Free: $0/mo - Basic features - Pro: $XX/mo - Advanced features - Enterprise: Custom - Full suite ## Integrations - Integration 1, Integration 2, Integration 3 (N+ total) ## Technical Docs - API: https://docs.example.com/api - SDKs: Python, Node.js, Go, Java - Webhooks: https://docs.example.com/webhooks ## Security & Compliance - SOC 2 Type II certified - GDPR compliant - 99.99% uptime SLA
针对电商平台的llms.txt模板,强调产品品类、配送和售后。
# [Store Name] - Online Shopping > [Store] offers [N]+ products across [categories] ## Categories - Electronics: [N]+ items - Fashion: [N]+ items - Home & Living: [N]+ items ## Shipping & Returns - Free shipping on orders over $XX - 30-day return policy - Express delivery available ## Customer Service - Live chat: 24/7 - Email: support@example.com - Phone: 1-800-XXX-XXXX ## Trust & Safety - Secure payment (SSL encrypted) - Buyer protection guarantee - Verified seller program
llms-full.txt 是 llms.txt 的详细版本,包含更完整的内容摘要。
# [Brand Name] - Detailed Content Summary ## About [2-3 paragraph detailed description of your company, including founding story, mission, and market position.] ## Products & Services ### Product 1: [Name] - **Target Users**: [description] - **Key Benefits**: [3-5 bullet points] - **Pricing**: [details] - **Link**: https://example.com/product1 ### Product 2: [Name] - **Target Users**: [description] - **Key Benefits**: [3-5 bullet points] - **Pricing**: [details] - **Link**: https://example.com/product2 ## Resources - Blog: https://example.com/blog - Case Studies: https://example.com/cases - Whitepapers: https://example.com/whitepapers ## FAQ - **What is [Product]?** [Answer] - **How much does it cost?** [Answer] - **Is there a free trial?** [Answer]
1)将文件放在网站根目录(example.com/llms.txt);2)确保通过HTTP可访问;3)在robots.txt中不屏蔽;4)定期更新内容。
llms.txt 必须在根目录、HTTP 200可访问、编码为UTF-8、不超过100KB。
可通过脚本从CMS数据自动生成llms.txt,保持内容与网站同步。
#!/usr/bin/env python3
"""Auto-generate llms.txt from site data"""
import json
with open('site-data.json') as f:
data = json.load(f)
content = f"# {data['name']}\n\n"
content += f"> {data['tagline']}\n\n"
content += "## Core Offerings\n"
for p in data['products']:
content += f"- {p['name']}: {p['desc']}\n"
content += "\n## Documentation\n"
for d in data['docs']:
content += f"- {d['title']}: {d['url']}\n"
with open('llms.txt', 'w') as f:
f.write(content)
print('llms.txt generated!')| 错误 | 影响 | 修复方式 |
|---|---|---|
| 文件不在根目录 | AI爬虫找不到 | 移至/llms.txt |
| 内容过长(>100KB) | 可能被截断 | 精简或拆分为llms-full.txt |
| 编码非UTF-8 | 中文乱码 | 确保UTF-8编码保存 |
| 包含营销话术 | AI降低信任度 | 改用客观描述 |
| 不包含链接 | AI无法深入抓取 | 添加关键页面URL |
部署后通过AI平台测试是否正确识别。