PUT
/
agents
/
{agent_id}
curl --request PUT \
  --url https://api.contextual.ai/v1/agents/{agent_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "system_prompt": "<string>",
  "no_retrieval_system_prompt": "<string>",
  "filter_prompt": "<string>",
  "suggested_queries": [
    "<string>"
  ],
  "agent_configs": {
    "retrieval_config": {
      "top_k_retrieved_chunks": 123,
      "lexical_alpha": 123,
      "semantic_alpha": 123
    },
    "filter_and_rerank_config": {
      "top_k_reranked_chunks": 123,
      "reranker_score_filter_threshold": 123,
      "rerank_instructions": "<string>"
    },
    "generate_response_config": {
      "max_new_tokens": 123,
      "temperature": 123,
      "top_p": 123,
      "frequency_penalty": 123,
      "seed": 123,
      "calculate_groundedness": true,
      "avoid_commentary": false
    },
    "global_config": {
      "enable_rerank": true,
      "enable_filter": true,
      "enable_multi_turn": true
    }
  },
  "datastore_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "llm_model_id": "<string>",
  "configuration": "<any>"
}'
{}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
string
required

ID of the agent to edit

Body

application/json
system_prompt
string

Instructions that your agent references when generating responses. Note that we do not guarantee that the system will follow these instructions exactly.

Maximum length: 8000
no_retrieval_system_prompt
string

Instructions on how the agent should respond when there are no relevant retrievals that can be used to answer a query.

Maximum length: 8000
filter_prompt
string

The prompt to an LLM which determines whether retrieved chunks are relevant to a given query and filters out irrelevant chunks.

Maximum length: 8000
suggested_queries
string[]

These queries will show up as suggestions in the Contextual UI when users load the agent. We recommend including common queries that users will ask, as well as complex queries so users understand the types of complex queries the system can handle. The max length of all the suggested queries is 1000.

agent_configs
object

The following advanced parameters are experimental and subject to change.

datastore_ids
string[]

IDs of the datastore to associate with the agent.

llm_model_id
string

The model ID to use for generation. Tuned models can only be used for the agents on which they were tuned. If no model is specified, the default model is used. Set to default to switch from a tuned model to the default model.

configuration
any

Response

200
application/json
Successful Response

The response is of type object.