Developers / Agents

Set an agent's knowledge search

PATCH https://api.echonova.ai/v1/agents/{agentId}/rag

Turns answering from knowledge on or off, and sets how many passages it reads and how close they must be. Fields you leave out keep their value. Free. Needs the agents:write scope on the key.

Headers

Authorization string Required

Bearer, a space, then your API key, which starts with ek_. Create keys in the portal under Developers, API Keys.

Path parameters

agentId string Required

The agent id, as GET /v1/agents returned it.

Request body

application/json

enabled boolean Required

Whether the agent answers from its knowledge.

topK integer Optional

How many knowledge passages to read for each answer.

1 to 20
minSimilarity number Optional

How close a passage must be to the question to be used, from 0 to 1.

0 to 1

Response

200 application/json Every response uses this envelope.

data object

The result.

success boolean

true for a successful call.

statusCode integer

Repeats the HTTP status.

errorMessage string or null

null on success.

Errors

Same envelope, with success false and data null. All errors

PATCH /v1/agents/{agentId}/rag

curl -X PATCH "https://api.echonova.ai/v1/agents/{agentId}/rag" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'

{
  "data": {
    "enabled": true,
    "topK": 5,
    "minSimilarity": 0.3
  },
  "success": true,
  "statusCode": 200,
  "errorMessage": null
}