kdeps-tools-retrieve_context
v1.1.0Retrieve semantically relevant text chunks from the configured RAG index. Use for finding code, documentation, or notes related to a query before implementing or answering. Requires KDEPS_RAG_BASE_URL pointing to a compatible RAG service.
set tools / shelf rag
LLM context: ~119 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/retrieve_context
- 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/retrieve_context@<version>.
Contents
Retrieve semantically relevant text chunks from the configured RAG index. Use for finding code, documentation, or notes related to a query before implementing or answering. Requires KDEPS_RAG_BASE_URL pointing to a compatible RAG service.
| Parameter | Type | Description |
|---|---|---|
| query * | string | The search query to find relevant context for |
| top_k | number | Number of results to return (default: 5, max: 32)default: 5 |
HTTP call (declared in YAML, no Go code)
{{trimSuffix .env.BASE_URL "/"}}/v1/queryOffered when set: KDEPS_RAG_BASE_URL
- Content-Type:
- application/json
Body
{"query": {{json .args.query}}, "top_k": {{min .args.top_k 32}}}
Result
{{range $i, $r := .response.results}}{{if $i}}---
{{end}}[{{add $i 1}}] score={{printf "%.3f" $r.score}} source={{$r.source}}
{{$r.text}}
{{end}}
version: 1.1.0
description: Retrieve semantically relevant text chunks from the configured RAG index. Use for finding code, documentation, or notes related to a query before implementing or answering. Requires KDEPS_RAG_BASE_URL pointing to a compatible RAG service.
parameters:
query:
type: string
description: The search query to find relevant context for
required: true
top_k:
type: number
description: 'Number of results to return (default: 5, max: 32)'
default: 5
http:
env:
BASE_URL: [KDEPS_RAG_BASE_URL]
method: POST
url: '{{trimSuffix .env.BASE_URL "/"}}/v1/query'
headers:
Content-Type: application/json
body: '{"query": {{json .args.query}}, "top_k": {{min .args.top_k 32}}}'
result: |-
{{range $i, $r := .response.results}}{{if $i}}---
{{end}}[{{add $i 1}}] score={{printf "%.3f" $r.score}} source={{$r.source}}
{{$r.text}}
{{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