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.

SHARE
LinkedIn X Facebook Threads

Topic map

Separate ingestion from answering

AEM RAG architecture

  1. 01Source
  2. 02Ingest
  3. 03Retrieve
  4. 04Authorize
  5. 05Answer

SYSTEM OVERVIEW

SYSTEM / FLOW

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 LIFECYCLEAEM publicationNormalize + chunkEmbed + metadataVersioned indexONLINE / USER REQUESTIdentity +questionScoped retrievalEvidence gateBounded contextCOMBINED PATHGeneration orabstentionValidatecitationsReturn answer +evidence

Offline / content lifecycle

  1. AEM publication
  2. Normalize + chunk
  3. Embed + metadata
  4. Versioned index

Online / user request

  1. Identity + question
  2. Scoped retrieval
  3. Evidence gate
  4. Bounded context

Combined path

  1. Generation or abstention
  2. Validate citations
  3. Return answer + evidence

THIS ARTICLE EXPLORES

  1. Separate offline indexing from the online request.
  2. Define the evidence contract at the model boundary.
  3. 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.

  1. 01Extract revision
  2. 02Validate document
  3. 03Build chunks
  4. 04Write new generation
  5. 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.

Request failure contract
ConditionResponse policyWhat to observe
No authorized candidatesAbstain; do not fetch restricted substitutes.Candidate count after policy checks.
Index unavailableExplicit temporary failure or approved degraded path.Dependency status and time budget.
Generation times outBounded retry or evidence-only fallback.Attempts and elapsed stage time.
Citation mismatchReject 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.

SHARE THIS NOTE

Found this useful? Share it with someone working on AEM, platform engineering or search.

SHARE
LinkedIn X Facebook Threads

CONTINUE THE THREAD

Related engineering notes

Related engineering work