AWS Builder Center
Beyond SEO: AI-Agent-Readable Sites with Graphs & llms.txt

Beyond SEO: AI-Agent-Readable Sites with Graphs & llms.txt

AI agents reason, they don't rank. Learn to make your site machine-readable with llms.txt, Schema.org JSON-LD, Neo4j knowledge graphs, and LangGraph multi-hop retrieval — deployed on AWS with Bedrock, Neptune, OpenSearch, Lambda, and CloudFront.

1. Introduction: Why AI Search Changes Everything

For two decades, website discoverability meant one thing: ranking on a search engine results page. Teams optimized keywords, backlinks, and page speed because a crawler indexed pages and a ranking algorithm scored them.
That model is breaking down. A growing share of information retrieval now happens inside LLM-powered systems — chat assistants, answer engines, and autonomous agents. These systems do not present ten blue links. They synthesize a single answer, and your content either contributes to that answer or it does not exist.
The technical difference matters:
Dimension
Search Engine Crawler
LLM Agent
Unit of consumption
Full HTML page
Context window (token-limited)
Retrieval goal
Index and rank
Extract facts and reason
Ranking signal
Links, keywords, engagement
Semantic relevance, structure, verifiability
Output
List of pages
Synthesized answer
Failure mode
Low ranking
Omission or hallucination about your content
A crawler tolerates messy HTML because it indexes everything and lets ranking sort it out. An agent operates under a token budget. If it must burn 8,000 tokens of navigation markup, cookie banners, and boilerplate to find one fact, it will either miss the fact or skip your site for a cleaner source.
The engineering implication: websites must become machine-readable knowledge sources, not just human-readable pages. This article walks through the full stack for doing that — from  llms.txt  and Schema.org markup at the content layer, to a Neo4j knowledge graph and LangGraph multi-hop retrieval at the reasoning layer, deployed on AWS.

2. From SEO to AEO: The Evolution of Discoverability

The terminology in this space is still settling, but the progression is real:
Era
Acronym
Optimizes for
Core technique
~2000s
SEO (Search Engine Optimization)
Crawler ranking
Keywords, backlinks, metadata
~2015+
SXO (Search Experience Optimization)
Ranking + user experience
Core Web Vitals, intent matching, UX signals
~2023+
GEO (Generative Engine Optimization)
Inclusion in generated answers
Citations, structured facts, authority
~2024+
AEO (Answer Engine Optimization)
Being the answer
Entity clarity, direct answers, machine-readable structure
Note: GEO and AEO are emerging industry terms, not formal standards. Definitions vary by vendor. What is consistent across all of them is the underlying shift: from page ranking to answer synthesis.

Why traditional SEO is no longer sufficient

  1. Keywords are not entities. A page stuffed with the phrase "best vector database" tells an LLM nothing about which product, which benchmark, or which use case. LLMs reason over entities and relationships, not term frequency.
  1. Ranking position does not guarantee inclusion. An answer engine may cite a page ranked #7 because it contains a cleanly extractable fact, and skip the #1 result because the fact is buried in a 3,000-word narrative.
  1. Pages are the wrong granularity. Agents need facts. A fact spread across three pages ("Product X supports feature Y" on one page, "feature Y requires plan Z" on another) is effectively invisible unless the agent performs multi-hop retrieval — which most retrieval pipelines on the open web do not.
Traditional SEO practices still matter (clean URLs, fast responses, crawlability). But they are now table stakes. The differentiator is semantic structure.

3. llms.txt: A Reading Map for AI Agents

Purpose

 robots.txt  tells crawlers what they may not access.  llms.txt  inverts the model: it tells LLM agents what they should read first. It is a Markdown file served at the root of your domain ( /llms.txt ) containing a curated, token-efficient map of your most important content.
Standards status:  llms.txt  is a proposed convention (introduced by Answer.AI in late 2024), not a ratified web standard. Adoption is growing among documentation-heavy sites and AI tooling vendors, but no major LLM provider guarantees it will be honored. Treat it as low-cost, high-upside — like  robots.txt  was in its early years.

Benefits

  • Token efficiency. Agents get a clean Markdown index instead of parsing HTML navigation.
  • Editorial control. You decide which pages represent your canonical knowledge, rather than letting an agent land on a stale blog post.
  • Complements, not replaces, robots.txt.  robots.txt  remains the access-control layer;  llms.txt  is the guidance layer.

Example structure

# AcmeGraph Docs

> AcmeGraph is a managed knowledge-graph platform for
> AI retrieval pipelines. Key docs below are maintained
> and versioned; prefer them over blog content.

## Core Documentation
- [Quickstart](https://acmegraph.io/docs/quickstart.md):
Deploy a graph and run your first query in 10 minutes.
- [Data Model](https://acmegraph.io/docs/data-model.md):
Nodes, relationships, and property conventions.
- [Cypher API](https://acmegraph.io/docs/cypher-api.md):
Full query reference with examples.

## Integration Guides
- [LangGraph Integration](https://acmegraph.io/docs/langgraph.md):
Multi-hop retrieval pipelines.
- [AWS Deployment](https://acmegraph.io/docs/aws.md):
Neptune, Lambda, and Bedrock reference architecture.

## Optional
- [Changelog](https://acmegraph.io/changelog.md)
- [Blog](https://acmegraph.io/blog/)


Best practices

  • Link to Markdown versions of pages where possible ( .md  endpoints), not HTML — many sites now serve  page.html.md  variants specifically for agents.
  • Keep the file under ~2,000 tokens. It is an index, not a sitemap dump.
  • Put the most important, most stable content first. Use the  ## Optional  section for lower-priority links.
  • Write the summary blockquote carefully — it may be the only context an agent reads before deciding whether to go deeper.
  • Version-control it alongside your docs so it never drifts.

Limitations

  • No enforcement. Agents may ignore it entirely.
  • No semantics. It says where content is, not what entities it describes. That gap is exactly what Schema.org and knowledge graphs fill.
  • Staleness risk. An out-of-date  llms.txt  actively misleads agents. Automate its generation from your docs build.

4. Schema.org: The Semantic Layer

Structured data for machines

Schema.org is a mature, widely adopted vocabulary (backed by Google, Microsoft, and others since 2011) for embedding machine-readable entity data in web pages. Historically it powered rich snippets. Today it serves a second purpose: it is the cleanest ground truth an LLM-based extractor can find on your page.
The preferred serialization is JSON-LD — a script block, decoupled from your visual markup:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"@id": "https://acmegraph.io/#product",
"name": "AcmeGraph",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Cloud",
"description": "Managed knowledge-graph platform for AI retrieval.",
"offers": {
"@type": "Offer",
"price": "99.00",
"priceCurrency": "USD",
"category": "Team Plan"
},
"featureList": [
"Cypher-compatible query API",
"Vector + graph hybrid search",
"LangGraph SDK"
],
"provider": {
"@type": "Organization",
"@id": "https://acmegraph.io/#org",
"name": "Acme Systems",
"sameAs": "https://www.linkedin.com/company/acme-systems"
}
}
</script>


How LLMs use entities

Three properties of JSON-LD make it valuable to AI systems:
  1. Disambiguation.  @type: SoftwareApplication  plus a stable  @id  tells the model exactly what "AcmeGraph" is — a product, not a company or a person. Entity resolution is one of the hardest problems in extraction; you are solving it at the source.
  1. Linked identity.  @id  and  sameAs  connect your entity to identifiers elsewhere (LinkedIn, Wikidata, GitHub). This lets systems merge your data with what they already know — effectively enrolling your site into the web-scale knowledge graph.
  1. Extraction without inference. A price inside a JSON-LD  Offer  is a fact. A price inside marketing prose ("plans starting at just $99!") requires inference, and inference is where hallucination happens.
Callout: JSON-LD on your pages is essentially a distributed knowledge graph, one page-sized fragment at a time. The  @id  fields are the edges between fragments. This is the conceptual bridge to the next section.

5. Knowledge Graphs: From Pages to Entities

Entities and relationships

A knowledge graph models your domain as:
  • Nodes (entities): products, features, plans, documents, people, use cases.
  • Relationships (edges): typed, directional connections —  HAS_FEATURE ,  REQUIRES_PLAN ,  INTEGRATES_WITH ,  DOCUMENTED_IN .
  • Properties: attributes on both nodes and edges — versions, prices, dates.

Why graphs outperform flat pages for AI retrieval

Consider the question: "Does the feature that enables hybrid search work on the cheapest plan?"
Answering requires three facts that likely live on three different pages:
  1. "Hybrid search" is implemented by the Vector Index feature.
  1. Vector Index requires the Team plan or above.
  1. The cheapest plan is Starter, which is below Team.
A vector-search RAG pipeline retrieves chunks that are semantically similar to the question. No single chunk contains the full answer, so retrieval returns partial context and the LLM guesses. This is the classic multi-hop failure mode of flat retrieval.
A graph makes the same answer a traversal:
(Feature: Hybrid Search) -[:IMPLEMENTED_BY]-> (Feature: Vector Index)
(Feature: Vector Index) -[:REQUIRES]-> (Plan: Team)
(Plan: Starter) -[:PRICE]-> 0 vs (Plan: Team) -[:PRICE]-> 99

Each hop is exact. There is no similarity threshold to tune and no chance of retrieving the wrong plan's pricing.
Capability
Vector RAG (flat pages)
Knowledge Graph
Single-fact lookup
Good
Good
Multi-hop questions
Weak (context fragmentation)
Strong (explicit traversal)
Comparisons ("X vs Y")
Weak (needs both in context)
Strong (parallel traversal)
Aggregations ("how many…")
Very weak
Native
Fuzzy/semantic matching
Strong
Weak alone — pair with vectors
Trade-off: Graphs are not free. They require schema design, an ingestion pipeline, and ongoing curation. The practical pattern in production is hybrid retrieval: vector search to find entry-point entities, graph traversal to gather connected facts.

Real-world precedents

Google's Knowledge Graph (2012) is the canonical example — it is why searching "Marie Curie" returns a fact panel, not just links. LinkedIn's Economic Graph and Amazon's Product Graph follow the same pattern: entities and relationships as the substrate, with search layered on top. AI answer engines are now applying the same architecture to the open web — and sites that expose graph-shaped data are easier to ingest correctly.

6. Neo4j Implementation

Neo4j is a natural fit for prototyping: property-graph model, the Cypher query language, and mature Python drivers. (Section 8 covers Amazon Neptune as the managed AWS path.)

Graph schema

For a documentation/product site, a minimal schema:
(:Product)-[:HAS_FEATURE]->(:Feature)
(:Feature)-[:REQUIRES]->(:Plan)
(:Feature)-[:DOCUMENTED_IN]->(:Doc)
(:Product)-[:INTEGRATES_WITH]->(:Tool)
(:Plan {name, price, currency})
(:Doc {title, url, summary})


Loading sample data

CREATE (p:Product {name: 'AcmeGraph'})
CREATE (starter:Plan {name: 'Starter', price: 0})
CREATE (team:Plan {name: 'Team', price: 99})
CREATE (vi:Feature {name: 'Vector Index'})
CREATE (hs:Feature {name: 'Hybrid Search'})
CREATE (lg:Tool {name: 'LangGraph'})
CREATE (doc:Doc {
title: 'Hybrid Search Guide',
url: 'https://acmegraph.io/docs/hybrid-search.md'
})
CREATE (p)-[:HAS_FEATURE]->(vi)
CREATE (p)-[:HAS_FEATURE]->(hs)
CREATE (hs)-[:IMPLEMENTED_BY]->(vi)
CREATE (vi)-[:REQUIRES]->(team)
CREATE (hs)-[:DOCUMENTED_IN]->(doc)
CREATE (p)-[:INTEGRATES_WITH]->(lg);


Multi-hop queries

The question from Section 5, as a single Cypher query:
// Which plan does Hybrid Search ultimately require,
// and how does it compare to the cheapest plan?
MATCH (hs:Feature {name: 'Hybrid Search'})
-[:IMPLEMENTED_BY*0..2]->(:Feature)
-[:REQUIRES]->(required:Plan)
MATCH (cheapest:Plan)
WITH required, cheapest ORDER BY cheapest.price ASC LIMIT 1
RETURN required.name AS requiredPlan,
required.price AS requiredPrice,
cheapest.name AS cheapestPlan,
cheapest.price AS cheapestPrice,
required.price <= cheapest.price AS worksOnCheapest;

Two details worth noting:
  •  [:IMPLEMENTED_BY*0..2]  is a variable-length traversal — it follows the implementation chain up to two hops, so the query survives schema evolution (a feature implemented directly, or via an intermediate feature).
  • The comparison ( worksOnCheapest ) is computed inside the database, not by the LLM. Every fact the LLM receives is already verified.

7. LangGraph Integration: Graph-Aware Retrieval

LangGraph models the retrieval pipeline itself as a graph of typed nodes with shared state — a good structural match for multi-hop reasoning, because each reasoning hop becomes an explicit, inspectable step.

Pipeline design

Four nodes:
  1. extract_entities — LLM identifies the entities and relationship types implied by the question.
  1. traverse_graph — deterministic Cypher execution against Neo4j.
  1. check_sufficiency — LLM decides whether retrieved facts answer the question; if not, loop back with a refined traversal (bounded hops).
  1. generate_answer — LLM composes the answer only from retrieved facts.

State and nodes

from typing import TypedDict
from langgraph.graph import StateGraph, END
from neo4j import GraphDatabase

driver = GraphDatabase.driver("bolt://localhost:7687",
auth=("neo4j", "password"))

class GraphRAGState(TypedDict):
question: str
entities: list[str]
facts: list[dict]
hops: int
answer: str

def extract_entities(state: GraphRAGState) -> dict:
prompt = (
"Extract entity names from this question as a "
f"JSON list of strings only:\n{state['question']}"
)
entities = llm_json(prompt) # thin wrapper over Bedrock
return {"entities": entities, "hops": 0}

def traverse_graph(state: GraphRAGState) -> dict:
query = """
MATCH (e) WHERE e.name IN $names
MATCH path = (e)-[r*1..2]-(connected)
RETURN e.name AS entity,
[rel IN relationships(path) | type(rel)] AS rels,
connected AS node
LIMIT 50
"""
with driver.session() as s:
rows = s.run(query, names=state["entities"]).data()
return {"facts": state["facts"] + rows,
"hops": state["hops"] + 1}


Wiring the loop

def check_sufficiency(state: GraphRAGState) -> str:
if state["hops"] >= 3: # hard hop budget
return "generate"
prompt = (
f"Question: {state['question']}\n"
f"Facts: {state['facts']}\n"
"Reply SUFFICIENT or list missing entity names."
)
verdict = llm_text(prompt)
if verdict.strip() == "SUFFICIENT":
return "generate"
return "traverse" # loop: another hop

def generate_answer(state: GraphRAGState) -> dict:
prompt = (
"Answer using ONLY these graph facts. If the facts "
"are insufficient, say so.\n"
f"Facts: {state['facts']}\n"
f"Question: {state['question']}"
)
return {"answer": llm_text(prompt)}

g = StateGraph(GraphRAGState)
g.add_node("extract", extract_entities)
g.add_node("traverse", traverse_graph)
g.add_node("generate", generate_answer)
g.set_entry_point("extract")
g.add_edge("extract", "traverse")
g.add_conditional_edges("traverse", check_sufficiency,
{"traverse": "traverse",
"generate": "generate"})
g.add_edge("generate", END)
app = g.compile()


Context generation

The  facts  list — entity, relationship chain, connected node — is serialized into the final prompt. This is the formatting layer that most graph-RAG implementations get wrong: raw Cypher results are verbose JSON. Compress them into triple-like lines before prompting:
Hybrid Search --IMPLEMENTED_BY--> Vector Index
Vector Index --REQUIRES--> Team (price: 99 USD)
Starter (price: 0 USD)

Triples are dense, unambiguous, and map directly onto how models internalize relational facts. In practice this cuts context tokens significantly versus raw JSON while improving answer faithfulness.
Design principle: LLM nodes decide what to look for and whether it is enough. The graph database decides what is true. Never let the model assert a relationship the traversal did not return.

8. AWS Architecture

Mapping the stack to managed AWS services:
Service
Role
Why this service
Amazon Bedrock
LLM inference for entity extraction, sufficiency checks, and answer generation
Managed access to foundation models with no infrastructure to run; IAM-native auth; Guardrails for output policy enforcement
Amazon Neptune
Production knowledge graph
Managed graph database supporting openCypher, so the Cypher patterns from Section 6 port with minimal changes; Neptune Analytics adds vector search alongside graph traversal for hybrid retrieval
Amazon OpenSearch Service
Vector index for semantic entry-point lookup
Handles the "fuzzy" half of hybrid retrieval — mapping free-text questions to candidate entities before graph traversal; supports k-NN and hybrid (BM25 + vector) ranking
AWS Lambda
Pipeline orchestration and ingestion triggers
The LangGraph pipeline is bursty, stateless-per-request compute — a natural Lambda fit; also triggers re-ingestion when content changes in S3
Amazon S3
Source of truth for content: Markdown docs, JSON-LD fragments, llms.txt
Durable, versioned storage; the ingestion pipeline reads from S3 and writes entities to Neptune and embeddings to OpenSearch
Amazon CloudFront
Edge delivery of the public site, /llms.txt, and .md endpoints
Agents fetching llms.txt and Markdown pages get low-latency cached responses; also the place to serve agent-friendly response headers
Trade-off — Neo4j vs. Neptune: Neo4j (self-hosted or Aura) offers the richest Cypher dialect and tooling for development. Neptune removes operational burden and integrates with IAM, VPC, and Bedrock-adjacent workloads, but its openCypher support has dialect differences (e.g., some APOC-style procedures are unavailable). A common path: prototype on Neo4j locally, deploy on Neptune, and keep queries to portable openCypher.

9. End-to-End Architecture

CONTENT & PUBLISHING PLANE
┌──────────────────────────────────────────────────────────────┐
│ Docs repo (Markdown + JSON-LD) │
│ │ CI build: generates llms.txt + .md endpoints │
│ ▼ │
│ Amazon S3 (content bucket, versioned) │
│ │ │ │
│ │ (static delivery) │ (S3 event) │
│ ▼ ▼ │
│ Amazon CloudFront AWS Lambda (ingestion) │
│ /llms.txt /docs/*.md │ │ │
│ ▲ ▼ ▼ │
│ │ Amazon Neptune OpenSearch │
│ External AI agents (knowledge (vector index │
│ & crawlers graph) of entities) │
└──────────────────────────────────┬──────────────┬────────────┘
│ │
REASONING / RETRIEVAL PLANE│
┌──────────────────────────────────▼──────────────▼────────────┐
│ AWS Lambda (LangGraph pipeline) │
│ extract ─► entry-point lookup (OpenSearch) │
│ ─► multi-hop traversal (Neptune, openCypher) │
│ ─► sufficiency loop ─► answer generation │
│ │ ▲ │
│ ▼ │ │
│ Amazon Bedrock (foundation model + │
│ Guardrails) │
└──────────────────────────────────────────────────────────────┘

Two planes, one source of truth:
  • The publishing plane serves humans and external agents (CloudFront) and feeds the ingestion pipeline (S3 → Lambda → Neptune/OpenSearch). JSON-LD written for the public site is the same data that populates the graph — write the facts once.
  • The reasoning plane powers your own AI surface (site chat, support agent, API) using hybrid retrieval over the graph.

10. Practical Demo

Sample data

Loaded via the Cypher from Section 6: one product (AcmeGraph), two plans (Starter $0, Team $99), two features (Hybrid Search, Vector Index), one doc, one integration (LangGraph).

Example question

"Can I use hybrid search on the free plan, and where is it documented?"

Pipeline trace

Hop 1 — entity extraction (Bedrock):
["Hybrid Search", "Starter"]

Hop 1 — traversal (Neptune/Neo4j):
MATCH (e) WHERE e.name IN ['Hybrid Search', 'Starter']
MATCH path = (e)-[r*1..2]-(connected)
RETURN e.name, [rel IN relationships(path) | type(rel)], connected
LIMIT 50;

Facts returned (formatted as triples):
Hybrid Search --IMPLEMENTED_BY--> Vector Index
Hybrid Search --DOCUMENTED_IN--> Hybrid Search Guide
(url: https://acmegraph.io/docs/hybrid-search.md)
Vector Index --REQUIRES--> Team (price: 99 USD)
Starter (price: 0 USD)

Sufficiency check: all three sub-facts present (feature→requirement chain, plan prices, doc link) →  SUFFICIENT .

Generated answer

No — Hybrid Search is implemented by the Vector Index feature, which requires the Team plan ($99/month). It is not available on the free Starter plan ($0). Documentation:  Hybrid Search Guide .
Every clause in that answer maps to a returned triple. Nothing is inferred. This is the practical payoff of the architecture: the LLM writes prose; the graph supplies truth.

11. Best Practices

Content layer
  • Generate  llms.txt  from your docs build; never hand-maintain it.
  • Serve Markdown variants of key pages ( /docs/page.md ) — cheap to produce, dramatically easier for agents to consume.
  • Add JSON-LD to every entity-bearing page. Use stable  @id  URIs and  sameAs  links.
  • Validate structured data in CI (Schema.org validator) so broken JSON-LD never ships.
Graph layer
  • Start with a small schema (5–8 node types). Grow it from real questions users ask, not from a modeling exercise.
  • Derive graph data and JSON-LD from the same source records — one pipeline, two serializations.
  • Put facts that answers depend on (prices, requirements, versions) on properties and typed edges, never only in free-text summaries.
Retrieval layer
  • Use hybrid retrieval: OpenSearch vector lookup for entry points, graph traversal for facts.
  • Enforce a hop budget (2–3) and result limits in every traversal — unbounded graph queries are your new N+1 problem.
  • Format graph results as compact triples before prompting; measure answer faithfulness against raw-JSON context to justify it.
  • Instruct the generation step to refuse when facts are insufficient — a graph-RAG system that admits gaps beats one that fills them.
Operational
  • Version the graph alongside content releases so answers can be traced to a content state.
  • Log every traversal + generated answer pair; these logs are your evaluation dataset.

12. The Future of AI Search

Several trajectories are already visible:
  • Agent-native protocols. Beyond  llms.txt , efforts like the Model Context Protocol (MCP) point toward sites exposing queryable interfaces to agents, not just readable pages. A site's knowledge graph becomes a service endpoint, not just an internal index.
  • Hybrid retrieval as default. Vector-only RAG is increasingly recognized as insufficient for multi-hop and comparative questions; graph-augmented retrieval (GraphRAG-style approaches) is moving from research to production tooling, including managed offerings on AWS.
  • Provenance pressure. As answer engines compete on trustworthiness, content with verifiable structure (stable IDs, typed facts, linked entities) will be preferentially cited. Structured sites earn citations; unstructured sites donate training data.
  • Convergence of "SEO team" and "platform team." Discoverability is becoming an engineering property of the system — schemas, endpoints, and pipelines — rather than a marketing activity applied after the fact.
The uncertainty is in the standards, not the direction. Whether  llms.txt  specifically wins, the requirement it addresses — token-efficient, curated, machine-first content — is permanent.

13. Conclusion

Optimizing for AI agents is not a new coat of paint on SEO. It is an architectural change: your website becomes the human-facing projection of a knowledge graph, and that same graph powers both external agent consumption and your own retrieval pipelines.
Key takeaways
  1. Agents reason; crawlers rank. Design for fact extraction under a token budget, not keyword ranking.
  1.  llms.txt  is cheap insurance. An emerging convention, not a standard — but low-cost, and it forces you to curate your canonical content.
  1. JSON-LD is your distributed knowledge graph. Stable  @id s and  sameAs  links let AI systems merge your entities with the world's.
  1. Graphs beat flat pages on multi-hop questions. Comparisons, requirement chains, and aggregations become exact traversals instead of lucky retrievals.
  1. Hybrid retrieval is the production pattern. Vectors find entry points (OpenSearch); traversals gather verified facts (Neptune/Neo4j); the LLM (Bedrock) only writes prose.
  1. One source of truth, many serializations. The same records should emit your HTML, JSON-LD,  llms.txt , graph nodes, and embeddings.
The sites that win the AI-search era will be the ones that stopped writing pages and started publishing knowledge.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article