sentence-transformers

Generate sentence, text, and image embeddings for semantic search and RAG.

2|Updated Aug 15, 2026
One-click install
npx skills add https://github.com/Jensen-Yao/agents-skills --skill sentence-transformers-jensen-yao
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sentence-transformers
Source: https://github.com/Jensen-Yao/agents-skills/tree/main/skills/sentence-transformers
Command: npx skills add https://github.com/Jensen-Yao/agents-skills --skill sentence-transformers-jensen-yao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sentence-transformers, transformers, torch, and includes references (resource) components.

What problem does it solve? Generating high-quality text embeddings locally for semantic search, clustering, and retrieval-augmented generation requires choosing and configuring the right model, which is time-consuming without clear guidance. ## Core Features & Use Cases - Local Embedding Generation: Encode sentences into vectors using 5000+ pre-trained models without calling external APIs. - Semantic Search & Similarity: Compute cosine similarity and run top-k semantic search over document corpora. - Multilingual & Domain Models: Select from 100+ language models and domain-specific models for legal, scientific, and code text. - Use Case: Build a RAG pipeline by encoding your document corpus with all-mpnet-base-v2, storing embeddings in Chroma via LangChain, and retrieving relevant passages for user queries. ## Quick Start Generate embeddings for a list of sentences using the all-MiniLM-L6-v2 model and compute their pairwise cosine similarities.

Frequently Asked Questions about sentence-transformers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate sentence embeddings in Python?▼

Install sentence-transformers with pip, load a model like SentenceTransformer('all-MiniLM-L6-v2'), and call model.encode(sentences) to get embedding vectors. The output is a NumPy array or PyTorch tensor you can use for similarity computation.

Which sentence-transformers model should I use for RAG?▼

For production RAG, all-mpnet-base-v2 offers a good balance of 768-dimensional quality and speed. For prototyping, all-MiniLM-L6-v2 is faster at roughly 2000 sentences per second, while all-roberta-large-v1 gives the highest accuracy.

Sentence Transformers vs OpenAI embeddings: which is better?▼

Sentence Transformers runs locally with no API cost and supports 5000+ models, making it cost-effective for high-volume embedding. OpenAI embeddings are API-based and may offer higher quality for some tasks but require network access and per-token pricing.

Does sentence-transformers support multilingual text?▼

Yes, models like paraphrase-multilingual-mpnet-base-v2 support 50+ languages, and LaBSE covers 109 languages. These models map sentences from different languages into a shared embedding space for cross-lingual search.

Can I use sentence-transformers with LangChain or LlamaIndex?▼

Yes, LangChain provides HuggingFaceEmbeddings and LlamaIndex provides HuggingFaceEmbedding wrappers that accept any sentence-transformers model name. These integrate directly with vector stores like Chroma for retrieval pipelines.

When should I not use sentence-transformers?▼

Avoid it when you need API-based managed quality without local GPU or memory resources, since large models like RoBERTa require about 1.3GB of RAM. Task-specific instruction models like Instructor or managed services like Cohere Embed may fit better in those cases.