arrowspace – skill Khác cho agent AI
Tìm kiếm vector phổ dựa trên cấu trúc eigen của Laplacian đồ thị. Dùng khi độ tương đồng cosine/L2 bỏ sót cấu trúc tiềm ẩn trong embedding của bạn.
Cài skill arrowspace bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/arrowspace-f2f6a.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /arrowspace – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/arrowspace-f2f6a.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $arrowspace – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/arrowspace-f2f6a.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /arrowspace – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/arrowspace-f2f6a.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /arrowspace – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
ArrowSpace
Spectral vector search that augments nearest-neighbour search with graph Laplacian features. Computes a Laplacian over the item graph and uses the Rayleigh quotient to produce a λτ (lambda-tau) score per item, enabling search that respects both semantic similarity and structural role.
When to Use This Skill
- Cosine or L2 similarity misses latent structure in your embeddings
- You want graph-based retrieval with spectral awareness
- You need to characterise the spectral properties of an embedding space
- You are building RAG pipelines where contextual role matters alongside semantic content
How It Works
Step 1: Install and import
python3 -m pip install "arrowspace==0.28.1" numpy # review/pin remaining dependencies in an isolated environmentfrom arrowspace import ArrowSpaceBuilder
import numpy as npStep 2: Prepare your data
Pass an (N, d) float64 NumPy array of embedding vectors:
rng = np.random.default_rng(7)
items = rng.normal(size=(32, 8)).astype(np.float64)
items /= np.linalg.norm(items, axis=1, keepdims=True)Step 3: Configure graph parameters
graph_params = {"eps": 0.5, "k": 6, "topk": 3, "p": 2.0, "sigma": None}
aspace, graph = ArrowSpaceBuilder().build(graph_params, items)Step 4: Query
lambdas = aspace.lambdas() # array indexed by insertion order
sorted_res = aspace.lambdas_sorted() # (score, index) pairs ascendingThese are per-item spectral signatures, not graph eigenvalues or query-dependent relevance scores. Sorting them alone is not nearest-neighbor retrieval; do not infer closeness to a query or graph centrality from a large signature.
Examples
Example 1: Basic spectral retrieval
# Reuse the normalized corpus and graph above; verify degenerate scores first.
if np.any(np.abs(aspace.lambdas()) < 1e-12):
raise ValueError("Tune graph parameters for this corpus before searching")
query = items[0].copy()
hits = aspace.search(query, graph, tau=0.7, k=5)
# hits contains query-dependent (item_index, score) pairs, not a lambda-only ranking.Example 2: Compare spectral vs cosine ranking
from sklearn.metrics.pairwise import cosine_similarity
cos_sim = cosine_similarity(items)
cosine_order = np.argsort(cos_sim[0])[::-1][:5]
spectral_order = [index for index, score in aspace.search(items[0], graph, tau=0.7, k=5)]
# For retrieval evaluation, exclude self-matches and use held-out relevance labels.Best Practices
- ✅ Normalise embeddings to unit norm before passing to ArrowSpace
- ✅ Treat graph parameters as corpus-dependent; inspect disconnected/degenerate scores and tune using an explicitly selected objective
- ✅ Choose k relative to the actual corpus and library constraints; N/50 is not a universal quality guarantee
- ✅ In the reviewed 0.28 API, sigma=None uses the eps-dependent default; it is not automatic distribution fitting
- ✅ Small corpora can illustrate the API, but retrieval quality requires corpus-appropriate evaluation; ten items is not a mathematical validity threshold
- ❌ Don't use for real-time streaming data (ArrowSpace is batch-oriented)
Limitations
- API examples target the reviewed 0.28 interface; [immutable upstream skill](https://github.com/Genefold/arrowspace-skills/blob/8d9e8e30be314292e2ee60b84f0c163963660d41/SKILL.md) documents the builder, graph return value and query-aware search. These examples were checked against source documentation, not executed here.
- Fit graph parameters and tau on held-out retrieval evidence; λτ signatures alone do not prove better recall or structural importance.
- ArrowSpace is batch-oriented and not designed for real-time indexing of streaming data.
Common Pitfalls
- Problem: eps is too small, producing a disconnected graph
Solution: Inspect graph connectivity and degenerate scores, then tune eps against the actual data; no dimension-only formula is guaranteed
- Problem: k is too large, producing a dense graph with washed-out spectral features
Solution: Tune k against actual corpus size, graph connectivity, library bounds and held-out relevance; no universal cap of 25 establishes quality
Related Skills
vector-database-engineer— General vector database expertiseembedding-strategies— Embedding model selection and chunkingsimilarity-search-patterns— Semantic search implementation patternshybrid-search-implementation— Combined semantic + keyword search
Skill liên quan
- artifact-yylo – Ghi lại và truy xuất các bản ghi artifact YYLO Ledger bền vững, với profile có chủ đích…
- finetuning-method-selection – Quyết định có nên fine-tune hay không, và chọn phương pháp phù hợp (SFT, DPO/ORPO/KTO…
- chief-customer-officer-advisor – Tư vấn Giám đốc Khách hàng (CCO) cho startup: phân rã retention (gross retention so với…
- chief-customer-officer-advisor – Tư vấn Giám đốc Khách hàng (CCO) cho startup: phân rã retention (gross retention so với…
- draw-your-font – Biến ảnh chữ viết tay thành font TTF có thể cài đặt.
- ask-matt – Hỏi skill hoặc quy trình nào phù hợp với tình huống của bạn. Bộ định tuyến cho các skill…
- ask-questions-if-underspecified – Làm rõ yêu cầu trước khi triển khai. Dùng khi có nghi ngờ nghiêm trọng.
- dream-loop – Tạo cảnh 3D ấn tượng thông qua vòng lặp đảm bảo độ trung thực với concept art.