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

# Create Memory

> Create a new memory (graph or vector)



## OpenAPI

````yaml POST /memories/create
openapi: 3.1.0
info:
  title: duohub Retriever API
  description: >-
    Retrieve assisted or non-assisted memory from a duohub knowledge graph. For
    best performance, use the official `duohub` Python package.
  version: 1.0.0
servers:
  - url: https://api.duohub.ai
security:
  - APIKeyHeader: []
paths:
  /memories/create:
    post:
      tags:
        - Memories
      summary: Create Memory
      description: Create a new memory (graph or vector)
      operationId: createMemory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - memoryType
              properties:
                name:
                  type: string
                  description: Name of the memory
                description:
                  type: string
                  description: Description of the memory
                  default: ''
                memoryType:
                  type: string
                  enum:
                    - graph
                    - vector
                  description: Type of memory storage
                ontology:
                  type: string
                  enum:
                    - culture
                    - essays
                    - support_requests
                  description: >-
                    Ontology type for the memory (required for graph memory
                    type)
                chunkSize:
                  type: integer
                  description: >-
                    Size of text chunks in characters for processing (only for
                    vector memory type)
                  default: 250
                chunkOverlap:
                  type: integer
                  description: >-
                    Overlap size between chunks in percentages (only for vector
                    memory type)
                  default: 10
                  maximum: 50
                  minimum: 1
                webhookUrl:
                  type: string
                  description: Optional webhook URL for notifications
                  format: uri
                acceleration:
                  type: boolean
                  description: Whether to enable acceleration
                  default: false
                factExtraction:
                  type: boolean
                  description: Whether to enable fact extraction
                  default: false
            example:
              name: Historical Knowledge Base
              description: Cultural memory for historical facts
              memoryType: graph
              ontology: cultural
              chunkSize: 250
              chunkOverlap: 10
              webhookUrl: https://api.example.com/webhook
              acceleration: false
              factExtraction: false
      responses:
        '201':
          description: Memory created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Unique identifier for the memory
                      name:
                        type: string
                      description:
                        type: string
                      memoryType:
                        type: string
                      userID:
                        type: string
                      graphDBName:
                        type: string
                      vectorDBCollection:
                        type: string
                      adapterRepo:
                        type: string
                      adapterVersion:
                        type: integer
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      step:
                        type: string
                      chunkSize:
                        type: integer
                      chunkOverlap:
                        type: integer
                      embeddingModel:
                        type: string
                      isTemplate:
                        type: boolean
                      botID:
                        type: string
                        nullable: true
                example:
                  status: success
                  data:
                    id: 123e4567-e89b-12d3-a456-426614174000
                    name: Historical Knowledge Base
                    description: Cultural memory for historical facts
                    memoryType: graph
                    userID: user123
                    graphDBName: 987fcdeb-51a2-43b7-91fa-987654321000
                    vectorDBCollection: 456e7890-c12d-34e5-b678-426614174000
                    adapterRepo: cultural_rdf_graph
                    adapterVersion: 1
                    createdAt: '2024-01-01T00:00:00.000Z'
                    updatedAt: '2024-01-01T00:00:00.000Z'
                    step: select
                    chunkSize: 1000
                    chunkOverlap: 200
                    factExtraction: false
                    acceleration: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - bad_request
                required:
                  - error
                  - status
                examples:
                  no_headers:
                    value:
                      error: No headers provided
                      status: bad_request
                  invalid_json:
                    value:
                      error: Invalid JSON in request body
                      status: bad_request
                  missing_field:
                    value:
                      error: name is required
                      status: bad_request
                  invalid_memory_type:
                    value:
                      error: 'Invalid memory type. Must be one of: graph, vector'
                      status: bad_request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - unauthorized
                required:
                  - error
                  - status
                example:
                  error: API key is required
                  status: unauthorized
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Your duohub API key. Type: str'

````