Skip to content

Populate related_skills graph (text-embedding-3-large) + numpy fast path#21

Merged
lfnothias merged 2 commits into
devfrom
feat/related-skills-precompute
Jun 26, 2026
Merged

Populate related_skills graph (text-embedding-3-large) + numpy fast path#21
lfnothias merged 2 commits into
devfrom
feat/related-skills-precompute

Conversation

@lfnothias

Copy link
Copy Markdown
Contributor

Populates the related_skills similarity graph (the B4 machinery shipped empty in #18) using OpenAI text-embedding-3-large — the same model Perspicacité runs. Off dev.

What landed

  • All 5,865 skills now carry related_skills (top-8 cosine neighbours) in skills_index.json + kb_bundle.json. 0 dangling refs; check_related_skills gate green. Neighbours are semantically sound (e.g. a 2D-NMR skill → NMR simulation / J-coupling skills; a 2D-TIC skill → chromatography-preprocessing skills).
  • related_map numpy fast path — the pure-Python O(n²·d) ranker doesn't scale to 5,865 × 3,072-dim vectors (48 min → 49 s). Element-wise finite-guards drop degenerate embedding values; the pure-Python path is kept as the numpy-free fallback (identical output, 17 tests green). numpy>=1.24 added to the [embed]/[embed-openai] extras.

Notes

lfnothias and others added 2 commits June 26, 2026 18:04
…-embedding-3-large

- related_map gains a numpy fast path (pure-Python O(n^2*d) does not scale to
  5865 x 3072 vectors — 48min -> 49s); element-wise finite-guards drop degenerate
  embedding values; pure-Python kept as the numpy-free fallback (identical output,
  17 tests green). numpy added to the [embed]/[embed-openai] extras.
- Populated related_skills for all 5,865 skills (skills_index.json + kb_bundle.json)
  via the OpenAI text-embedding-3-large backend (the model Perspicacité uses).
  0 dangling refs; check_related_skills gate OK; neighbours are semantically sound.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@lfnothias lfnothias left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-review — VERDICT: MERGEABLE ✅

Independently verified in the worktree:

  • related_skills populated for 5,865/5,865 skills in both skills_index.json and kb_bundle.json; 0 dangling refs; check_related_skills exit 0.
  • related_map numpy path matches the pure-Python fallback (17/17 tests); finite-guards make it warning-free; 49 s vs the 48-min pure-Python stall.
  • Semantic spot-checks pass (NMR↔NMR, chromatography↔chromatography neighbours).
  • Full suite 434 passed after a conflict-free merge of dev (Alpha+Beta).
  • numpy>=1.24 added to the embed extras; no git/gh/network in the build path (embeddings via the injected/OpenAI backend only at CLI time).

@lfnothias
lfnothias merged commit 09277fa into dev Jun 26, 2026
lfnothias added a commit that referenced this pull request Jun 26, 2026
Propagates two post-#19 merges into the 8 packs (which weren't rebuilt after):
- synthesize-meta-skill.md: the #7 --review-doi addition (PR #20)
- kb_bundle.json: related_skills from the #1 embedding precompute (PR #21)

claim-skill.md was already shipped to all packs in 2be335f (PR #19) and is
unchanged here. Idempotent: re-running build_all_grounding.sh now yields no diff.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant