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

# Update RAG Settings

> Updates RAG configuration settings for a project

## Request Body

<ParamField body="projectId" type="string" required>
  Project ID to update settings for
</ParamField>

<ParamField body="settings" type="object" required>
  RAG configuration settings

  <Expandable title="Settings Object">
    <ParamField body="vectorstoreProvider" type="string">
      Vector store provider (pinecone, weaviate, qdrant, chroma)
    </ParamField>

    <ParamField body="vectorStoreConfig" type="object">
      Provider-specific configuration including API keys, endpoints, etc.
    </ParamField>

    <ParamField body="embeddingModel" type="string">
      Embedding model name (e.g., text-embedding-3-small, text-embedding-3-large)
    </ParamField>

    <ParamField body="chunkSize" type="number">
      Document chunk size in tokens (recommended: 256-1024)
    </ParamField>

    <ParamField body="chunkOverlap" type="number">
      Overlap between chunks in tokens (recommended: 10-20% of chunkSize)
    </ParamField>

    <ParamField body="searchType" type="string">
      Default search type: semantic, mrr, or hybrid
    </ParamField>

    <ParamField body="topK" type="number">
      Default number of results to return (recommended: 3-10)
    </ParamField>

    <ParamField body="minScore" type="number">
      Minimum similarity score threshold (0-1, recommended: 0.5-0.7)
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the update was successful
</ResponseField>

<ResponseField name="message" type="string">
  Status message or error details
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://api.example.com/api/knowledge/settings \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "projectId": "proj_123",
      "settings": {
        "vectorstoreProvider": "pinecone",
        "vectorStoreConfig": {
          "apiKey": "pc-xxxxxxxxxxxxx",
          "environment": "us-east-1",
          "indexName": "my-index"
        },
        "embeddingModel": "text-embedding-3-small",
        "chunkSize": 512,
        "chunkOverlap": 50,
        "searchType": "semantic",
        "topK": 5,
        "minScore": 0.7
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.example.com/api/knowledge/settings', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      projectId: 'proj_123',
      settings: {
        vectorstoreProvider: 'pinecone',
        vectorStoreConfig: {
          apiKey: 'pc-xxxxxxxxxxxxx',
          environment: 'us-east-1',
          indexName: 'my-index'
        },
        embeddingModel: 'text-embedding-3-small',
        chunkSize: 512,
        chunkOverlap: 50,
        searchType: 'semantic',
        topK: 5,
        minScore: 0.7
      }
    })
  });

  const data = await response.json();
  ```

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

  response = requests.put(
      'https://api.example.com/api/knowledge/settings',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'projectId': 'proj_123',
          'settings': {
              'vectorstoreProvider': 'pinecone',
              'vectorStoreConfig': {
                  'apiKey': 'pc-xxxxxxxxxxxxx',
                  'environment': 'us-east-1',
                  'indexName': 'my-index'
              },
              'embeddingModel': 'text-embedding-3-small',
              'chunkSize': 512,
              'chunkOverlap': 50,
              'searchType': 'semantic',
              'topK': 5,
              'minScore': 0.7
          }
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "message": "RAG settings updated successfully"
  }
  ```

  ```json Validation Error theme={null}
  {
    "success": false,
    "message": "Invalid vectorstore configuration: API key is required"
  }
  ```
</ResponseExample>
