SEARCH & AI / 007
Building a RAG Pipeline on Top of AEM Content
A reference architecture outline for retrieval-augmented generation grounded in AEM content, with explicit attention to provenance, permissions and evaluation.
Topic map
Separate ingestion from answering
AEM RAG architecture
- 01Source
- 02Ingest
- 03Retrieve
- 04Authorize
- 05Answer
SYSTEM OVERVIEW
Two lifecycles meet at the evidence store.
Proposed architecture, not a deployed pipeline. Index availability and answer generation have different failure and latency budgets.
Offline / content lifecycle
- AEM publication
- Normalize + chunk
- Embed + metadata
- Versioned index
Online / user request
- Identity + question
- Scoped retrieval
- Evidence gate
- Bounded context
Combined path
- Generation or abstention
- Validate citations
- Return answer + evidence
THIS ARTICLE EXPLORES
- Separate offline indexing from the online request.
- Define the evidence contract at the model boundary.
- Handle weak retrieval and dependency failures explicitly.
01 / PROBLEM
A retrieval service is not just an LLM wrapper.
The question is whether a repeatable, authorized evidence set can be assembled before generation begins. A successful model response says little about source freshness, access policy or the quality of the retrieved passages.
This is a reference architecture for a bounded PoC. It does not claim an operating production assistant or measured answer quality.
02 / INGESTION
Make the index a rebuildable projection.
Choose a trusted extraction contract and normalize content before embedding it. Store source revision, chunk strategy and model version together. Reconcile updates and removals against the source rather than treating a successful insert as the end of ingestion.
Indexing lifecycle
Retries should be idempotent; reconciliation must include withdrawn content.
- 01Extract revision
- 02Validate document
- 03Build chunks
- 04Write new generation
- 05Reconcile obsolete records
03 / EVIDENCE
Define what crosses the generation boundary.
A result should identify the passage, its source revision and a permitted citation target. Authorization belongs before any model receives the passage, including an external reranker. The following object is illustrative, not an Adobe API schema.
Example evidence envelope
JSON / illustrative{
"queryId": "example-query",
"policyDecision": "allow",
"passages": [
{
"sourceId": "guide-example",
"revision": "revision-example",
"chunkId": "guide:en:section:0",
"text": "Example approved passage.",
"citationTarget": "/guides/example"
}
]
}04 / FAILURE MODES
Treat absence of evidence as a first-class result.
Define whether the service returns an abstention, an evidence-only response or a temporary failure. Do not silently change model providers or broaden authorization when a dependency is unavailable.
| Condition | Response policy | What to observe |
|---|---|---|
| No authorized candidates | Abstain; do not fetch restricted substitutes. | Candidate count after policy checks. |
| Index unavailable | Explicit temporary failure or approved degraded path. | Dependency status and time budget. |
| Generation times out | Bounded retry or evidence-only fallback. | Attempts and elapsed stage time. |
| Citation mismatch | Reject or qualify the unsupported claim. | Claim-to-passage association. |
05 / EVALUATION
Validate a complete request, not one fluent answer.
Use a reviewed set of questions and source passages, including denied identities and withdrawn content. Keep the corpus revision fixed when comparing retrieval strategies. A PoC can expose a failure mode without establishing a production benefit.
PoC release gate
- Trace each answer claim to an authorized source revision.
- Test deleted and unpublished documents in both retrieval and caches.
- Rehearse index outage and model timeout.
- Measure stage latency and usage without logging restricted passages.
- Document the conditions under which the service abstains.
REFERENCE DESK
Sources & further verification
Product behavior should be checked against the target AEM and search-engine release. The design choices in this note are proposed assessment criteria, not vendor guarantees.