Skip to main content
Glama

Compute text embeddings

replicate_embed_text
Idempotent

Convert one or more texts into numeric embedding vectors for RAG, semantic search, clustering, and similarity scoring.

Instructions

Convert text(s) into numeric embedding vectors. Useful for RAG, semantic search, clustering, similarity scoring.

Args:

  • texts: A single string or an array of strings (max 256). Each text is embedded independently.

  • model (default "bge-large"): Curated (bge-large, jina-embeddings-v3, all-minilm) or "owner/name".

  • extra_input (object, optional): Model-specific extras (e.g. {task: "retrieval.query"} for jina v3).

Returns: PredictionResult — the embedding vectors are in structuredContent.output (model-specific shape).

Input Schema

NameRequiredDescriptionDefault
modelNoEmbedding model. Curated: bge-large, jina-embeddings-v3, all-minilm. Or "owner/name".bge-large
textsYesA single text or an array of texts to embed.
downloadNoOutput is a numeric vector — default false.
timeout_msNoMax ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min).
extra_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.3.1
    • addedInput schema / properties / extra_input / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. First observedv3.2.3

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate it is non-read-only (readOnlyHint: false), idempotent, non-destructive, and open-world. The description adds valuable behavioral details: a maximum of 256 texts, independent embedding of each text, model-specific output shape in structuredContent.output, and the option for model-specific extras. It does not explicitly mention the asynchronous prediction nature or polling requirement, but that is covered in the timeout_ms parameter description within the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the tool's purpose, followed by succinct Args and Returns sections. Every sentence adds value—either clarifying usage, parameter behavior, or return format—with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description does a good job explaining the return shape (PredictionResult with vectors in structuredContent.output). It covers the core parameters and behavior. The main gap is not explicitly mentioning that this creates a prediction job that may need polling, though the schema's timeout_ms description covers that. Overall, it is complete enough for an agent to call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 80%, so the baseline is 3. The description adds meaningful semantics beyond the schema for key parameters: it clarifies the 256-text limit, independent embedding, curated model names, and the purpose of extra_input with a concrete example. It omits download and timeout_ms, but those are well-documented in the schema, so the net gain is above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Convert text(s) into numeric embedding vectors.' It also lists concrete use cases (RAG, semantic search, clustering, similarity scoring), which clearly distinguishes it from generative siblings like replicate_generate_image or replicate_chat. An agent can immediately recognize this as the embedding tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool by naming use cases such as RAG, semantic search, clustering, and similarity scoring. It does not explicitly say when to avoid it or mention alternatives like replicate_run_model for custom embedding models, but the stated contexts are sufficient to guide typical usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.