Views
No views yet
Qwen/Qwen3-Embedding-0.6B used pretrained, no
fine-tune — a deliberate choice documented in
MATRIX_V6_ARCHITECTURE.md.| File | What |
|---|---|
capability_embeddings.fp16.npy | [446897, 1024] fp16 embeddings, L2-normalized |
capability_names.json | Per-row metadata (cap_id, name, kind, repo) |
capability_clusters.json | cap_id → cluster_id (190,085 intent clusters) |
capabilities.jsonl | Full source rows (name, description, snippet) |
config.json | Index metadata: retriever base, dim, query prompt, pooling |
| Metric | v6 | v5 backbone same setup |
|---|---|---|
| ret@1 | 16.6 % | 6.0 % |
| ret@5 | 47.3 % | 15.6 % |
| ret@10 | 57.4 % | 18.8 % |
| cluster@1 | 51.6 % | 16.0 % |
| MRR@20 (cluster) | 0.56 | 0.18 |
1from huggingface_hub import snapshot_download
2import numpy as np, json, torch
3import torch.nn.functional as F
4from transformers import AutoTokenizer, AutoModel
5
6# 1. pull the index
7path = snapshot_download("hyperspaceai/matrix-v6")
8emb = np.load(f"{path}/capability_embeddings.fp16.npy")
9names = json.load(open(f"{path}/capability_names.json"))
10
11# 2. load the (pretrained) retriever
12tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-Embedding-0.6B")
13tok.padding_side = "left"
14if tok.pad_token is None: tok.pad_token = tok.eos_token
15model = AutoModel.from_pretrained("Qwen/Qwen3-Embedding-0.6B",
16 torch_dtype=torch.bfloat16).cuda().eval()
17
18# 3. embed query
19QP = ("Instruct: Given a user request, retrieve relevant agent "
20 "capabilities (tools / skills / agents) from the catalog.\nQuery: ")
21def encode(text):
22 enc = tok(QP + text + tok.eos_token, return_tensors="pt",
23 truncation=True, max_length=192).to("cuda")
24 with torch.no_grad():
25 h = model(**enc).last_hidden_state
26 return F.normalize(h[:, -1, :].float(), dim=-1).cpu().numpy()
27
28# 4. retrieve top-10
29q = encode("write a SQL query that finds the top 10 customers by revenue")
30sims = q @ emb.astype(np.float32).T
31top10 = sims[0].argsort()[::-1][:10]
32for i in top10:
33 print(f"{sims[0, i]:.3f} {names[i]['name']} ({names[i]['repo']})")repo field in capability_names.json.thor-services/skills-sh-harvest.js.