Skip to main content
RCP exposes three embedding methods, one per vector family. A server advertises each independently, so a client can request exactly the representation it wants for a client-side ANN index or a custom pipeline.

embed

One dense vector per input. embed capability.

embed/sparse

A learned-sparse term→weight vector (SPLADE). sparseEmbed capability.

embed/multi

A matrix of per-token/per-patch vectors (ColBERT/ColPali). multiVector.

embed — dense

Gated by embed. One vector per input, in order.
(string | Content)[]
required
Bare strings or Content blocks. A text-only server accepts only strings; a multimodal server that advertises embed.modalities also accepts image/audio blocks.
"query" | "document"
Lets asymmetric encoders (e5/BGE query vs passage prefixes) select the right pooling.
float[][]
One vector per input, in the same order.
For backward compatibility a server MUST also accept the legacy field name texts as a synonym for inputs. Requests SHOULD respect embed.batchLimit.

Compact wire encoding (f32-base64)

JSON numbers are a poor carrier for embeddings: a 1000×1024 float32 batch is ~10–20 MB as decimal text but only ~4 MB as raw bytes. A server that advertises it lets a client opt into a binary encoding per request (spec §7.3.1):
  • json — an array of JSON numbers. Always supported; the default and fallback, so a client that ignores this feature is never broken.
  • f32-base64 — the vector as little-endian IEEE-754 binary32, concatenated and base64-encoded (RFC 4648 §4, with padding). Byte order is little-endian regardless of host, so the wire is reproducible across platforms.
The client sends "encoding": "f32-base64"; the server MUST echo the encoding it used and MUST NOT use one the client did not request. Requesting an unadvertised encoding is -32005 (OptionUnsupported).
Response (f32-base64)
Every reference SDK ships the codec — byte-for-byte identical, dependency-free — so servers encode and clients decode without hand-rolling base64:

embed/sparse — learned-sparse

Gated by sparseEmbed. Each entry is a sparse vector over the model vocabulary (SPLADE-style term weights).
object[]
One entry per input. indices are vocabulary ids; values are the learned term weights. Search these with an inverted index.

embed/multi — multi-vector (late interaction)

Gated by multiVector. Each input yields a matrix of token- (ColBERT) or patch- (ColPali/ColQwen) level embeddings for late-interaction scoring.
The relevance of a document D to a query Q is the MaxSim sum — for each query vector, take its maximum similarity against any document vector, then sum:
Clients score with MaxSim locally, or delegate via rerank method:"colbert". Servers SHOULD advertise multiVector.similarity. Visual-document servers advertise multiVector.modalities:["image"] and accept rendered pages as image Content blocks — each page yields one patch matrix.
Prefer these array-param methods over JSON-RPC batching: they are inherently batched and far more efficient for throughput.