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

# Update this app's brain-generation config (structure/prompts/weights)

> Partial update of the caller's own generation config — whitelist only. Takes
effect on the next brain generation; no Vault side-effects, no regen triggered.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml patch /context-documents/config
openapi: 3.1.0
info:
  title: Hyperspell API
  summary: >-
    Hyperspell is the memory layer for AI apps and agents. Through the API, you
    can add memories, connect data sources to index them in real-time, and
    search memories with our natural language query engine.
  termsOfService: https://hyperspell.com/blog/tos
  contact:
    name: Hyperspell
    url: https://hyperspell.com/
    email: hello@hyperspell.com
  version: 0.32.1
servers:
  - url: https://api.hyperspell.com
    description: Production
security:
  - APIKey: []
    AsUser: []
paths:
  /context-documents/config:
    patch:
      tags:
        - Context Documents
      summary: Update this app's brain-generation config (structure/prompts/weights)
      description: >-
        Partial update of the caller's own generation config — whitelist only.
        Takes

        effect on the next brain generation; no Vault side-effects, no regen
        triggered.
      operationId: update_brain_config_context_documents_config_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrainConfigUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrainConfigView'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
        - AsUser: []
components:
  schemas:
    BrainConfigUpdate:
      properties:
        structure:
          anyOf:
            - $ref: '#/components/schemas/BrainConfigStructure'
            - type: 'null'
        company_prompts:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Company Prompts
        workstream_prompts:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Workstream Prompts
        personal_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Personal Prompt
        detection_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Detection Prompt
        source_weights:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source Weights
      type: object
      title: BrainConfigUpdate
      description: >-
        The self-serve subset of context-doc config an app may edit with its OWN

        credential. Excludes canonical_documents, demo/pretend,
        employee_domains, and

        digest flags — those are not customer-editable through this surface.
    BrainConfigView:
      properties:
        structure:
          additionalProperties: true
          type: object
          title: Structure
        prompts:
          additionalProperties: true
          type: object
          title: Prompts
        source_weights:
          additionalProperties:
            type: string
          type: object
          title: Source Weights
      type: object
      required:
        - structure
        - prompts
        - source_weights
      title: BrainConfigView
      description: >-
        Filtered read view — only the customer-editable fields, never internal
        ones.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BrainConfigStructure:
      properties:
        company:
          anyOf:
            - items:
                $ref: '#/components/schemas/DocSpec'
              type: array
            - type: 'null'
          title: Company
        workstream:
          anyOf:
            - items:
                $ref: '#/components/schemas/DocSpec'
              type: array
            - type: 'null'
          title: Workstream
      type: object
      title: BrainConfigStructure
      description: >-
        Per-tier document set — the custom prompt set. Mirrors the admin

        TreeStructureUpdate validation without coupling this router to the admin
        package.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DocSpec:
      properties:
        key:
          type: string
          title: Key
        filename:
          type: string
          title: Filename
        prompt:
          type: string
          title: Prompt
        search_queries:
          items:
            type: string
          type: array
          title: Search Queries
      type: object
      required:
        - key
        - filename
        - prompt
        - search_queries
      title: DocSpec
      description: >-
        One document in a context-tree tier: what to generate and how to
        retrieve for it.
  securitySchemes:
    APIKey:
      type: http
      description: >-
        API Key or JWT User Token. If using an API Key, set the X-As-User header
        to act as a specific user. A JWT User Token is always scoped to a
        specific user.
      scheme: bearer
      bearerFormat: Bearer <token>
    AsUser:
      type: apiKey
      description: >-
        Optionally set this header to act as a specific user when using an API
        Key, equivalent to first exchanging the API Key for a User Token
      in: header
      name: X-As-User

````