OpenSpace/openspace/cloud
Fabio Scarsi fc9534876f fix(search): wire search_skills to SkillRanker embedding cache
Both paths in search_skills/hybrid_search_skills now go through a
shared SkillRanker singleton:

- SkillSearchEngine._bm25_phase: previously instantiated a fresh
  SkillRanker per call, reloading the pickle cache each time.
- hybrid_search_skills candidate loop: previously generated
  embeddings via generate_embedding on every query, ignoring the
  persistent cache entirely.

The persistent pickle at
.openspace/skill_embedding_cache/skill_embeddings_v1.pkl is
reused across invocations and survives process restarts.
Candidates without a stable skill_id are skipped to avoid cache
key collisions.

On a 28-skill local registry with text-embedding-3-small via
OpenRouter, query latency drops from 8-14s to ~300ms after
warm-up. Top-1 match identity is preserved on all test queries
(score drift <0.001).

Cloud candidates that already carry _embedding from the
server-side search endpoint are skipped and unchanged.
2026-04-18 11:52:15 +02:00
..
cli initial commit 2026-03-24 16:03:22 +08:00
__init__.py initial commit 2026-03-24 16:03:22 +08:00
auth.py initial commit 2026-03-24 16:03:22 +08:00
client.py Fix cloud visibility compatibility 2026-04-09 22:36:09 +08:00
embedding.py initial commit 2026-03-24 16:03:22 +08:00
search.py fix(search): wire search_skills to SkillRanker embedding cache 2026-04-18 11:52:15 +02:00