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.
Topic map
Engineering path
AEM Content Fragments vector search architecture
- 01AEM
- 02Content
- 03Chunks
- 04Vector
- 05Retrieval
SYSTEM OVERVIEW
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 ingestion
- AEM Content Fragments
- Extraction / ingestion
- Normalization
- Chunking
- Metadata
- Embeddings
- Vector index
Lexical ingestion
- AEM published content
- Normalize + access scope
- Elasticsearch
Combined path
- Hybrid retrieval
- Permission gate
- Reranking
- LLM
- Grounded answer
- Source citation
THIS ARTICLE EXPLORES
- How governed AEM content becomes retrieval-ready.
- What metadata has to survive ingestion.
- How transformation versions keep document and query vectors compatible.
- How permissions and freshness remain enforceable.
- 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.
- 01Fragment model
- 02Selected fields + references
- 03Locale + identity
- 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.
- 01Read revision
- 02Validate schema
- 03Normalize
- 04Derive chunks
- 05Upsert + reconcile
- 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 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.
- 01Canonical chunk text
- 02Versioned preprocessing
- 03Embedding model
- 04Vector + version
- 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.
An explicit evidence gate
Only authorized evidence crosses the generation boundary. The rejection path terminates before generation.
Allowed path
- User
- Identity
- Access context
- Retrieval filters
- Authorized documents
- LLM
Rejected path — no connection to the LLM
- Unauthorized chunk
- Policy check fails
- 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.
- 01AEM authoring
- 02Publish
- 03Ingest
- 04Index
- 05Available for retrieval
| Event | Action | Validation |
|---|---|---|
| Update | Replace affected records; remove obsolete chunks. | Only the intended revision appears in results. |
| Unpublish | Remove or disable all source records; invalidate answer caches. | Source cannot be retrieved through either search path. |
| Delete | Remove source + chunks and retain a reconciliation tombstone where needed. | A delayed retry cannot resurrect deleted material. |
| Failed ingest | Retry 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 | Impact | Detection | Mitigation |
|---|---|---|---|
| Stale source | Old guidance remains retrievable. | Compare indexed and authoritative revisions. | Reconcile sources; invalidate stale results. |
| Duplicate chunks | Repeated evidence crowds out other sources. | Inspect source/chunk ID collisions and repeated passages. | Deterministic IDs and source-level replacement. |
| Embedding drift | Query/document representation mismatch. | Check dimensions and embeddingVersion at write/read boundaries. | Versioned indexes and validated cutover. |
| Permission leak | Restricted evidence is disclosed. | Negative identity tests and payload audit. | Fail closed, invalidate affected caches, investigate the boundary. |
| Weak retrieval | Generation lacks enough evidence. | Review top-k against labeled questions. | Tune chunking/retrieval; abstain when evidence is inadequate. |
| Unsupported answer | Claims 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.