Skip to content
Back to skills

Embeddings And Similarity

ASecurity

"Dense SentenceTransformer embedding and similarity workflows for

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
ai-agentsapidatabasebackend

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill embeddings-and-similarity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Embeddings And Similarity?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Embeddings And Similarity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-embeddings-and-similarity/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-embeddings-and-similarity)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: embeddings-and-similarity
description: "Dense SentenceTransformer embedding and similarity workflows for
  text or multimodal inputs, including construction,
  encode/encode_query/encode_document options, prompt and truncation decisions,
  precision, normalization, batching/devices, local cache cautions, and output
  validation."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Embeddings and Similarity

Use this sub-skill when the user needs dense `SentenceTransformer` embeddings or direct embedding similarity scores.

## Route Here

- Construct or load a `SentenceTransformer` for embedding inference.
- Encode text, images, audio, video, multimodal dicts, or chat-style message inputs with dense embedding models.
- Choose between `encode`, `encode_query`, and `encode_document`, including prompt-aware retrieval embedding.
- Tune `batch_size`, `device`, `precision`, `truncate_dim`, `normalize_embeddings`, output conversion, and similarity metric choices.
- Validate embedding shapes, dtypes, normalization, and similarity matrix or pairwise similarity results.

## Route Elsewhere

- Use `../retrieval-and-utilities/` for `util.semantic_search`, hard-negative mining, paraphrase mining, quantized retrieval indexes, or vector database workflows.
- Use `../evaluation-and-training/` for fine-tuning, losses, trainers, evaluators, and dataset formatting.
- Use `../backend-export-optimization/` for ONNX/OpenVINO backend selection, export, optimization, or deployment packaging.
- Use `../reranking-cross-encoder/` for `CrossEncoder.predict`, `CrossEncoder.rank`, or reranker scoring.
- Use `../sparse-encoder-search/` for `SparseEncoder`, SPLADE-style sparse vectors, sparse search, or sparsity diagnostics.

## Fast Workflow

1. Confirm the task is dense embedding inference, not retrieval orchestration or model training.
2. Load a model with explicit network/cache policy, e.g. `SentenceTransformer(model_id_or_path, local_files_only=True)` for offline use.
3. Prefer `encode_query` and `encode_document` for retrieval models with query/document prompts; use `encode` for symmetric STS, clustering, or classification features.
4. Set output options deliberately: `convert_to_numpy=True` for NumPy workflows, `convert_to_tensor=True` for Torch workflows, and avoid both being ambiguous in reusable code.
5. Validate the returned row count, embedding dimension, dtype, finite values, and similarity output shape before using scores downstream.

## References

- API details: `references/api-reference.md`
- Workflow recipes: `references/workflows.md`
- Failure diagnosis: `references/troubleshooting.md`
- Safe smoke helper: `scripts/dense_embedding_smoke.py`

Files in this skill

  • SKILL.md2.7 KB
  • references/api-reference.md5.5 KB
  • references/troubleshooting.md4.2 KB
  • references/workflows.md3.9 KB
  • scripts/dense_embedding_smoke.py4.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.