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).

8 phút đọcCập nhật 2026-05-23
Nghe bài viết
Để Claude đọc bài cho bạn — vừa nghe vừa làm việc khác
Mục lục bài viết(19)
Sơ đồ so sánh Search Engines, Knowledge Graphs, và Large Language Models 2025

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 + keywordIndex để rank
AI crawler (GPTBot/ClaudeBot)Đọc kỹ nội dung để hiểuTrain LLM + answer query
Real-time AI fetch (Perplexity)Đọc current page khi user queryCite 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 .md version 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.com

Variant /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

SiteURL
Anthropic Docshttps://docs.anthropic.com/llms.txt
Cloudflarehttps://developers.cloudflare.com/llms.txt
Stripehttps://stripe.com/llms.txt
Cursorhttps://docs.cursor.com/llms.txt
Vercelhttps://vercel.com/llms.txt
FastHTMLhttps://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:

BotUser-AgentOwnerPurpose
GPTBotMozilla/5.0 ... GPTBot/1.2OpenAIChatGPT training
ChatGPT-User... ChatGPT-User/1.0 ...OpenAIChatGPT Browse mode
OAI-SearchBot... OAI-SearchBot/1.0 ...OpenAIChatGPT Search index
ClaudeBotClaude-Web/1.0 hoặc ClaudeBot/1.0AnthropicClaude training
anthropic-aianthropic-aiAnthropicClaude real-time fetch
PerplexityBotPerplexityBot/1.0PerplexityRAG cite
Perplexity-UserPerplexity-UserPerplexityUser-triggered fetch
Google-Extended(regular Googlebot, opt-out flag)GoogleBard/Gemini training
Applebot-ExtendedApplebot-ExtendedAppleApple Intelligence
CCBotCCBot/2.0Common CrawlOpen dataset (used by many)
BytespiderBytespiderByteDanceTikTok AI
AmazonbotAmazonbot/0.1AmazonAlexa AI
Meta-ExternalAgentmeta-externalagent/1.1MetaLlama 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 -rn

Cloudflare 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

MetricToolNote
AI crawler hits/dayServer log + CloudflareTrack GPTBot/ClaudeBot trend
Content age in AI trainingManual: ask AI specific 2026 contentIf AI know → crawled + trained
llms.txt fetchServer log filterVerify AI fetching llms.txt
Markdown vs HTML ratioServer log by Accept headerIf AI heavy → markdown winning
Citation lag timeCompare publish date vs first AI citeTrack 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ứngCách fix
Bot crawl quá nhiều, server overloadHigh CPU + bandwidth spikeCloudflare rate limit + 503 for excessive bot
AI cite thông tin lỗi thờiBot crawled 2022 version, chưa re-crawlSubmit URL inspection Search Console, ping IndexNow
Markdown render khác HTMLCode block / image / link brokenTest endpoint manual, fix conversion
Bot ignore robots.txtBot không tuân (illegal)Block IP range (last resort, brittle)
llms.txt không được fetchAI engine không support formatStandard chưa 100% — wait + monitor
Vietnamese encoding garbledWrong Content-TypeSet charset=utf-8 explicitly
Sitemap không include sectionAuto-gen miss pathManual 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

Câu hỏi thường gặp

llms.txt là gì? Có phải chuẩn chính thức không?
llms.txt là chuẩn ĐỀ XUẤT (proposal) từ Jeremy Howard (Answer.AI) tháng 9/2024 — đặt file `/llms.txt` ở root domain để hướng dẫn LLM cách 'đọc' site. Format Markdown đơn giản: title + description + links to key docs (markdown version). KHÔNG chính thức W3C/IETF, nhưng đã có > 1000 site adopt (Anthropic, Cloudflare, Stripe). LLMs không bắt buộc tuân theo. Tuy nhiên ngày càng nhiều AI engine respect — đặt llms.txt = signal pro-AI friendliness. Có 2 variant: `/llms.txt` (concise nav) + `/llms-full.txt` (toàn bộ content markdown).
robots.txt và llms.txt khác nhau?
robots.txt: chuẩn từ 1994, kiểm soát crawler nói chung (Googlebot, Bingbot). Format: Allow/Disallow path. llms.txt: chuẩn mới 2024, GIỚI THIỆU site cho LLM thay vì block — chứa overview + key links. Hai file bổ trợ nhau: robots.txt nói 'được crawl gì', llms.txt nói 'đây là cấu trúc + content quan trọng'. Đặt cả 2 trên cùng root. robots.txt phải có (legal/technical), llms.txt nice-to-have (signal 2026). Mọi production site nên có robots.txt; site có content cho AI consume nên có llms.txt.
AI crawler nào đang scrape web? Có chặn được không?
Top 10 AI crawler 2026: (1) **GPTBot** (OpenAI ChatGPT) — train + answer; (2) **ClaudeBot** (Anthropic) — train + Claude Code; (3) **anthropic-ai** (Anthropic real-time fetch); (4) **PerplexityBot** — RAG-style cite; (5) **Google-Extended** (Google AI training opt-out); (6) **Applebot-Extended** (Apple Intelligence); (7) **CCBot** (Common Crawl); (8) **Bytespider** (TikTok/ByteDance); (9) **FacebookBot** / **Meta-ExternalAgent**; (10) **Amazonbot**. Chặn qua robots.txt: `User-agent: GPTBot\nDisallow: /`. Allow qua absence (default allow). Quy tắc 2026: allow chính (GPTBot/ClaudeBot/PerplexityBot) cho brand visibility, block crawler không mục đích (ByteSpider unless TikTok marketing).
Markdown-first vs HTML — AI crawler thích cái nào?
Markdown-first thắng cho AI consumption: (1) AI parser convert HTML → Markdown anyway (mọi RAG pipeline); (2) Markdown clean hơn — không nested div soup; (3) Semantic structure rõ (heading hierarchy, list, table, code fence); (4) Smaller file = faster crawl; (5) llms.txt convention default Markdown. Hybrid pattern: serve HTML cho browser + expose `/page.md` cho AI (Cloudflare có nhiệm vụ '/.../md' transform). Anthropic docs, Stripe docs, OpenAI docs đều có `.md` version. wiki.vietcodex.com source MDX — có thể generate .md fallback cho AI.
Có cần chặn ClaudeBot hoặc GPTBot cho privacy?
Tuỳ business: (1) **Public content (blog, marketing, docs)**: allow để AI cite → free brand visibility; (2) **Member-only / paid content**: block bằng auth + thêm User-Agent rule robots.txt; (3) **PII (user profile, order history)**: block toàn bộ + check headers; (4) **Code repository public GitHub**: thường allow, contributing to AI training is community standard; (5) **Original research/data**: dilemma — allow để cite nhưng risk competitor scrape via AI. NYT đã sue OpenAI 2023 cho việc scrape content trả phí. Quy tắc: marketing content allow, customer data block.
Cách kiểm tra AI engine có crawl site mình không?
3 cách check: (1) **Server log** — grep User-Agent qua nginx/apache log: `grep -E 'GPTBot|ClaudeBot|PerplexityBot' access.log`. Nếu thấy = đang crawl; (2) **Cloudflare Analytics** — dashboard có 'AI Bots' section breakdown by bot; (3) **Manual test** — vào ChatGPT/Claude/Perplexity hỏi câu cụ thể có trong content site bạn, xem AI có trả về info đó không. AI crawl không đồng nghĩa cite — nhưng crawl là điều kiện cần. Refresh cycle: AI train data updated mỗi 3-6 tháng, real-time fetch (Perplexity, ChatGPT Browse) crawl ad-hoc.
Vietnamese content có vấn đề gì với AI crawler không?
Có 3 challenge: (1) **Encoding** — UTF-8 mandatory, ASCII-only crawler legacy không đọc được dấu thanh. Set `Content-Type: text/html; charset=utf-8`; (2) **Multilingual ambiguity** — bài có cả EN + VN khiến AI confuse target language. Set `<html lang='vi'>` + `hreflang` chính xác; (3) **Tokenizer overhead** — Vietnamese tốn 2-3x token so EN → AI có thể truncate giữa chừng. Solution: chunk content thành section ngắn 500-800 từ với heading rõ. wiki.vietcodex.com all-Vietnamese hiện crawl OK qua GPTBot/ClaudeBot dựa trên log.