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

# Get memory graph

> Page through a namespace's documents with their memories as graph nodes and edges, for example to render @supermemory/memory-graph. Pass nextCursor back as cursor until it is null.



## OpenAPI

````yaml https://api.supermemory.ai/v5/openapi post /ns/{namespace}/graph
openapi: 3.1.0
info:
  title: supermemory API
  description: >-
    The Memory API for the AI era. OpenAPI operations include x-codeSamples for
    the official TypeScript and Python SDKs (Mintlify-compatible).
  version: 5.0.0
servers:
  - description: Production Server
    url: https://api.supermemory.ai
security:
  - bearerAuth: []
tags:
  - name: Ingest
    description: Ingest documents, files, URLs, conversations, and other content
  - name: Recall (Search)
    description: >-
      Semantic recall across your content — supports memories, hybrid, and
      documents modes
  - name: Profiles
    description: Maintained static, dynamic, and custom-bucket profiles scoped by namespace
  - name: Content Management
    description: List, get, update, and delete content and memories
  - name: Namespaces
    description: List and manage isolated namespaces and their settings
  - name: Connectors
    description: >-
      Sync external sources such as Google Drive, Notion and GitHub into a
      namespace
  - name: Organization
    description: Read and update organization-wide settings
  - name: Feedback
    description: Report bugs, request features, and flag documentation issues
paths:
  /ns/{namespace}/graph:
    post:
      tags:
        - Content Management
      summary: Get memory graph
      description: >-
        Page through a namespace's documents with their memories as graph nodes
        and edges, for example to render @supermemory/memory-graph. Pass
        nextCursor back as cursor until it is null.
      operationId: postNsByNamespaceGraph
      parameters:
        - in: path
          name: namespace
          schema:
            example: user_alex
            type: string
            maxLength: 100
            pattern: ^[a-zA-Z0-9_:-]+$
          required: true
          description: >-
            The isolated namespace. This can be an ID for your user, a project
            ID, or any other identifier you wish to use to scope documents.
        - in: query
          name: cursor
          schema:
            type: string
            minLength: 1
            maxLength: 2048
        - in: query
          name: limit
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filter:
                  $ref: '#/components/schemas/FilterExpression'
                  description: >-
                    A type-safe metadata filter predicate or nested and/or
                    expression with up to 5 levels of nesting
                sort:
                  default: createdAt
                  type: string
                  enum:
                    - createdAt
                    - updatedAt
                order:
                  default: desc
                  type: string
                  enum:
                    - asc
                    - desc
              additionalProperties: false
      responses:
        '200':
          description: Graph page retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  nodes:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            kind:
                              type: string
                              const: document
                            id:
                              type: string
                            customId:
                              type:
                                - string
                                - 'null'
                            title:
                              type:
                                - string
                                - 'null'
                            summary:
                              type:
                                - string
                                - 'null'
                            type:
                              type: string
                            namespaces:
                              type: array
                              items:
                                type: string
                            createdAt:
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                            updatedAt:
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                          required:
                            - kind
                            - id
                            - customId
                            - title
                            - summary
                            - type
                            - namespaces
                            - createdAt
                            - updatedAt
                        - type: object
                          properties:
                            kind:
                              type: string
                              const: memory
                            id:
                              type: string
                            memory:
                              type: string
                            namespace:
                              type:
                                - string
                                - 'null'
                            isStatic:
                              type: boolean
                            isLatest:
                              type: boolean
                            isForgotten:
                              type: boolean
                            isInference:
                              type: boolean
                            forgetAfter:
                              anyOf:
                                - type: string
                                  format: date-time
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                                - type: 'null'
                            forgetReason:
                              type:
                                - string
                                - 'null'
                            version:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            parentMemoryId:
                              type:
                                - string
                                - 'null'
                            rootMemoryId:
                              type:
                                - string
                                - 'null'
                            createdAt:
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                            updatedAt:
                              type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                          required:
                            - kind
                            - id
                            - memory
                            - namespace
                            - isStatic
                            - isLatest
                            - isForgotten
                            - isInference
                            - forgetAfter
                            - forgetReason
                            - version
                            - parentMemoryId
                            - rootMemoryId
                            - createdAt
                            - updatedAt
                  edges:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              const: source
                            source:
                              type: string
                            target:
                              type: string
                            sourceAddedAt:
                              anyOf:
                                - type: string
                                  format: date-time
                                  pattern: >-
                                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                                - type: 'null'
                            sourceRelevanceScore:
                              type:
                                - number
                                - 'null'
                          required:
                            - type
                            - source
                            - target
                            - sourceAddedAt
                            - sourceRelevanceScore
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - updates
                                - extends
                                - derives
                            source:
                              type: string
                            target:
                              type: string
                          required:
                            - type
                            - source
                            - target
                  nextCursor:
                    type:
                      - string
                      - 'null'
                required:
                  - nodes
                  - edges
                  - nextCursor
        '400':
          description: Invalid request or cursor
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Namespace access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    FilterExpression:
      description: >-
        A type-safe metadata filter predicate or nested and/or expression. The
        API validates up to 5 levels of nesting.
      anyOf:
        - $ref: '#/components/schemas/FilterPredicate'
        - type: object
          properties:
            operator:
              type: string
              const: and
              description: Require every nested filter expression to match
            operands:
              type: array
              minItems: 1
              maxItems: 200
              items:
                $ref: '#/components/schemas/FilterExpression'
              description: Filter expressions combined with logical AND
          required:
            - operator
            - operands
          additionalProperties: false
        - type: object
          properties:
            operator:
              type: string
              const: or
              description: Require at least one nested filter expression to match
            operands:
              type: array
              minItems: 1
              maxItems: 200
              items:
                $ref: '#/components/schemas/FilterExpression'
              description: Filter expressions combined with logical OR
          required:
            - operator
            - operands
          additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: Invalid request parameters
        details:
          type: string
          description: Additional error details
          example: Query must be at least 1 character long
      required:
        - error
    ValidationErrorResponse:
      type: object
      description: Body returned when request input fails schema validation
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: array
          description: Validation issues
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: number
            required:
              - message
        data:
          description: The input that failed validation
      required:
        - success
        - error
    FilterPredicate:
      anyOf:
        - type: object
          properties:
            field:
              type: string
              minLength: 1
              pattern: ^[a-zA-Z0-9_.-]+$
              description: >-
                Metadata key to evaluate, matched literally. A period is part of
                the key name, not a path into nested metadata.
            operator:
              type: string
              enum:
                - eq
                - neq
              description: Compare the field for equality or inequality
            value:
              type: string
              description: String value to compare against
            caseSensitive:
              default: true
              description: Whether string comparison preserves letter case
              type: boolean
          required:
            - field
            - operator
            - value
          additionalProperties: false
        - type: object
          properties:
            field:
              type: string
              minLength: 1
              pattern: ^[a-zA-Z0-9_.-]+$
              description: >-
                Metadata key to evaluate, matched literally. A period is part of
                the key name, not a path into nested metadata.
            operator:
              type: string
              enum:
                - eq
                - neq
              description: Compare the field for equality or inequality
            value:
              description: Numeric or boolean value to compare against
              type:
                - number
                - boolean
          required:
            - field
            - operator
            - value
          additionalProperties: false
        - type: object
          properties:
            field:
              type: string
              minLength: 1
              pattern: ^[a-zA-Z0-9_.-]+$
              description: >-
                Metadata key to evaluate, matched literally. A period is part of
                the key name, not a path into nested metadata.
            operator:
              type: string
              enum:
                - gt
                - gte
                - lt
                - lte
              description: Numeric comparison to apply
            value:
              type: number
              description: Numeric value to compare against
          required:
            - field
            - operator
            - value
          additionalProperties: false
        - type: object
          properties:
            field:
              type: string
              minLength: 1
              pattern: ^[a-zA-Z0-9_.-]+$
              description: >-
                Metadata key to evaluate, matched literally. A period is part of
                the key name, not a path into nested metadata.
            operator:
              type: string
              enum:
                - contains
                - notContains
              description: Require or exclude a substring match
            value:
              type: string
              description: Substring to look for
            caseSensitive:
              default: true
              description: Whether substring matching preserves letter case
              type: boolean
          required:
            - field
            - operator
            - value
          additionalProperties: false
        - type: object
          properties:
            field:
              type: string
              minLength: 1
              pattern: ^[a-zA-Z0-9_.-]+$
              description: >-
                Metadata key to evaluate, matched literally. A period is part of
                the key name, not a path into nested metadata.
            operator:
              type: string
              enum:
                - arrayContains
                - arrayNotContains
              description: Require or exclude an exact array member
            value:
              type: string
              description: Array member to look for
          required:
            - field
            - operator
            - value
          additionalProperties: false
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.