# Embed a document corpus for semantic search or RAG

> Embed a document corpus for semantic search or RAG: 3 companies fully do it, 15 with a limit, 35 carry the tag. Every listing in Embeddings & rerankers with the reason and a source.

- Canonical: https://www.anchorterminal.com/niches/embeddings.index-docs-for-rag/
- Markdown: https://www.anchorterminal.com/niches/embeddings.index-docs-for-rag/index.md (~2,300 tokens)
- Slim: https://www.anchorterminal.com/niches/embeddings.index-docs-for-rag/index.min.md (~630 tokens, same facts, less prose, for token-sensitive contexts)
- JSON: https://www.anchorterminal.com/niches/embeddings.index-docs-for-rag/index.json (this page as data, same URL with Accept: application/json)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-15

Two or three companies' docs show a full fit.

| Companies, full fit | With a limit | Carry the tag | Share of the category's work | First-hand accounts |
| --- | --- | --- | --- | --- |
| 3 | 15 | 35 | 21 | 19 |

## What counts as done

Every chunk gets one vector of the documented size, documents are embedded with the document setting and queries with the query setting (input type or prompt) as the docs require, an over-long chunk is rejected or truncated as documented rather than silently cut, and a failed call returns an error rather than a vector of the wrong size.

Measured, for our own tests: recall@10 against labelled answers on the category corpus, and query embedding p95 under 1 second.

How agents ask for it: index these documents so I can search them by meaning; build RAG over our docs; find the passage that answers this question; embed these chunks for the vector store

## Does the job

The docs show it meets the test above, and nothing we read says otherwise.

- **Amazon Nova Multimodal Embeddings (Amazon Web Services, Inc.)**: embeddingPurpose is required: GENERIC_INDEX for documents, TEXT_RETRIEVAL or GENERIC_RETRIEVAL for queries. truncationMode is required, NONE fails over-long text and truncatedCharLength is returned when cut. embeddingDimension fixes the size. Recall and p95 are unmeasured.
- **Cohere Embed and Rerank (Cohere Inc.)**: input_type is required (search_document, search_query); truncate NONE returns an error, START or END cut to the documented maximum; output_dimension fixes size and the embeddings array matches the input length. 128K tokens on Embed 5. Recall and p95 unmeasured.
- **Nomic Embed (Nomic, Inc.)**: task_type search_query and search_document, defaulting to search_document when omitted; long_text_mode truncate or mean with max_tokens_per_text; the response names the model. Recall and p95 unmeasured.

## Does the job, with a limit

It does the job, but something in the docs or a user's account will get in an agent's way. The limit is named in each row.

- **EmbeddingGemma 2 (Google LLC (RDAP registrant of gemma.ai; the card names Google DeepMind as author))**: SearchQuery and Document prompts and a fixed 768 dimensions are documented, but the card doesn't say what happens past 8,192 tokens, and float16 returns NaN or degraded vectors with no error.
- **EmbeddingGemma 300M (Google LLC (RDAP registrant of gemma.ai; the card names Google DeepMind as author))**: Query and document prompts are documented and encode_query and encode_document apply them, but the 2K input limit has no stated over-long behaviour, and an account found the documented title format scored worse than plain text.
- **Gemini Embedding (Google LLC)**: Query and document prefixes go in the text and output_dimensionality fixes size, but behaviour past 8,192 tokens isn't documented, several parts in one request aggregate into one vector, and the Python SDK returned one vector for N inputs.
- **Granite Embedding Small English R2 (International Business Machines Corporation)**: One 384-dimension vector per input with no query or document prompt required, and 8,192 tokens of context, but the card's examples truncate with truncation=True and never say what happens past the limit.
- **Jina Embeddings and Reranker (Jina AI GmbH)**: task retrieval.query and retrieval.passage with a stated text-matching default, truncate defaults to false so over-long input errors, and dimensions sets size, at 32,768 tokens on v5-small. An account had extended downtime force an emergency migration.
- **jina-embeddings-v5-omni-small (Jina AI GmbH, a subsidiary of Elastic N.V. (per the jina-embeddings listing's 2 October 2026 check))**: encode_query and encode_document (or Query: and Document: prefixes) are documented, with 1,024 dimensions and 32,768 tokens, but every route loads repository code with trust_remote_code and over-long behaviour isn't stated.
- **Mistral Embed and Codestral Embed (Mistral AI (RCS Paris 952 418 325))**: One vector per input string at a documented size, with no query or document setting to get wrong, but the 8k context has no documented over-long behaviour (error or truncation) in the guides or the OpenAPI request schema.
- **NVIDIA NeMo Retriever Embedding and Reranking NIMs (NVIDIA Corporation)**: input_type query or passage is required on asymmetric models, truncate NONE rejects over-long input and END cuts as documented, and dimensions is validated with 400 or 422. An NVIDIA forum case had a wrong tokenizer fail 597 tokens against a stated 8,192.
- **OpenAI embeddings (OpenAI OpCo, LLC)**: No query or document setting is needed, input over 8,192 tokens must not be sent and the response names model and index, but one account received 384-dimension all-zero vectors under another model name, and another saw query latency rise to 10 to 60 seconds.
- **Qwen3-Embedding-0.6B (Alibaba Cloud (the registrant of qwen.ai per RDAP, carried from the Qwen3.8-27B check))**: Queries take an Instruct prefix (prompt_name='query' in Sentence Transformers) and documents none, with up to 1024 dimensions and 32K context, but the card's Transformers example truncates silently at 8,192 tokens and no over-long behaviour is stated.
- **Qwen3-Embedding-4B (Alibaba Cloud (named in the copyright line of the 8B sibling's Apache 2.0 licence; this repository has no LICENSE file))**: Queries take an Instruct prefix (prompt_name='query' in Sentence Transformers) and documents none, with up to 2560 dimensions and 32K context, but the card's Transformers example truncates silently at 8,192 tokens and no over-long behaviour is stated.
- **Qwen3-Embedding-8B (Alibaba Cloud (named in the licence's copyright line))**: Queries take an Instruct prefix (prompt_name='query' in Sentence Transformers) and documents none, with up to 4096 dimensions and 32K context, but the card's Transformers example truncates silently at 8,192 tokens and no over-long behaviour is stated.
- **Qwen3-VL-Embedding-2B (Alibaba Cloud (RDAP names Alibaba Cloud (Singapore) Private Limited as the registrant of qwen.ai))**: A task instruction goes in the system prompt, defaulting to "Represent the user's input.", with up to 2048 dimensions and 32K context, but the card states no over-long behaviour and separates queries from documents only by the instruction the caller writes.
- **Qwen3-VL-Embedding-8B (Alibaba Group (Tongyi Lab, named in the copyright line of the GitHub repository's Apache 2.0 licence))**: A task instruction goes in the system prompt, defaulting to "Represent the user's input.", with up to 4096 dimensions and 32K context, but the card states no over-long behaviour and separates queries from documents only by the instruction the caller writes.
- **Voyage AI embeddings and rerankers (Voyage AI Innovations, Inc.)**: input_type query or document prepends published prompts, truncation=false raises an error past 32,000 tokens, and output_dimension fixes size; but the Python SDK's async helpers validated then dropped input_type until PR 67, a named blocker. An account reports contextual embeddings working well.
- **ZeroEntropy zerank and zembed (ZeroEntropy, Inc.)**: The hosted API was sunset after 4 September 2026. Self-hosted zembed-1 (Apache 2.0) has encode_query and encode_document with 32,768 tokens, but loads with trust_remote_code and states no over-long behaviour.

## What stops agents finishing

- SDK or wrapper drops the query/document setting, so queries embed with the wrong prompt (Voyage async helpers)
- outage returns 200 with wrong-size or all-zero vectors
- over-long input is truncated silently or the documented token limit is not the deployed one (NVIDIA tokenizer)
- query latency jumps from milliseconds to tens of seconds with no status incident

## Around it

Before: document-extraction.pdf-to-text, web-scrapers.page-to-markdown, speech-to-text.long-recording-batch. After: vector-search.rag-over-docs, embeddings.rerank-candidates.

## Where this comes from

Weight 21 of 100 in Embeddings & rerankers: 19 of 62 accounts (91 account-use-case tags, accounts counted in each use case they fit, scaled to 100 and rounded by hand); the job behind most Hacker News RAG threads read (production RAG, local RAG, Ask HN best models)

As data: https://www.anchorterminal.com/api/v1/use-cases/embeddings.index-docs-for-rag.json, or the MCP tool get_use_case with id embeddings.index-docs-for-rag. Draft, read 2026-11-15 from public docs and first-hand accounts, not yet reviewed by a person.

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
