agentsclimarketplace

Embeddings selection

Skill Amey-Thakur/AI-SKILLS/skills/llm-engineering/embeddings-selection

Plug-and-play skills and prompts for every AI coding agent

Install
npx -y skills add Amey-Thakur/AI-SKILLS --skill embeddings-selection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 19 days oldThe repository was created 19 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Choose embedding models and chunking by evaluating retrieval on your own corpus, not by leaderboard rank. Use when building semantic search or RAG and deciding how to embed and chunk.

SKILL.md

3.7 KB, as published. Nobody here has run it

Embeddings selection

The embedding model and the chunking strategy together determine what retrieval can find. Both are decided the same way: by measuring retrieval quality on your own corpus and queries, because leaderboard rank rarely survives contact with a specific domain.

Method

  1. Build a retrieval eval set first. Real queries paired with the documents that should answer them (from logs, from domain experts, or synthesized then human-checked): this is what makes every downstream choice measurable (see llm-eval-design). Metrics: recall@k (did the right chunk make the top k?) and MRR; without this set, model selection is vibes and chunk-size is superstition.
  2. Match the model to domain, cost, and constraints. General models (the strong hosted APIs) are the default baseline; domain-specialized or fine-tuned embeddings win on jargon-heavy corpora (legal, medical, code): test both on your set. Weigh dimensionality (storage and search cost scale with it: see data-partitioning of vectors), context length (can it embed your chunk sizes?), multilingual needs, and hosted-vs-local (privacy, cost, latency: see managed-vs-selfhosted). Matryoshka/truncatable embeddings let you trade dimensions for cost after the fact.
  3. Chunk for the retrieval unit, not the file. Chunk size trades precision (small: exact matches, lost context) against recall of complete answers (large: context kept, diluted relevance); 200-500 tokens with overlap is a common start, but your eval set decides. Respect structure (split on headings/paragraphs, never mid- sentence), keep metadata (source, section) on each chunk (see rag-pipeline's citation needs), and consider parent-child (embed small, return the enclosing section).
  4. Test the pairing, because they interact. The same model performs differently across chunk sizes; evaluate model-and-chunking as one grid on the eval set, not separately. This is the step teams skip and then blame the model for a chunking failure (or vice versa).
  5. Add hybrid and reranking where the eval demands. Dense embeddings miss exact-term and rare-token matches (IDs, names, code symbols): hybrid with keyword/BM25 (see sql-optimization's FTS instincts) recovers them; a cross-encoder reranker over the top-k lifts precision at a latency cost (see llm-cost-latency). Add each only when the eval set shows the gap it closes; complexity without a measured win is debt.
  6. Plan for re-embedding as a migration. Changing the embedding model means re-embedding the whole corpus (embeddings are not comparable across models): version the index, backfill offline (see incremental-processing, data-pipeline-design's backfill discipline), and cut over atomically. Budget this before choosing a model you might outgrow, and normalize/version dimensions so search code stays stable.

Boundaries

  • Retrieval quality is upstream of generation quality: no prompt rescues answers the retriever never surfaced, so fix retrieval first when RAG underperforms (see rag-pipeline's failure triage).
  • Embeddings encode similarity, not truth or recency; freshness and authority are metadata-and-ranking concerns layered on top, not properties of the vector.
  • Vector-store choice (index type, filtering, scale) is a separate infrastructure decision (see cloud-storage- selection instincts); the embedding decision comes first and constrains it (dimensions, distance metric).

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.