|
| 1 | +--- |
| 2 | +title: Voyage AI |
| 3 | +description: Contextualized embeddings and reranking |
| 4 | +integration: |
| 5 | + type: "voyageai" |
| 6 | + color: "#7B4DFF" |
| 7 | +--- |
| 8 | + |
| 9 | +import { ReferenceDetails } from "@/components/ui/reference-details" |
| 10 | + |
| 11 | + |
| 12 | +{/* MANUAL-CONTENT-START:intro */} |
| 13 | +[Voyage AI](https://www.voyageai.com/) provides embedding and reranking models for search and retrieval. |
| 14 | + |
| 15 | +With the Voyage AI block, you can: |
| 16 | + |
| 17 | +- **Embed chunks with their document context**: Send each document as a list of text chunks. Every chunk vector reflects the document around it, so retrieval finds the right passage even when the chunk alone is ambiguous. |
| 18 | +- **Rerank results**: Reorder retrieved texts by relevance to a query, so your agent reads the best matches first. |
| 19 | + |
| 20 | +Create an API key in the [Voyage AI dashboard](https://dash.voyageai.com/) and paste it into the block, or store it once as a workspace key under Settings > BYOK. |
| 21 | + |
| 22 | +In Sim, the Voyage AI block lets your agents index documents for search and tighten the results they retrieve before answering. |
| 23 | +{/* MANUAL-CONTENT-END */} |
| 24 | + |
| 25 | +## Use the block [#usage-instructions] |
| 26 | + |
| 27 | +Embed document chunks with Voyage AI contextualized models, so each chunk vector reflects the document around it, and rerank texts against a query with Voyage AI rerankers. |
| 28 | + |
| 29 | +## Actions |
| 30 | + |
| 31 | +### Voyage AI Contextualized Embeddings |
| 32 | + |
| 33 | +Embed the chunks of one or more documents so that each chunk vector also reflects the document it came from |
| 34 | + |
| 35 | +<ReferenceDetails> |
| 36 | + |
| 37 | +#### Input |
| 38 | + |
| 39 | +| Parameter | Type | Required | Description | |
| 40 | +| --------- | ---- | -------- | ----------- | |
| 41 | +| `input` | array | Yes | Documents to embed, as a list of lists of text chunks: one inner list per document, chunks in document order | |
| 42 | +| `model` | string | No | Embedding model: voyage-context-4 \(default\) or voyage-context-3 | |
| 43 | +| `inputType` | string | No | What the embeddings are for: document \(chunks to index\) or query \(search queries\) | |
| 44 | +| `dimensions` | number | No | Output dimensions: 256, 512, 1024 \(default\), or 2048 | |
| 45 | +| `apiKey` | string | Yes | Your Voyage AI API key | |
| 46 | + |
| 47 | +#### Output |
| 48 | + |
| 49 | +| Parameter | Type | Description | |
| 50 | +| --------- | ---- | ----------- | |
| 51 | +| `embeddings` | json | Embedding vectors grouped by document: one list per input document, one vector per chunk, in input order | |
| 52 | +| `model` | string | Model used | |
| 53 | +| `dimensions` | number | Dimensionality of each vector | |
| 54 | +| `totalTokens` | number | Tokens billed for the request | |
| 55 | + |
| 56 | +</ReferenceDetails> |
| 57 | + |
| 58 | +### Voyage AI Rerank |
| 59 | + |
| 60 | +Rank a list of texts by relevance to a query with a Voyage AI reranker, most relevant first |
| 61 | + |
| 62 | +<ReferenceDetails> |
| 63 | + |
| 64 | +#### Input |
| 65 | + |
| 66 | +| Parameter | Type | Required | Description | |
| 67 | +| --------- | ---- | -------- | ----------- | |
| 68 | +| `query` | string | Yes | The query to rank the documents against | |
| 69 | +| `documents` | array | Yes | The texts to rank, as a list of strings \(up to 1,000\) | |
| 70 | +| `model` | string | No | Reranker model: rerank-2.5 \(default\) or rerank-2.5-lite | |
| 71 | +| `topK` | number | No | Number of most relevant documents to return. Defaults to all of them. | |
| 72 | +| `apiKey` | string | Yes | Your Voyage AI API key | |
| 73 | + |
| 74 | +#### Output |
| 75 | + |
| 76 | +| Parameter | Type | Description | |
| 77 | +| --------- | ---- | ----------- | |
| 78 | +| `results` | array | Documents ranked by relevance, most relevant first | |
| 79 | +| ↳ `index` | number | Position of the document in the input list | |
| 80 | +| ↳ `relevanceScore` | number | Relevance of the document to the query | |
| 81 | +| ↳ `document` | string | The document text | |
| 82 | +| `model` | string | Reranker model used | |
| 83 | +| `totalTokens` | number | Tokens billed for the request | |
| 84 | + |
| 85 | +</ReferenceDetails> |
| 86 | + |
| 87 | + |
0 commit comments