Enrich embedding pipeline for better semantic search
还没有人认领这个 Issue。
评估
调研方向
Start with core/chunking/serializer.go and trace the existing entity-upsert re-embedding flow. Then inspect SearchEntities and AssembleContext to understand ranking inputs and how embeddings-disabled paths behave. Done means properties and attached document content enrich entity search, freshness is applied in both ranking paths, and existing behavior degrades gracefully when embeddings are disabled.
由索引模型根据 Issue 内容生成。
描述
Context
Semantic search quality is limited by what goes into the embeddings. Today, the entity serializer only embeds URN, type, name, and description. Properties (column names, tags, owners), attached documents, and freshness signals are all ignored. This means:
- Searching for a column name like "bounce_rate" won't find the table that has it
- Searching for "incident" won't surface entities whose runbooks describe incidents
- A freshly updated entity ranks the same as one untouched for a year
Scope
1. Embed entity properties and tags
The properties JSONB field often contains the most useful metadata — column names, schema details, owners, tags, labels. The entity serializer (core/chunking/serializer.go) should flatten and include relevant properties in the text sent to the embedding provider.
Example: a BigQuery table entity with properties: {columns: ["user_id", "session_duration", "bounce_rate"], owner: "analytics-team", tags: ["pii", "tier-1"]} should produce an embedding that understands "bounce_rate", "analytics-team", and "tier-1".
2. Cross-embed entity + document content
When a document is attached to an entity, the document's content should enrich the entity's embedding context. If a runbook for table:user_sessions mentions "incident", "SLA", and "late-arriving events", searching for those terms should boost that entity in semantic results.
Approach options:
- At embedding time: When an entity is embedded, also pull its document content into the embedding context (heavier, richer)
- At search time: When semantic search returns document chunks, propagate their scores to the parent entity (lighter, but less precise)
3. Freshness decay in ranking
Add a mild freshness boost to search and context assembly scoring. Entities with a recent updated_at get a small multiplier. This is not a popularity signal — it's an objective liveness indicator.
This applies to:
SearchEntitieshybrid ranking (RRF score adjustment)AssembleContextentity scoring (alongside intent weights)
Design Considerations
- Property embedding should be selective — not all JSONB fields are useful. A configurable allowlist or heuristic (e.g., skip fields > 1000 chars) may be needed.
- Cross-embedding creates a dependency: document upsert should trigger re-embedding of the parent entity. The pipeline already handles async re-embedding on entity upsert, so this is an extension of existing behavior.
- Freshness decay should be gentle — a 1.1-1.2x multiplier for entities updated in the last 7 days, not a hard penalty for old entities. Old but relevant entities should still surface.
- All changes should degrade gracefully when embeddings are disabled.
Related
- #237 — Graph-aware ranking (complementary: centrality scoring alongside richer embeddings)
- 主要语言
- Go
- 星标
- 72
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
raystack/compass 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
acceptance-tests phase-coding schema-coverage testing triaged
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100