Tighten unified search ranking and optional telemetry
This commit is contained in:
@@ -143,6 +143,7 @@ Implemented in `src/AdvisoryAI/StellaOps.AdvisoryAI/KnowledgeSearch/KnowledgeSea
|
||||
- Unified search emits hashed query telemetry (`SHA-256` query hash, intent, domain weights, latency, top domains) via `IUnifiedSearchTelemetrySink`.
|
||||
- Search analytics persistence stores hashed query keys (`SHA-256`, normalized) and pseudonymous user keys (tenant+user hash) in analytics/feedback artifacts.
|
||||
- Self-serve analytics is optional and privacy-preserving: when clients emit `answer_frame`, `reformulation`, or `rescue_action`, persistence stores a tenant-scoped hashed session id plus bounded answer metadata (`answer_status`, `answer_code`) instead of raw prompt history.
|
||||
- `AdvisoryAI:KnowledgeSearch:SearchTelemetryEnabled=false` disables analytics persistence, feedback persistence, popularity-map reads, and unified-search telemetry sink emission. Retrieval, scope weighting, suggestions, and search history remain functional.
|
||||
- New ranking behavior does not depend on telemetry. Implicit scope weighting, overflow surfacing, answer blending, and suggestion viability all work when analytics sinks are disabled or no client analytics events are emitted.
|
||||
- Quality metrics surface self-serve gaps as `fallbackAnswerRate`, `clarifyRate`, `insufficientRate`, `reformulationCount`, `rescueActionCount`, and `abandonedFallbackCount`; alerting adds `fallback_loop` and `abandoned_fallback` signals for backlog review.
|
||||
- Free-form feedback comments are redacted at persistence time to avoid storing potential PII in analytics tables.
|
||||
@@ -200,7 +201,7 @@ AKS commands:
|
||||
- `POST /v1/search/index/rebuild`
|
||||
|
||||
`POST /v1/search/query` additive response fields:
|
||||
- `overflow`: bounded related results that fell outside the current ambient page scope but remain materially relevant.
|
||||
- `overflow`: bounded related results that fell outside the current ambient page scope but remain materially relevant. The backend only emits this section when the outside-scope candidate outranks the scoped winner or stays inside a narrow relative score band.
|
||||
- `coverage`: bounded domain coverage diagnostics so FE can suppress suggestions or chips when the active corpus is empty for that suggestion.
|
||||
|
||||
`POST /v1/search/suggestions/evaluate`:
|
||||
|
||||
@@ -47,7 +47,7 @@ flowchart LR
|
||||
- Ambient/session carry-forward
|
||||
- Graph gravity
|
||||
- Optional popularity and freshness controls
|
||||
- Current-page scope is applied here as a ranking bias, not a hard filter. When outside-scope results remain materially stronger, the response surfaces them in bounded `overflow` metadata instead of hiding them.
|
||||
- Current-page scope is applied here as a ranking bias, not a hard filter. When outside-scope results remain materially stronger, or remain inside a narrow relative score band, the response surfaces them in bounded `overflow` metadata instead of hiding them.
|
||||
- `EntityCardAssembler` groups facets into entity cards and resolves aliases.
|
||||
|
||||
### Layer 4: Synthesis
|
||||
@@ -66,6 +66,7 @@ flowchart LR
|
||||
|
||||
### Telemetry and gap surfacing
|
||||
- Search analytics stays optional at the client layer; queries still work when analytics events are never emitted.
|
||||
- `AdvisoryAI:KnowledgeSearch:SearchTelemetryEnabled=false` also disables backend analytics persistence, feedback persistence, popularity-map reads, and unified-search telemetry sink emission without disabling retrieval or history.
|
||||
- When enabled, the self-serve lane records `answer_frame`, `reformulation`, and `rescue_action` with hashed query keys, hashed tenant-scoped session ids, and bounded answer metadata.
|
||||
- Quality review surfaces:
|
||||
- `GET /v1/advisory-ai/search/quality/metrics`
|
||||
@@ -122,6 +123,7 @@ sequenceDiagram
|
||||
- Entity cards remain the primary retrieval payload.
|
||||
- `contextAnswer` is the preferred answer-first surface for Web self-serve UX when present.
|
||||
- `overflow` is additive and bounded so FE can show "outside the current page, but likely relevant" results without reintroducing a scope toggle.
|
||||
- `overflow` is intentionally narrow: it is suppressed when the current-scope winner has a clear lead, so FE can trust the primary section as the best local answer.
|
||||
- `coverage` is additive and bounded so FE can suppress misleading suggestions when the active corpus has no sensible candidates for that domain.
|
||||
- Live local verification currently covers the Doctor/knowledge path after the documented rebuild order:
|
||||
1. `POST /v1/advisory-ai/index/rebuild`
|
||||
|
||||
@@ -100,4 +100,5 @@
|
||||
- Implemented from the corrective phases: the empty state no longer teaches Stella taxonomy through domain guides or quick links; it now keeps only current-page context, successful recent searches, and executable starter chips.
|
||||
- Implemented before and during the corrective phases: explicit scope/mode/recovery controls were removed from the main search flow, implicit current-scope weighting and overflow contracts were added, and suggestion viability preflight now suppresses dead chips before render.
|
||||
- Implemented before the corrective phases: the live Doctor suggestion suite now rebuilds the active corpus, fails on empty knowledge projections, iterates every surfaced suggestion, and verifies Ask-AdvisoryAI inherits the live search context.
|
||||
- Still pending from the corrective phases: broader live-page matrices, stronger backend ranking/blending refinement across more domains, and explicit client-side telemetry opt-out.
|
||||
- Implemented from the corrective phases: backend overflow is now narrow enough that clear in-scope winners suppress out-of-scope spillover, blended summaries only appear for genuinely close evidence clusters, and `SearchTelemetryEnabled` cleanly disables analytics/feedback/sink emission without affecting retrieval or history.
|
||||
- Still pending from the corrective phases: broader live-page matrices and explicit client-side telemetry opt-out.
|
||||
|
||||
Reference in New Issue
Block a user