Embedding models convert text into numerical vectors that capture semantic meaning for similarity search in RAG systems.
Popular Embedding Models
1. text-embedding-ada-002 (OpenAI)
Dimensions: 1536
Type: General purpose
Use Case: Most applications requiring high quality embeddings
Performance: Excellent balance of quality and speed
2. all-MiniLM-L6-v2 (Sentence Transformers)
Dimensions: 384
Type: Lightweight
Use Case: Applications requiring fast inference
Performance: Good quality, very fast
3. e5-large-v2
Dimensions: 1024
Type: High quality
Use Case: Applications needing superior performance
Performance: Excellent quality, multilingual support
4. Instructor
Dimensions: Variable (768)
Type: Task-specific
Use Case: Domain-specific applications
Performance: Can be fine-tuned for specific tasks
5. bge-large-en-v1.5
Dimensions: 1024
Type: State-of-the-art
Use Case: Applications requiring best possible quality
Performance: SOTA performance on benchmarks
Selection Criteria
Quality vs Speed: Balance between embedding quality and inference speed
Dimension Size: Impact on storage and retrieval performance
Domain: Specific language or domain requirements
Cost: API costs vs local deployment
Batch Size: Throughput requirements
Language: Multilingual support needs
Usage Examples
OpenAI Embeddings
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
vector = embeddings.embed_query("Your text here")
Sentence Transformers
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
vector = model.encode("Your text here")
Hugging Face Models
from langchain.embeddings import HuggingFaceEmbeddings
embeddings = HuggingFaceEmbeddings(
model_name="sentence-transformers/all-MiniLM-L6-v2"
)
Optimization Tips
Batch Processing: Process multiple texts together for efficiency
Model Quantization: Reduce model size for faster inference
Caching: Cache embeddings for frequently used texts
GPU Acceleration: Use GPU for faster processing when available
Model Selection: Choose appropriate model size for your use case
Evaluation Metrics
Semantic Similarity: How well embeddings capture meaning
Retrieval Performance: Quality of retrieved documents
Speed: Inference time per document
Memory Usage: RAM requirements for the model
Cost: API costs or infrastructure requirements
1---2name: 332-embedding-models-d9e563a43description: Embedding Models Guide4---5# Embedding Models Guide67## Overview8Embedding models convert text into numerical vectors that capture semantic meaning for similarity search in RAG systems.910## Popular Embedding Models1112### 1. text-embedding-ada-002 (OpenAI)13- **Dimensions**: 153614- **Type**: General purpose15- **Use Case**: Most applications requiring high quality embeddings16- **Performance**: Excellent balance of quality and speed1718### 2. all-MiniLM-L6-v2 (Sentence Transformers)19- **Dimensions**: 38420- **Type**: Lightweight21- **Use Case**: Applications requiring fast inference22- **Performance**: Good quality, very fast2324### 3. e5-large-v225- **Dimensions**: 102426- **Type**: High quality27- **Use Case**: Applications needing superior performance28- **Performance**: Excellent quality, multilingual support2930### 4. Instructor31- **Dimensions**: Variable (768)32- **Type**: Task-specific33- **Use Case**: Domain-specific applications34- **Performance**: Can be fine-tuned for specific tasks3536### 5. bge-large-en-v1.537- **Dimensions**: 102438- **Type**: State-of-the-art39- **Use Case**: Applications requiring best possible quality40- **Performance**: SOTA performance on benchmarks4142## Selection Criteria43441. **Quality vs Speed**: Balance between embedding quality and inference speed452. **Dimension Size**: Impact on storage and retrieval performance463. **Domain**: Specific language or domain requirements474. **Cost**: API costs vs local deployment485. **Batch Size**: Throughput requirements496. **Language**: Multilingual support needs5051## Usage Examples5253### OpenAI Embeddings54```python55from langchain.embeddings import OpenAIEmbeddings5657embeddings = OpenAIEmbeddings()58vector = embeddings.embed_query("Your text here")59```6061### Sentence Transformers62```python63from sentence_transformers import SentenceTransformer6465model = SentenceTransformer('all-MiniLM-L6-v2')66vector = model.encode("Your text here")67```6869### Hugging Face Models70```python71from langchain.embeddings import HuggingFaceEmbeddings7273embeddings = HuggingFaceEmbeddings(74 model_name="sentence-transformers/all-MiniLM-L6-v2"75)76```7778## Optimization Tips79801. **Batch Processing**: Process multiple texts together for efficiency812. **Model Quantization**: Reduce model size for faster inference823. **Caching**: Cache embeddings for frequently used texts834. **GPU Acceleration**: Use GPU for faster processing when available845. **Model Selection**: Choose appropriate model size for your use case8586## Evaluation Metrics87881. **Semantic Similarity**: How well embeddings capture meaning892. **Retrieval Performance**: Quality of retrieved documents903. **Speed**: Inference time per document914. **Memory Usage**: RAM requirements for the model925. **Cost**: API costs or infrastructure requirements
Run npx skillmds@latest add tools-only/332-embedding-models-d9e563a4 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Embedding Models Guide It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tools-only (@tools-only) published this skill. Their other Agent Skills are listed on their SkillMD profile.