SEARCH & AI / 006

From AEM Content Fragments to Vector Search

An architecture exploration of how governed AEM Content Fragments could be prepared, embedded and retrieved through a vector-search layer.

SHARE
LinkedIn X Facebook Threads

Topic map

Engineering path

AEM Content Fragments vector search architecture

  1. 01AEM
  2. 02Content
  3. 03Chunks
  4. 04Vector
  5. 05Retrieval

SYSTEM OVERVIEW

SYSTEM / FLOW

Two retrieval paths. One governed source.

Proposed architecture, not a deployed system. Both indexes preserve source identity and access scope. Authorization is applied during retrieval and rechecked before any external reranker or LLM receives content.

SEMANTIC INGESTIONAEM ContentFragmentsExtraction /ingestionNormalizationChunkingMetadataEmbeddingsVector indexLEXICAL INGESTIONAEM publishedcontentNormalize +access scopeElasticsearchCOMBINED PATHHybrid retrievalPermission gateRerankingLLMGrounded answerSource citation

Semantic ingestion

  1. AEM Content Fragments
  2. Extraction / ingestion
  3. Normalization
  4. Chunking
  5. Metadata
  6. Embeddings
  7. Vector index

Lexical ingestion

  1. AEM published content
  2. Normalize + access scope
  3. Elasticsearch

Combined path

  1. Hybrid retrieval
  2. Permission gate
  3. Reranking
  4. LLM
  5. Grounded answer
  6. Source citation

THIS ARTICLE EXPLORES

  1. How governed AEM content becomes retrieval-ready.
  2. What metadata has to survive ingestion.
  3. How transformation versions keep document and query vectors compatible.
  4. How permissions and freshness remain enforceable.
  5. Where transformation hands off to retrieval and generation.

01 / PROBLEM

Similarity is not a content contract.

A vector can help locate related language. It cannot tell a caller whether a source is still published, which revision it represents, or who may read it. Those guarantees need an explicit ingestion and retrieval contract.

This exploration treats AEM as the governed source and the search layer as a rebuildable projection. Start with a bounded corpus and a lexical baseline before adding a semantic path.

02 / AEM CONTENT SOURCE

Start with the content model, not the embedding model.

Select meaningful fields from the Content Fragment Model: title, summary, body, referenced entities and locale. Separate text intended for retrieval from authoring metadata. Resolve references deliberately; uncontrolled expansion can duplicate content or cross access boundaries.

For an AEM GraphQL extraction contract, validate the model, endpoint and pagination against the target AEM release. A persisted query can stabilize the consumer contract; it does not by itself provide change capture or authorization for your downstream index.

A model becomes a retrieval document

Keep structure available until a deliberate normalization step.

  1. 01Fragment model
  2. 02Selected fields + references
  3. 03Locale + identity
  4. 04Normalized document

03 / INGESTION

Design ingestion to be repeatable.

Persist a source checkpoint and content revision with each ingestion attempt. Validate the payload before writing any searchable records. Build stable chunk IDs from the source identity and a versioned chunking strategy, then reconcile the complete set of chunks for that source.

Retries must be idempotent: replaying a successful revision must not create another copy. When replacing a source with fewer chunks, remove the obsolete records as part of the replacement procedure.

An explicit ingestion boundary

An example service lifecycle; not a claim about an existing deployment.

  1. 01Read revision
  2. 02Validate schema
  3. 03Normalize
  4. 04Derive chunks
  5. 05Upsert + reconcile
  6. 06Record checkpoint

04 / CHUNKING

Choose a chunking contract; keep transformation responsible for identity.

The transformation must preserve field boundaries and carry the selected strategy version. The dedicated chunking note compares whole-fragment, field-aware and semantic approaches and includes the deterministic splitting fixture.

05 / METADATA

Treat provenance as part of the indexed document.

The following application-defined schema is illustrative. AEM does not automatically supply all these fields. Define how your ingestion service obtains or derives each value, and validate it before accepting a document. Access scope is a policy reference, not a substitute for evaluating the requesting identity.

EXAMPLE SCHEMA / NOT AN AEM CONTRACT

Example chunk envelope

Illustrative values only. Add the content text and embedding payload according to the storage contract; avoid indexing private repository paths if callers do not need them.

sourceId
"guide-001"Stable application identity across revisions.
aemPath
"/content/dam/example/en/guide"Internal source locator; not necessarily a public citation URL.
fragmentModel
"technical-guide-v1"Model contract used during normalization.
locale
"en"Language constraint for retrieval.
contentVersion
"revision-example"Revision or content hash used for reconciliation.
publicationState
"published"Projection of publication state that must be reconciled.
lastModified
"<source ISO-8601 timestamp>"Source timestamp, distinct from ingestion completion time.
accessScope
["support-readers"]Example scope IDs resolved by an authorization service.
chunkId
"guide-001:body:0001"Deterministic identity within a versioned chunking strategy.
embeddingVersion
"model-and-preprocessing-v1"Compatibility marker for document and query embeddings.

06 / EMBEDDINGS

Version the transformation, not just the vector.

Record the embedding model, dimensions, normalization and preprocessing version. Query and document vectors must use compatible representations. Do not mix new and old embeddings in a shared similarity space without validating that the model supports it.

For a model change, build a separate versioned index, compare it against the baseline and switch reads only after validation. Retain a rollback path until operational checks pass.

A reproducible transformation

Text preparation is part of the model contract.

  1. 01Canonical chunk text
  2. 02Versioned preprocessing
  3. 03Embedding model
  4. 04Vector + version
  5. 05Compatible query vector

07 / VECTOR STORE

Hand a versioned document contract to the storage layer.

Require the destination to preserve source identity, revision and access scope. Product selection belongs to Elasticsearch versus a vector database, which owns filtering, recovery and operational decision criteria.

08 / HYBRID RETRIEVAL

Make the projection usable by both retrieval paths.

Lexical and semantic projections must refer to the same source and publication revision. Candidate generation, fusion and ranking belong to hybrid retrieval; this transformation must not silently create divergent identities for the same evidence.

09 / PERMISSIONS

The LLM is not the authorization layer.

Derive access context from a trusted identity boundary. Never trust a client-supplied accessScope field as permission to retrieve restricted content. Missing or stale policy information should fail closed for restricted sources.

Permission changes must invalidate affected records and caches. Partition or key response caches by the appropriate authorization context; otherwise a correct retrieval check can still be undone by a cached answer from another user.

SYSTEM / FLOW

An explicit evidence gate

Only authorized evidence crosses the generation boundary. The rejection path terminates before generation.

ALLOWED PATHUserIdentityAccess contextRetrieval filtersAuthorizeddocumentsLLMREJECTED PATH — NO CONNECTION TO THE LLMUnauthorizedchunkPolicy checkfailsDiscard beforegeneration

Allowed path

  1. User
  2. Identity
  3. Access context
  4. Retrieval filters
  5. Authorized documents
  6. LLM

Rejected path — no connection to the LLM

  1. Unauthorized chunk
  2. Policy check fails
  3. Discard before generation

10 / FRESHNESS

Publication is a lifecycle, not an ingestion timestamp.

Define how publish, update, unpublish and delete signals reach the projection. Pair event-driven updates with scheduled reconciliation because delivery can be delayed or missed. A successful job does not prove that an old revision or deleted source is no longer retrievable.

From authoring to a searchable revision

Availability follows successful validation of both text and metadata.

  1. 01AEM authoring
  2. 02Publish
  3. 03Ingest
  4. 04Index
  5. 05Available for retrieval
Lifecycle handlers
EventActionValidation
UpdateReplace affected records; remove obsolete chunks.Only the intended revision appears in results.
UnpublishRemove or disable all source records; invalidate answer caches.Source cannot be retrieved through either search path.
DeleteRemove source + chunks and retain a reconciliation tombstone where needed.A delayed retry cannot resurrect deleted material.
Failed ingestRetry idempotently; reconcile against the authoritative revision.No partial replacement is exposed as a complete source.

11 / LLM

Stop transformation at an inspectable evidence boundary.

A retrieval-ready document is not a generated answer. The RAG orchestration note owns bounded context, generation failure and abstention. This stage supplies provenance and content; it does not choose a model or claim answer quality.

12 / GROUNDING

Preserve citation inputs before generation.

Keep a stable source identifier, revision and authorized citation target in every document. Do not expose internal repository paths as public links. The RAG note owns the later check that an answer is supported by those sources.

13 / EVALUATION

Validate the transformation independently of answer quality.

Replay the same source revision and check identity stability. Update it and check replacement; unpublish or delete it and check that obsolete documents disappear. Reject records with missing required scope or provenance. These are proposed acceptance checks, not captured results or a retrieval benchmark.

14 / FAILURE MODES

Make failure observable before widening the corpus.

Record correlation IDs, source revision, ingestion status, retrieval configuration and model version. Avoid logging restricted passage text by default. Diagnostic evidence should explain a failure without creating another uncontrolled copy of the content.

Failure analysis
FailureImpactDetectionMitigation
Stale sourceOld guidance remains retrievable.Compare indexed and authoritative revisions.Reconcile sources; invalidate stale results.
Duplicate chunksRepeated evidence crowds out other sources.Inspect source/chunk ID collisions and repeated passages.Deterministic IDs and source-level replacement.
Embedding driftQuery/document representation mismatch.Check dimensions and embeddingVersion at write/read boundaries.Versioned indexes and validated cutover.
Permission leakRestricted evidence is disclosed.Negative identity tests and payload audit.Fail closed, invalidate affected caches, investigate the boundary.
Weak retrievalGeneration lacks enough evidence.Review top-k against labeled questions.Tune chunking/retrieval; abstain when evidence is inadequate.
Unsupported answerClaims cannot be traced to sources.Claim-level evidence review.Constrain context, validate citations, permit abstention.

15 / TRADEOFFS

Optimize for a governed retrieval system.

This is an architecture exploration, not a production case study. Validate the design in a bounded PoC with a named content scope, trusted identity integration, lexical baseline and explicit release criteria. Expand only when the operational and authorization behavior is understood.

What determines readiness

Optimize for

Source → evidence → accountable answer

  • Governance and permission correctness
  • Freshness and reversible updates
  • Retrieval quality and traceability
  • Operational simplicity

Not just

Text → embedding similarity

  • A high similarity score does not prove correctness.
  • More chunks are not automatically better evidence.
  • More infrastructure adds ownership and failure modes.

Before widening the PoC

  • Reproduce a source update, unpublish and delete in both indexes.
  • Prove denied identities cannot leak through retrieval, reranking or caches.
  • Compare retrieval strategies against a reviewed question set.
  • Rehearse embedding rollback and complete index rebuild.
  • Agree latency and cost budgets using measurements, not assumptions.

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