Skills wshobson agents

embedding-strategies

Use it when:
You're building semantic search or RAG and need to pick an embedding model, split documents into chunks, or measure retrieval quality.
It does:
Compares ten embedding models by dimensions, token limit and best use, and gives the agent chunking and preprocessing rules.
You get:
Python templates for Voyage AI, OpenAI and local embeddings, four chunkers, document and code pipelines, and a function that scores and compares models.
Recommends:
Voyage AI models for Claude apps, as Anthropic does, with domain models for code, finance and legal text.
Terms:
An embedding turns text into a list of numbers so similar meanings land close together; chunking splits documents into pieces to embed.
Unlike rag-implementation:
That one, from the same repo, covers the whole retrieval system; this one covers only the embedding step.

TL;DR

A reference with templates rather than a workflow. The SKILL.md has a 2026 table of embedding models, from voyage-3-large and OpenAI's text-embedding-3 models to open-source bge-large, all-MiniLM and multilingual-e5, and a pipeline: chunk, preprocess, embed. Its rules: match the model to code, prose or multilingual content, keep chunks on meaning boundaries, normalize vectors for cosine similarity, batch and cache requests, respect token limits, never mix models in one index, and keep metadata. The reference file holds six Python templates: Voyage AI embeddings through LangChain, including the code, finance and law models; OpenAI embeddings in batches of 100 with optional dimension reduction (Matryoshka embeddings, which still work when cut shorter); local BGE and E5 models with the query prefixes they expect; chunking by tokens, sentences, Markdown headers or a recursive splitter; a pipeline that cleans, chunks and embeds documents with metadata, and one that splits code into functions and classes with tree-sitter; and an evaluation that scores retrieval by precision, recall, MRR and NDCG and compares models side by side.

Summarizes the skill at 4bde316.

npx skills add https://github.com/wshobson/agents --skill embedding-strategies
Total Downloads
11,800 on skills.sh, Nov 9, 2026
Repo stars
42,334 wshobson/agents
First seen
Jan 20, 2026 on skills.sh
Weekly Downloads
157
-16% over the 8 weeks to Nov 9
Weekly values
Week toInstalls
Sep 21187
Sep 28228
Oct 5285
Oct 12226
Oct 19183
Oct 26187
Nov 2175
Nov 9157
Category

Build agents, orchestrate workers and give agents memory.

Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills.

Type

Knowledge and rules the agent applies while it works: best practices, design principles, API references.

Effect

Adds no side effects of its own. It shapes how the agent thinks, writes or reviews. Guidelines and routers are always effect:none, even when the task they support edits code.

Needs

Instructions only. Works in any agent that supports skills.

Publisher

Everyone else. Unverified vendor claims default to community.

Topics
Stack

SKILL.md

From wshobson/agents at 4bde316. Checked daily, last changed Nov 6, 2026.

Frontmatter
name: embedding-strategies
description: Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.

Embedding Strategies

Guide to selecting and optimizing embedding models for vector search applications.

When to Use This Skill

  • Choosing embedding models for RAG
  • Optimizing chunking strategies
  • Fine-tuning embeddings for domains
  • Comparing embedding model performance
  • Reducing embedding dimensions
  • Handling multilingual content

Core Concepts

1. Embedding Model Comparison (2026)
Model Dimensions Max Tokens Best For
voyage-3-large 1024 32000 Claude apps (Anthropic recommended)
voyage-3 1024 32000 Claude apps, cost-effective
voyage-code-3 1024 32000 Code search
voyage-finance-2 1024 32000 Financial documents
voyage-law-2 1024 32000 Legal documents
text-embedding-3-large 3072 8191 OpenAI apps, high accuracy
text-embedding-3-small 1536 8191 OpenAI apps, cost-effective
bge-large-en-v1.5 1024 512 Open source, local deployment
all-MiniLM-L6-v2 384 256 Fast, lightweight
multilingual-e5-large 1024 512 Multi-language
2. Embedding Pipeline
Document → Chunking → Preprocessing → Embedding Model → Vector
                ↓
        [Overlap, Size]  [Clean, Normalize]  [API/Local]

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's
  • Match model to use case: Code vs prose vs multilingual
  • Chunk thoughtfully: Preserve semantic boundaries
  • Normalize embeddings: For cosine similarity search
  • Batch requests: More efficient than one-by-one
  • Cache embeddings: Avoid recomputing for static content
  • Use Voyage AI for Claude apps: Recommended by Anthropic
Don'ts
  • Don't ignore token limits: Truncation loses information
  • Don't mix embedding models: Incompatible vector spaces
  • Don't skip preprocessing: Garbage in, garbage out
  • Don't over-chunk: Lose important context
  • Don't forget metadata: Essential for filtering and debugging