Install
openclaw skills install embeddingsGenerate, store, and search vector embeddings with provider selection, chunking strategies, and similarity search optimization.
openclaw skills install embeddingsUser wants to convert text/images to vectors, build semantic search, or integrate embeddings into applications.
| Topic | File |
|---|---|
| Provider comparison & selection | providers.md |
| Chunking strategies & code | chunking.md |
| Vector database patterns | storage.md |
| Search & retrieval tuning | search.md |
Before recommending approach, ask:
| Need | Provider | Why |
|---|---|---|
| Best quality, any cost | OpenAI text-embedding-3-large | Top benchmarks |
| Cost-sensitive | OpenAI text-embedding-3-small | 5x cheaper, 80% quality |
| Multilingual | Cohere embed-multilingual-v3 | 100+ languages |
| Code/technical | Voyage voyage-code-2 | Optimized for code |
| Privacy/offline | Local (e5, bge, nomic) | No data leaves machine |
| Images | OpenAI CLIP, Cohere multimodal | Cross-modal search |
# Batch embedding with retry
def embed_batch(texts, model="text-embedding-3-small"):
results = []
for chunk in batched(texts, 100): # API limit
response = client.embeddings.create(input=chunk, model=model)
results.extend([e.embedding for e in response.data])
return results
# Similarity search with filter
results = index.query(
vector=query_embedding,
top_k=10,
filter={"category": "technical"},
include_metadata=True
)