kdeps-tools-voyageai_rerank
v1.1.0Rerank a list of documents by relevance to a query using VoyageAI's reranking API. Requires VOYAGEAI_API_KEY.
set tools / shelf rag
LLM context: ~137 tokens when loaded (prompt or tool definition)
Where it runs
Part of the tools set, used in workflow and agent mode. What the model is told about each built-in tool: its description, usage notes and parameters. kdeps runs the tool itself.
- the agent loop builds the request
- the tool definitions are sent to the modeltools/voyageai_rerank
- the model calls a tool
- kdeps runs it
- the result goes back to the model
Loaded by: kdeps (agent loop), /update, /settings, kdeps run, kdeps install, kdeps list, kdeps uninstall, kdeps update
In the code: kdeps (agent loop)agent.RegisterBuiltinToolsagent.definedAs
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Pin a version with kdeps install tools/voyageai_rerank@<version>.
Contents
Rerank a list of documents by relevance to a query using VoyageAI's reranking API. Requires VOYAGEAI_API_KEY.
| Parameter | Type | Description |
|---|---|---|
| documents * | string | JSON array of document texts to rerank |
| model | string | VoyageAI rerank model (default: rerank-2)default: rerank-2 |
| query * | string | The search query to rank documents against |
| top_n | number | Number of top results to return (default: 5)default: 5 |
HTTP call (declared in YAML, no Go code)
https://api.voyageai.com/v1/rerankOffered when set: VOYAGEAI_API_KEY
- Content-Type:
- application/json
- Authorization:
- Bearer {{.env.API_KEY}}
Body
{"model": {{json .args.model}}, "query": {{json .args.query}}, "documents": {{json (fromJSON .args.documents)}}, "top_k": {{int .args.top_n}}, "return_documents": true}
Result
{{- $docs := fromJSON .args.documents -}}
[{{range $i, $r := .response.data}}{{if $i}},{{end}}
{"index": {{int $r.index}}, "text": {{json (or $r.document (get $docs $r.index))}}, "score": {{json $r.relevance_score}}}{{end}}
]
version: 1.1.0
description: Rerank a list of documents by relevance to a query using VoyageAI's reranking API. Requires VOYAGEAI_API_KEY.
parameters:
documents:
type: string
description: JSON array of document texts to rerank
required: true
model:
type: string
description: 'VoyageAI rerank model (default: rerank-2)'
default: rerank-2
query:
type: string
description: The search query to rank documents against
required: true
top_n:
type: number
description: 'Number of top results to return (default: 5)'
default: 5
http:
env:
API_KEY: [VOYAGEAI_API_KEY]
method: POST
url: https://api.voyageai.com/v1/rerank
headers:
Content-Type: application/json
Authorization: "Bearer {{.env.API_KEY}}"
body: >-
{"model": {{json .args.model}}, "query": {{json .args.query}},
"documents": {{json (fromJSON .args.documents)}}, "top_k": {{int .args.top_n}}, "return_documents": true}
result: |-
{{- $docs := fromJSON .args.documents -}}
[{{range $i, $r := .response.data}}{{if $i}},{{end}}
{"index": {{int $r.index}}, "text": {{json (or $r.document (get $docs $r.index))}}, "score": {{json $r.relevance_score}}}{{end}}
]
Versions
| Version | Published | Status |
|---|---|---|
| 1.1.0 | 10/13/2026 | active |
| 1.0.0 | 10/11/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.1.0
- Published
- 10/11/2026