Skip to content

feat: add semantic distance matrix and tool clustering (#82) - #155

Draft
askmy-stack wants to merge 1 commit into
mainfrom
cursor/semantic-distance-c2a5
Draft

askmy-stack wants to merge 1 commit into
mainfrom
cursor/semantic-distance-c2a5

Conversation

@askmy-stack

Copy link
Copy Markdown
Owner

Summary

Implements #82 — semantic distance matrix and tool clustering for large MCP catalogs.

Changes

  • New tool_semantics.semantic module:
    • Pairwise similarity (deterministic token Jaccard; optional embedding blend)
    • Action families: SEARCH / WRITE / DESTRUCTIVE / OTHER
    • Similarity clusters (connected components above threshold)
    • N≥500: subsample by default; --allow-large for full O(N²)
  • CLI: tool-semantics cluster SNAPSHOT
  • Fixture: examples/semantic/github_catalog.json
  • Docs: docs/semantic-distance.md

Test plan

  • pytest tests/test_semantic.py
  • ruff / mypy
  • CI green

Closes #82

Open in Web Open in Cursor 

Deterministic pairwise similarity, SEARCH/WRITE/DESTRUCTIVE action families,
cluster CLI, and N≥500 subsample / --allow-large performance guard.

Co-authored-by: Abhinaysai Kamineni  <askmy-stack@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Add semantic distance matrix and tool clustering

2 participants