feat(search): make AI Governance Studio assets vector-searchable - #31738
Conversation
The AI Gov Studio ships llmModel, aiApplication, promptTemplate, mcpServer, aiGovernancePolicy and aiGovernanceFramework, but none of them was reachable by vector or hybrid search. Three independent gates all excluded them: - AvailableEntityTypes.LIST (write path) never listed them, so the bulk sink and VectorEmbeddingHandler skipped embedding them. - Their indexMapping.json entries were not members of the dataAssetEmbeddings parent alias (read path), so even an embedded doc could not be returned. - Their index mapping files carried no `fingerprint` field, and OsUtils.addKnnVectorSettings detects embedding support by its presence — so the `embedding` knn_vector was never added to the index at all. Any one of the three is enough to make the asset invisible, and each fails silently. This wires all three for the six searchable AI types. The execution types (agentExecution, mcpExecution), aiFrameworkControl and auditReport stay out: they are drill-downs reached from a parent, not searched for by name. While pinning the invariant, the new test surfaced a pre-existing gap: `page` and `contextMemory` are vector-indexable and VectorDocBuilder writes `textToLLMContext` onto every entity doc, but neither mapping declared the field — it was being created by dynamic mapping. Declared explicitly, matching every other member. AvailableEntityTypesConsistencyTest pins the three gates together so the next entity type cannot be half-wired. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
✅ Playwright Results — workflow succeededValidated commit ✅ 1279 passed · ❌ 0 failed · 🟡 4 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 51m 16s ⏱️ Max setup 4m 31s · max shard execution 18m 45s · max shard-job elapsed before upload 21m 45s · reporting 10s 🌐 200.40 requests/attempt · 2.13 app boots/UI scenario · 14.49% common-shard skew Optimization targets still in progress:
🟡 4 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ ApprovedEnables vector and hybrid search for AI Governance Studio assets by updating write-path entity lists, index mapping aliases, and schema definitions across all languages. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



What
Makes the AI Governance Studio's asset entities reachable by vector and hybrid search. Today none of them is —
llmModel,aiApplication,promptTemplate,mcpServer,aiGovernancePolicyandaiGovernanceFrameworkare indexed, but a semantic search for "which LLM models do we use?" returns nothing.Why it was invisible
Vector search is gated in three independent places, and the AI entities were missing from all three. Any one of them alone is enough to make an asset unsearchable, and each fails silently.
AvailableEntityTypes.LISTOpenSearchBulkSink.shouldEmbed/VectorEmbeddingHandlerskip the entity, so no vector is ever computeddataAssetEmbeddingsparent alias inindexMapping.jsonVectorIndexService.VECTOR_EMBEDDING_ALIASis the query target; a non-member index cannot be returned even if its docs carry vectorsfingerprintfield in the type's index mapping fileOsUtils.addKnnVectorSettingsdetects embedding support by the presence offingerprintand returns early without it — theembeddingknn_vectorfield is never added to the indexThe third one is the least obvious and the most consequential: without
fingerprintthe index physically has nowhere to store a vector, so fixing only the first two would still produce nothing.Changes
AvailableEntityTypes.LIST— added the six types. This is the single write-path source of truth, consumed byOpenSearchBulkSink,VectorEmbeddingHandler,RecreateWithEmbeddings.coversAllVectorTypes, andOpenSearchVectorService's staged-chunk expected-type set, so one edit flows to all of them.indexMapping.json— addeddataAssetEmbeddingsto the six entries'parentAliases. Members go 22 → 28. Deliberately not added todataAsset, which drives Explore and has a much wider blast radius.Index mapping files (6 types × 4 languages = 24 files) — added the fields
VectorDocBuilder.buildEmbeddingFieldswrites on every entity doc:fingerprint,textToEmbed,textToLLMContext,chunkIndex,chunkCount,parentId. Copied verbatim from existing members.AvailableEntityTypesConsistencyTest(new) — pins the three gates together.Scope: which types, and why not the rest
In:
llmModel,aiApplication,promptTemplate,mcpServer,aiGovernancePolicy,aiGovernanceFramework.Out, deliberately:
agentExecution,mcpExecution— execution records, reached by drilling into a parent, not searched by name. (agentExecutionalso has no ES index at all today; separate issue.)aiFrameworkControl,auditReport— leaves of a framework / generated artifacts, same reasoning.llmService,mcpService— no service type is indataAssetEmbeddings; keeping that convention.Pre-existing gap this surfaced
pageandcontextMemoryare vector-indexable andVectorDocBuilder.buildEmbeddingFieldswritestextToLLMContextonto their docs, but neither mapping declared the field — Elasticsearch was creating it via dynamic mapping. Now declared explicitly astext, matching the dynamic default and every other member, so no behavior change. Flagging it because it is outside the AI-entity scope: happy to split it out if preferred.Testing
AvailableEntityTypesConsistencyTestasserts:AvailableEntityTypes.SETequals thedataAssetEmbeddingsalias membership exactly, in both directions, with a message naming the drifting types ("embedded but not searchable" vs "in the alias but never embedded").Verified the test is not vacuous: removing
"llmModel"fromAvailableEntityTypesfails it withtypes in the alias but never embedded: [llmmodel], and the field assertion is what caught thepage/contextMemorygap above.Upgrade note
Existing clusters need a search reindex for the six AI types to pick up the new
knn_vectormapping and get embeddings written. Until then they behave exactly as they do today (indexed, keyword-searchable, absent from vector results) — no regression, just no improvement.Follow-ups (not in this PR)
agentExecutionhas no search index at all, though it carriesmodelCalls,toolCalls,dataAccessedandcomplianceChecks.mcpExecutionis indexed but its only parent alias ismcpServer, so it is outsidealltoo.aiApplication.dataSources/knowledgeBases/primaryModelareentityReferenceLists, not lineage edges —AIApplicationRepositorycreates no lineage relationships, so "which AI applications read this table?" is unanswerable in either direction.Consumer-side context: open-metadata/ai-platform#975.
🤖 Generated with Claude Code
Greptile Summary
The PR makes six AI Governance Studio entity types eligible for vector and hybrid search by aligning embedding generation, alias membership, and index mappings.
dataAssetEmbeddingsread alias.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR E[AI governance entity] --> W[AvailableEntityTypes write gate] W --> B[Vector embedding generation] B --> M[Index mapping with embedding fields] M --> A[dataAssetEmbeddings alias] A --> Q[Vector or hybrid search] T[Consistency test] -. validates .-> W T -. validates .-> M T -. validates .-> AReviews (5): Last reviewed commit: "Merge branch 'main' into pmbrull/ai-enti..." | Re-trigger Greptile
Context used: