LLMO + llms.txt + AI crawler — cách AI 'đọc' web của bạn 2026
LLMO (LLM Optimization) là layer technical của GEO — cấu hình llms.txt (chuẩn mới 2024 từ Answer.AI), điều phối AI crawler (GPTBot/ClaudeBot/PerplexityBot), markdown-first content. Hiểu để AI engine crawl + cite bạn đúng — chặn nếu cần (privacy), expose nếu muốn (visibility).
Mục lục bài viết(19)

So sánh 3 layer thông tin web 2025-2026: (1) Search Engines (Google) — index keyword, rank link; (2) Knowledge Graphs (Wikipedia/Wikidata) — entity + relationship; (3) Large Language Models — generative answer. LLMO bridge 3 layer: cấu hình llms.txt cho LLM, schema.org @graph cho Knowledge Graph, traditional SEO cho Search Engine. Mỗi layer có nhu cầu khác nhau về crawler + content format. Nguồn: Wikimedia Commons (CC BY-SA 4.0).
Hiểu đơn giản nhất
Tưởng tượng web là thư viện. Có 3 loại "người đọc":
| Loại | Đọc gì | Mục đích |
|---|---|---|
| Googlebot (search engine crawler) | Skim tiêu đề + meta + keyword | Index để rank |
| AI crawler (GPTBot/ClaudeBot) | Đọc kỹ nội dung để hiểu | Train LLM + answer query |
| Real-time AI fetch (Perplexity) | Đọc current page khi user query | Cite trong response live |
LLMO = "Large Language Model Optimization" = tối ưu kỹ thuật cho 3 loại trên (đặc biệt 2-3) đọc + hiểu site bạn đúng.
3 file cấu hình quan trọng
/robots.txt — kiểm soát mọi crawler (legacy 1994)
/llms.txt — giới thiệu site cho LLM (mới 2024)
/sitemap.xml — danh sách trang cho mọi crawler
Mọi production site 2026 nên có cả 3.
Tại sao bạn cần biết
- AI crawler đã chiếm 5-15% bandwidth web 2025-2026. Cloudflare report: GPTBot + ClaudeBot crawl 100M+ page/ngày. Không config = AI crawl random → mịn-mí kết quả.
- Brand visibility AI free. AI cite từ web đã crawl. Tối ưu LLMO = increase chance được cite.
- Bandwidth cost. AI crawler không click ads, không revenue, nhưng tốn bandwidth. Cấu hình rate limit + block bot không cần thiết.
- Privacy + IP protection. Member content, paid content, internal docs phải block. Lawsuit NYT vs OpenAI 2023 vẫn chưa kết — chứng minh nguy cơ liability.
- Markdown-first = future-proof. AI parse tốt hơn HTML. wiki + docs site nên serve
.mdversion song song.
llms.txt — chuẩn mới 2024
Jeremy Howard (Answer.AI, fast.ai) propose tháng 9/2024. Đặt file /llms.txt ở root domain với format Markdown đơn giản:
# VietCodex
> AI-native dev agency Vietnam — thiết kế web, app, SaaS, tool nội bộ.
> Founded 2024 bởi [Founder Name]. Wiki có 60+ bài foundation.
## Services
- [Web Design](https://vietcodex.com/dich-vu/thiet-ke-web): Next.js + Postgres custom
- [Mobile App](https://vietcodex.com/dich-vu/mobile-app): React Native + Expo
- [SaaS Build](https://vietcodex.com/dich-vu/saas): Multi-tenant Next.js
## Knowledge Base
- [Wiki Index](https://wiki.vietcodex.com): 60+ bài cho non-tech founder
- [Cluster Cơ Bản](https://wiki.vietcodex.com/co-ban): web/app/SaaS foundation
- [Cluster AI Coding](https://wiki.vietcodex.com/ai-coding): vibe coding, MCP, RAG
- [Cluster SEO](https://wiki.vietcodex.com/seo): GEO, AEO, AI Overview
## About
- [Methodology](https://vietcodex.com/methodology): 6-Phase Production Workflow
- [Engineering Principles](https://vietcodex.com/engineering-principles): 13 principles
## Contact
- Email: [email protected]
- Website: https://vietcodex.comVariant /llms-full.txt
Same path nhưng chứa toàn bộ content Markdown (dài 50-500k token). Cho AI có context đầy đủ trong 1 fetch thay vì crawl từng URL.
# VietCodex Wiki Full Content
[All 60 articles concatenated với heading hierarchy]Sites adopt 2025
| Site | URL |
|---|---|
| Anthropic Docs | https://docs.anthropic.com/llms.txt |
| Cloudflare | https://developers.cloudflare.com/llms.txt |
| Stripe | https://stripe.com/llms.txt |
| Cursor | https://docs.cursor.com/llms.txt |
| Vercel | https://vercel.com/llms.txt |
| FastHTML | https://fastht.ml/docs/llms.txt |
Generate llms.txt cho vietcodex.com
Script Node.js đơn giản đọc sitemap + frontmatter:
// scripts/generate-llms-txt.ts
import fs from "node:fs/promises";
const articles = await loadAllWikiArticles(); // 60 articles
const llmsTxt = `# VietCodex
> AI-native dev agency Vietnam
## Wiki (60 bài)
${articles.map(a => `- [${a.title}](https://wiki.vietcodex.com/${a.slug}): ${a.description}`).join("\n")}
## Services
- [Web Design](https://vietcodex.com/dich-vu/thiet-ke-web)
- [Mobile App](https://vietcodex.com/dich-vu/mobile-app)
`;
await fs.writeFile("public/llms.txt", llmsTxt);Run trong build hook (như build-wiki-index.mjs đã có).
AI crawler — top 10 + cách identify
Top crawler User-Agent strings 2026:
| Bot | User-Agent | Owner | Purpose |
|---|---|---|---|
| GPTBot | Mozilla/5.0 ... GPTBot/1.2 | OpenAI | ChatGPT training |
| ChatGPT-User | ... ChatGPT-User/1.0 ... | OpenAI | ChatGPT Browse mode |
| OAI-SearchBot | ... OAI-SearchBot/1.0 ... | OpenAI | ChatGPT Search index |
| ClaudeBot | Claude-Web/1.0 hoặc ClaudeBot/1.0 | Anthropic | Claude training |
| anthropic-ai | anthropic-ai | Anthropic | Claude real-time fetch |
| PerplexityBot | PerplexityBot/1.0 | Perplexity | RAG cite |
| Perplexity-User | Perplexity-User | Perplexity | User-triggered fetch |
| Google-Extended | (regular Googlebot, opt-out flag) | Bard/Gemini training | |
| Applebot-Extended | Applebot-Extended | Apple | Apple Intelligence |
| CCBot | CCBot/2.0 | Common Crawl | Open dataset (used by many) |
| Bytespider | Bytespider | ByteDance | TikTok AI |
| Amazonbot | Amazonbot/0.1 | Amazon | Alexa AI |
| Meta-ExternalAgent | meta-externalagent/1.1 | Meta | Llama training |
robots.txt config
# Allow major AI engines (free brand visibility)
User-agent: GPTBot
Allow: /
User-agent: ClaudeBot
Allow: /
User-agent: PerplexityBot
Allow: /
User-agent: Google-Extended
Allow: /
# Block aggressive scrapers
User-agent: Bytespider
Disallow: /
User-agent: CCBot
Disallow: /
# Protect specific paths
User-agent: *
Disallow: /admin/
Disallow: /api/
Disallow: /dashboard/
Sitemap: https://vietcodex.com/sitemap.xml
Check log để biết bot đang crawl
# Nginx access log
grep -E 'GPTBot|ClaudeBot|PerplexityBot' /var/log/nginx/access.log | wc -l
# Per-bot count last 24h
awk -F'"' '/GPTBot|ClaudeBot/ {print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rnCloudflare có UI: Analytics → Security → Bot Score breakdown by bot category.
Markdown-first content strategy
3 ways serve Markdown cho AI:
1. Markdown source + HTML render
Như wiki.vietcodex.com: MDX file là source of truth, Next.js render thành HTML cho browser. Có thể expose endpoint /api/markdown/[slug] trả Markdown raw cho AI.
// app/api/markdown/[...slug]/route.ts
export async function GET(req: Request, { params }: { params: Promise<{ slug: string[] }> }) {
const { slug } = await params;
const article = await getArticleBySlug(slug.join("/"));
return new Response(article.body, {
headers: { "Content-Type": "text/markdown; charset=utf-8" }
});
}URL: https://wiki.vietcodex.com/api/markdown/co-ban/api-la-gi
2. .md extension fallback
Anthropic docs pattern: cùng URL với .md suffix → return Markdown:
https://docs.anthropic.com/en/docs/intro → HTML
https://docs.anthropic.com/en/docs/intro.md → Markdown
Implement: middleware check .md suffix, rewrite to markdown handler.
3. Pre-generated /llms-full.txt
Build-time concatenate all content thành 1 file:
https://vietcodex.com/llms-full.txt
AI fetch 1 lần, có toàn bộ site. Update mỗi build.
Đo LLMO performance
| Metric | Tool | Note |
|---|---|---|
| AI crawler hits/day | Server log + Cloudflare | Track GPTBot/ClaudeBot trend |
| Content age in AI training | Manual: ask AI specific 2026 content | If AI know → crawled + trained |
| llms.txt fetch | Server log filter | Verify AI fetching llms.txt |
| Markdown vs HTML ratio | Server log by Accept header | If AI heavy → markdown winning |
| Citation lag time | Compare publish date vs first AI cite | Track AI engine update cycle |
Ví dụ thực tế: vietcodex.com LLMO playbook
Stack hiện tại (2026-05-22):
- robots.txt: Allow GPTBot/ClaudeBot/PerplexityBot/Google-Extended
- sitemap.xml: 60+ wiki articles + services + landing
- JSON-LD @graph: Article + FAQPage + BreadcrumbList mỗi page
- HTML serve UTF-8 + lang="vi"
To-do (next sprint):
- [ ] Generate llms.txt từ wiki index
- [ ] Generate llms-full.txt (60 articles ~200k token)
- [ ] Add /api/markdown/[slug] endpoint
- [ ] Expose `.md` extension fallback
- [ ] Block Bytespider + CCBot (không strategic)
- [ ] Cloudflare bot management: rate limit 100 req/min/bot
Effort: 4-6 giờ implement. Impact: dễ AI crawl + cite hơn 30-50%.
Cái gì có thể sai
| Vấn đề | Triệu chứng | Cách fix |
|---|---|---|
| Bot crawl quá nhiều, server overload | High CPU + bandwidth spike | Cloudflare rate limit + 503 for excessive bot |
| AI cite thông tin lỗi thời | Bot crawled 2022 version, chưa re-crawl | Submit URL inspection Search Console, ping IndexNow |
| Markdown render khác HTML | Code block / image / link broken | Test endpoint manual, fix conversion |
| Bot ignore robots.txt | Bot không tuân (illegal) | Block IP range (last resort, brittle) |
| llms.txt không được fetch | AI engine không support format | Standard chưa 100% — wait + monitor |
| Vietnamese encoding garbled | Wrong Content-Type | Set charset=utf-8 explicitly |
| Sitemap không include section | Auto-gen miss path | Manual add hoặc fix sitemap generator |
Tóm tắt 1 dòng
LLMO = layer technical của GEO. 3 file: robots.txt (legacy 1994, allow AI bot strategic), llms.txt (chuẩn mới 2024 Anthropic/Stripe adopt — giới thiệu site cho LLM), sitemap.xml. 10+ AI crawler 2026: GPTBot, ClaudeBot, PerplexityBot, Google-Extended, Applebot-Extended, etc. Allow chính cho visibility, block aggressive (Bytespider/CCBot) tiết kiệm bandwidth. Markdown-first content giúp AI parse tốt hơn HTML. Effort 4-6 giờ implement = 30-50% improvement AI crawl + cite rate.
Đọc tiếp
- GEO (Generative Engine Optimization) — strategy layer cho cite trong AI response
- AEO (Answer Engine Optimization) — sister framework cho answer surface
- SEO là gì? Cách Google xếp hạng website — foundation traditional SEO
- Brand Mention era AI — measure brand visibility AI engine (cùng wave)