# Sentence Transformers

> Canonical: https://skillalmanac.com/glossary/sentence-transformers | Last verified: 2026-11-25 | Index status: index-eligible

Sentence Transformers is a Python library for using and training embedding and reranker models. Its documented inputs include text and, for suitable models, images, audio, and video.

Also called: SentenceTransformers, sentence-transformers, SBERT, Sentence-BERT.

## In plain language

Sentence Transformers can encode inputs as vectors and score how closely inputs relate under a selected model. For text, this supports semantic search, similarity comparison, clustering, and paraphrase mining. The current documentation also covers rerankers, sparse encoders, multi-vector encoders, and multimodal inputs. Its documented core jobs here are encoding and scoring inputs, not serving as a chat assistant that composes answers.

## Technical definition

The original Sentence-BERT method modifies pretrained BERT with siamese and triplet structures to derive sentence embeddings that can be compared with cosine similarity. The modern Sentence Transformers library has a broader documented scope: dense embedding models, Cross-Encoder rerankers, sparse encoders, multi-vector encoders, and supported multimodal models. Scores and vectors remain model-dependent and should be evaluated on representative queries and documents.

## How it shows up when you use agents

Sentence Transformers may appear in an agent’s retrieval layer rather than in the conversational interface. For text retrieval, an embedding model converts a query and candidate passages into vectors, after which a similarity function can rank candidates. The library also documents Cross-Encoder rerankers that score query-passage pairs, as well as sparse and multi-vector encoders. Suitable current models can accept modalities beyond text, including images, audio, or video.

In a [retrieval-augmented generation](/glossary/retrieval-augmented-generation) workflow, these components can help select passages before a generative model writes an answer. Retrieval and generation remain separate operations: a high similarity score indicates closeness under the selected model, not that a passage is factually correct or contains a complete answer.

To evaluate a setup, record the exact model used and test real queries whose relevant documents are already known. Inspect both missed relevant passages and highly ranked irrelevant passages. If a model changes, do not assume its vectors or scores are interchangeable with the previous model’s outputs. Validate comparability before mixing them; otherwise re-encode the corpus and compare retrieval results on the same question set. This is an operational recommendation, not a compatibility guarantee supplied by the cited pages.

## Common confusions

- **Sentence Transformers versus Transformers.** The [Transformers library](/glossary/transformers-library) is a broader model library. Sentence Transformers focuses on documented embedding, reranking, sparse-encoding, and multi-vector workflows.
- **Embedding model versus reranker.** An embedding model encodes items independently for efficient retrieval. A [cross-encoder](/glossary/cross-encoder) scores an input pair together and can rerank a smaller candidate set.
- **SBERT method versus modern library.** The 2019 Sentence-BERT paper describes a BERT modification using siamese and triplet structures. The current library carries the SBERT name but documents additional architectures and modalities.
- **Similarity versus correctness.** [Cosine similarity](/glossary/cosine-similarity) or another model score reflects the representation being used. It does not verify a claim or guarantee that the top passage answers the query.
- **Encoding versus answering.** The documented operations discussed here create representations or relevance scores. A separate application component may use those results to compose an answer.

## Worked examples in this catalogue

### [What Is RAG? Retrieval-Augmented Generation Explained](https://skillalmanac.com/learn/what-is-rag)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A guide showing how retrieval, chunking, embeddings, and generation can form a document-question-answering pipeline.

Why it exercises the concept: Sentence Transformers can supply embeddings or reranking for a retrieval stage. The guide explains that stage but does not require, execute, or benchmark this particular library.

### [rag-chunking-planner](https://skillalmanac.com/skills/skill-almanac/rag-chunking-planner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A planner that compares document chunking settings and reports structural defects and offline BM25 recall.

Why it exercises the concept: Chunk boundaries determine the inputs later sent to an embedding model. This is useful preparation for retrieval, but the skill does not run Sentence Transformers or measure embedding-based recall.

## Related terms

- [Embedding](https://skillalmanac.com/glossary/embedding.md)
- [Semantic search](https://skillalmanac.com/glossary/semantic-search.md)
- [Cosine similarity](https://skillalmanac.com/glossary/cosine-similarity.md)
- [BERT](https://skillalmanac.com/glossary/bert.md)
- [Cross-encoder](https://skillalmanac.com/glossary/cross-encoder.md)
- [Reranking](https://skillalmanac.com/glossary/reranking.md)
- [Transformers library (Hugging Face)](https://skillalmanac.com/glossary/transformers-library.md)

## Sources

- [SentenceTransformers Documentation](https://www.sbert.net/), UKP Lab and Hugging Face (accessed 2026-11-25)
- [Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks](https://arxiv.org/abs/1908.10084), arXiv (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
