> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vaanivoice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Training

> Partially update the training section of an agent

## Update Agent Training

Partially update the **training** section of an agent. Only the fields you include are merged into the existing config; omitted fields remain unchanged.

The training section controls the agent's **knowledge base** (RAG) and **know-how** (FAQ, pain points, guardrails).

***

## Path Parameters

<ParamField path="agent_id" type="string" required>
  UUID of the agent to update.
</ParamField>

***

## Body Parameters

<ParamField body="knowledge" type="object">
  Knowledge base settings.

  <Expandable title="knowledge fields">
    <ParamField body="use_rag" type="boolean">
      Enable Retrieval-Augmented Generation (RAG) for this agent.
    </ParamField>

    <ParamField body="rag_knowledge_base_dict" type="object">
      Knowledge base configuration passed to the RAG provider.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="know_how" type="object">
  Curated agent knowledge and safety rules.

  <Expandable title="know_how fields">
    <ParamField body="faq" type="object">
      Map of question → answer pairs the agent should know verbatim (e.g. `{"What are your hours?": "9 AM – 5 PM"}`).
    </ParamField>

    <ParamField body="pain_points" type="object">
      Map of common customer pain-point labels to resolution guidance.
    </ParamField>

    <ParamField body="guardrails" type="object">
      Content-safety guardrails for the agent.

      <Expandable title="guardrails fields">
        <ParamField body="level" type="string">
          Guardrail strictness: `"basic"` | `"medium"` | `"strict"`.
        </ParamField>

        <ParamField body="sexual" type="boolean">Block sexual content.</ParamField>
        <ParamField body="violence" type="boolean">Block violent content.</ParamField>
        <ParamField body="threatning" type="boolean">Block threatening content.</ParamField>

        <ParamField body="custom_rules" type="array">
          Array of custom guardrail rule objects.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

***

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/training \
    -H "X-API-Key: vaani_<your_key>" \
    -H "Content-Type: application/json" \
    -d '{
      "knowledge": {
        "use_rag": true
      },
      "know_how": {
        "faq": {
          "What are your hours?": "We are open 9 AM to 5 PM, Monday to Friday.",
          "How do I reset my password?": "Visit the login page and click Forgot Password."
        },
        "guardrails": {
          "level": "medium",
          "violence": true
        }
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/training",
    {
      method: "PATCH",
      headers: {
        "X-API-Key": "vaani_<your_key>",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        know_how: {
          faq: {
            "What are your hours?": "We are open 9 AM to 5 PM, Monday to Friday.",
          },
          guardrails: { level: "medium" },
        },
      }),
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  requests.patch(
      "https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/training",
      headers={"X-API-Key": "vaani_<your_key>", "Content-Type": "application/json"},
      json={
          "know_how": {
              "faq": {"What are your hours?": "We are open 9 AM to 5 PM."},
              "guardrails": {"level": "medium"},
          }
      },
  )
  ```
</RequestExample>

***

## Response

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Training section updated successfully"
  }
  ```
</ResponseExample>
