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

# Remember: ingest data and build the knowledge graph (add + cognify + improve)

> Ingest data and build the knowledge graph in a single call.

This endpoint combines the add and cognify steps. Data is ingested
first, then automatically processed into a structured knowledge graph.

## Request Parameters
- **data** (List[UploadFile]): Files to upload and process.
- **raw_data** (Optional[List[str]]): String inputs, one entry each: raw text, a
  local file or directory path on the server (requires ACCEPT_LOCAL_FILE_PATH), a
  web URL fetched as a page (requires ALLOW_HTTP_REQUESTS), or a GitHub/GitLab
  repository URL, shallow-cloned and indexed as a code graph. Uploads come first,
  then raw_data entries; labels and external_metadata pair with that combined
  order. Normal ingestion only — rejected with content_type. At least one of data
  or raw_data is required for normal ingestion.
- **labels** (Optional[str]): JSON array of per-file labels, e.g.
  ["finance", "people", ""], paired positionally with the uploaded files (one
  entry per file; an empty entry skips that file). Stored on each file's data
  record. Normal ingestion only — rejected with session_id or content_type.
- **external_metadata** (Optional[str]): JSON array of per-file metadata objects,
  e.g. [\{"source": "crm"\}, null], paired positionally with the uploaded files
  (one entry per file; null or \{\} skips that file). Merged into each file's
  stored external_metadata. Normal ingestion only — rejected with session_id
  or content_type.
- **datasetName** (Optional[str]): Name of the target dataset.
- **datasetId** (Optional[UUID]): UUID of an existing dataset.
- **session_id** (Optional[str]): Session to attribute this memory to. When set,
  data is stored in the session cache and bridged into the permanent graph in the
  background; the session is tracked in the sessions dashboard. When omitted,
  data is ingested directly via add + cognify.
- **node_set** (Optional[List[str]]): Node identifiers for graph organisation.
- **run_in_background** (Optional[bool]): Run the cognify step asynchronously (default: False).
- **self_improvement** (Optional[bool]): Run the improve loop after cognify
  (default: True). False gives a plain add + cognify ingestion.
- **custom_prompt** (Optional[str]): Custom prompt for entity extraction.
- **chunk_size** (Optional[int]): Maximum tokens per chunk (default: 4096).
- **chunks_per_batch** (Optional[int]): Chunks per cognify batch.
- **ontology_key** (Optional[List[str]]): Reference to one or more previously uploaded ontology files to use for knowledge graph construction.
- **graph_model** (Optional[str]): JSON-serialised graph model schema (same dict format accepted by the cognify endpoint).
- **content_type** (Optional[str]): Set to "skills" to ingest SKILL.md files as
  Skill nodes, or "code" to index whole repositories — each raw_data entry is
  then a git URL or server-local repo path and one code graph is built per
  entry (poll progress via GET /v1/datasets/status?pipeline=code_graph_pipeline);
  omit for normal ingestion.
- **index_vectors** (Optional[bool]): content_type="code" only — also embed the
  extracted code facts for semantic retrievers (default false, no LLM/embedding
  calls otherwise).

Either datasetName or datasetId must be provided.
- **import_mode** (Optional[str]): COGX archive imports only: 'preserve' (default),
  'hybrid', or 're-derive'.
- **skill_name** (Optional[str]): content_type='skills' + skills_text only: name/slug for
  the inline skill (defaults to 'skill').
- **skills_text** (Optional[str]): content_type='skills' only: inline SKILL.md markdown to
  ingest without a file upload (no-code path). When set and no files are uploaded, it is
  written to a temporary SKILL.md and ingested via the normal skills pipeline. Pair with
  skill_name to control the resulting skill name.

## Error Codes
- **400 Bad Request**: Neither datasetId nor datasetName provided, unsupported
  content_type, invalid graph_model JSON/schema, or invalid code-ingestion
  combination (no raw_data repository specs, file uploads or session_id with
  content_type="code", index_vectors without it, or local repo paths while
  ACCEPT_LOCAL_FILE_PATH=false)
- **409 Conflict**: Error during processing



## OpenAPI

````yaml /cognee_openapi_spec.json post /api/v1/remember
openapi: 3.1.0
info:
  title: Cognee API
  description: Cognee API with Bearer token and Cookie auth
  version: 1.0.0
servers:
  - url: https://{tenant}.aws.cognee.ai
    description: 'Cognee Cloud: your tenant pod, named in the platform.cognee.ai dashboard'
    variables:
      tenant:
        default: your-tenant
        description: Your tenant name, shown in the Cognee Cloud dashboard
  - url: http://localhost:8000
    description: 'Self-hosted: a locally running cognee server'
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: activity
    description: >-
      Activity endpoints for inspecting pipeline runs, traced spans, tenant
      users, agents, and dataset exports.
  - name: add
    description: Data ingestion endpoints for adding text, files, and structured data.
  - name: agent connections
    description: >-
      Endpoints for registering, unregistering, and inspecting agent connections
      to the instance.
  - name: agent management
    description: Endpoints for creating, listing, retrieving, and deleting agents.
  - name: auth
    description: >-
      Authentication endpoints for user registration, login, and token
      management.
  - name: checks
    description: >-
      Diagnostic endpoint for validating a Cognee Cloud API key supplied in the
      X-Api-Key header.
  - name: cognify
    description: >-
      Knowledge processing endpoints to transform raw data into knowledge
      graphs.
  - name: configuration
    description: >-
      Endpoints for storing, retrieving, and listing a user's saved
      configurations.
  - name: datasets
    description: Dataset management endpoints for listing, creating, and deleting datasets.
  - name: delete
    description: Data deletion endpoints (deprecated — use datasets endpoints instead).
  - name: forget
    description: Endpoint for removing data from the knowledge graph.
  - name: health
    description: Liveness, readiness, and component health checks.
  - name: improve
    description: Endpoint for enriching and improving an existing knowledge graph.
  - name: integrations
    description: >-
      Endpoints for connecting, provisioning, and disconnecting OAuth providers
      and plugins.
  - name: llm
    description: >-
      LLM-backed endpoints for inferring graph schemas and generating custom
      extraction prompts.
  - name: memify
    description: >-
      Endpoint for running enrichment pipelines over existing graphs or supplied
      data.
  - name: ontologies
    description: >-
      Endpoints for uploading, listing, and deleting ontology files used during
      cognify.
  - name: permissions
    description: Permission management for multi-user access control.
  - name: recall
    description: >-
      Endpoints for querying the knowledge graph and reviewing past recall
      history.
  - name: remember
    description: >-
      Endpoints for ingesting data into the knowledge graph and storing session
      memory entries.
  - name: responses
    description: Response generation endpoints using the knowledge graph.
  - name: schema
    description: >-
      Schema inspection endpoints for a dataset's derived schema inventory and
      the caller-wide memory provenance graph.
  - name: search
    description: Search endpoints for querying the knowledge graph.
  - name: sessions
    description: >-
      Endpoints for listing sessions and reporting usage, cost, and token
      statistics.
  - name: settings
    description: Configuration endpoints for managing Cognee settings.
  - name: skills
    description: >-
      Skill management endpoints for ingesting, listing, retrieving, and
      deleting dataset skills, plus read-only retrieval of improvement
      proposals.
  - name: slack
    description: >-
      Endpoints for listing workspace channels, setting channel allowlists, and
      linking Slack accounts.
  - name: sync
    description: Endpoints for syncing local data to Cognee Cloud and checking sync status.
  - name: update
    description: Endpoint for updating existing data in a dataset.
  - name: users
    description: User management endpoints.
  - name: validate
    description: >-
      Diagnostic endpoint for checking consistency between a dataset's graph and
      vector stores.
  - name: visualize
    description: Graph visualization endpoints.
paths:
  /api/v1/remember:
    post:
      tags:
        - remember
      summary: >-
        Remember: ingest data and build the knowledge graph (add + cognify +
        improve)
      description: >-
        Ingest data and build the knowledge graph in a single call.


        This endpoint combines the add and cognify steps. Data is ingested

        first, then automatically processed into a structured knowledge graph.


        ## Request Parameters

        - **data** (List[UploadFile]): Files to upload and process.

        - **raw_data** (Optional[List[str]]): String inputs, one entry each: raw
        text, a
          local file or directory path on the server (requires ACCEPT_LOCAL_FILE_PATH), a
          web URL fetched as a page (requires ALLOW_HTTP_REQUESTS), or a GitHub/GitLab
          repository URL, shallow-cloned and indexed as a code graph. Uploads come first,
          then raw_data entries; labels and external_metadata pair with that combined
          order. Normal ingestion only — rejected with content_type. At least one of data
          or raw_data is required for normal ingestion.
        - **labels** (Optional[str]): JSON array of per-file labels, e.g.
          ["finance", "people", ""], paired positionally with the uploaded files (one
          entry per file; an empty entry skips that file). Stored on each file's data
          record. Normal ingestion only — rejected with session_id or content_type.
        - **external_metadata** (Optional[str]): JSON array of per-file metadata
        objects,
          e.g. [\{"source": "crm"\}, null], paired positionally with the uploaded files
          (one entry per file; null or \{\} skips that file). Merged into each file's
          stored external_metadata. Normal ingestion only — rejected with session_id
          or content_type.
        - **datasetName** (Optional[str]): Name of the target dataset.

        - **datasetId** (Optional[UUID]): UUID of an existing dataset.

        - **session_id** (Optional[str]): Session to attribute this memory to.
        When set,
          data is stored in the session cache and bridged into the permanent graph in the
          background; the session is tracked in the sessions dashboard. When omitted,
          data is ingested directly via add + cognify.
        - **node_set** (Optional[List[str]]): Node identifiers for graph
        organisation.

        - **run_in_background** (Optional[bool]): Run the cognify step
        asynchronously (default: False).

        - **self_improvement** (Optional[bool]): Run the improve loop after
        cognify
          (default: True). False gives a plain add + cognify ingestion.
        - **custom_prompt** (Optional[str]): Custom prompt for entity
        extraction.

        - **chunk_size** (Optional[int]): Maximum tokens per chunk (default:
        4096).

        - **chunks_per_batch** (Optional[int]): Chunks per cognify batch.

        - **ontology_key** (Optional[List[str]]): Reference to one or more
        previously uploaded ontology files to use for knowledge graph
        construction.

        - **graph_model** (Optional[str]): JSON-serialised graph model schema
        (same dict format accepted by the cognify endpoint).

        - **content_type** (Optional[str]): Set to "skills" to ingest SKILL.md
        files as
          Skill nodes, or "code" to index whole repositories — each raw_data entry is
          then a git URL or server-local repo path and one code graph is built per
          entry (poll progress via GET /v1/datasets/status?pipeline=code_graph_pipeline);
          omit for normal ingestion.
        - **index_vectors** (Optional[bool]): content_type="code" only — also
        embed the
          extracted code facts for semantic retrievers (default false, no LLM/embedding
          calls otherwise).

        Either datasetName or datasetId must be provided.

        - **import_mode** (Optional[str]): COGX archive imports only: 'preserve'
        (default),
          'hybrid', or 're-derive'.
        - **skill_name** (Optional[str]): content_type='skills' + skills_text
        only: name/slug for
          the inline skill (defaults to 'skill').
        - **skills_text** (Optional[str]): content_type='skills' only: inline
        SKILL.md markdown to
          ingest without a file upload (no-code path). When set and no files are uploaded, it is
          written to a temporary SKILL.md and ingested via the normal skills pipeline. Pair with
          skill_name to control the resulting skill name.

        ## Error Codes

        - **400 Bad Request**: Neither datasetId nor datasetName provided,
        unsupported
          content_type, invalid graph_model JSON/schema, or invalid code-ingestion
          combination (no raw_data repository specs, file uploads or session_id with
          content_type="code", index_vectors without it, or local repo paths while
          ACCEPT_LOCAL_FILE_PATH=false)
        - **409 Conflict**: Error during processing
      operationId: remember_api_v1_remember_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_remember_api_v1_remember_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Remember Api V1 Remember Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    Body_remember_api_v1_remember_post:
      properties:
        data:
          items:
            type: string
            format: binary
          type: array
          title: Data
        raw_data:
          anyOf:
            - items:
                type: string
                example: ''
              type: array
            - type: 'null'
          title: Raw Data
          description: >-
            Data given as strings instead of uploads, one entry each: raw text
            to remember, a local file or directory path on the server's
            filesystem (requires ACCEPT_LOCAL_FILE_PATH), a web URL to fetch
            (requires ALLOW_HTTP_REQUESTS), or a GitHub/GitLab repository URL,
            which is shallow-cloned and indexed as a code graph. Combined with
            'data': uploads come first, then these entries; labels and
            external_metadata pair with that combined order. Empty entries are
            ignored. With content_type='code' every entry is a repository spec
            (git URL or server-local repo path) and one code graph is built per
            entry; rejected with content_type='skills' or 'cogx-archive', which
            take file uploads.
          examples:
            - []
        labels:
          anyOf:
            - type: string
            - type: 'null'
          title: Labels
          description: >-
            Per-file labels, e.g. ["finance", "people", ""] — the Nth label
            applies to the Nth uploaded file, one entry per file, an empty entry
            skips that file. The comma-separated form "finance,people," is
            accepted equivalently (it is what Swagger UI sends when you type a
            JSON array here), so labels cannot contain commas unless the client
            sends real JSON. Stored on each file's data record and returned when
            listing dataset data. Only supported for normal ingestion — rejected
            when combined with session_id or content_type.
          examples:
            - ''
        external_metadata:
          anyOf:
            - type: string
            - type: 'null'
          title: External Metadata
          description: >-
            JSON array of per-file metadata objects, e.g. [\{"source": "crm",
            "ticket": 42\}, null]. Paired positionally like labels: the Nth
            entry applies to the Nth uploaded file (null or \{\} skips that
            file), and one entry per file is required when any is given. Merged
            into the file's stored external_metadata (your keys win over
            loader-derived ones; 'node_set' is reserved). Only supported for
            normal ingestion — rejected when combined with session_id or
            content_type.
          examples:
            - ''
        datasetName:
          anyOf:
            - type: string
            - type: 'null'
          title: Datasetname
          description: >-
            Name of the target dataset (created if it does not exist). Required
            unless datasetId is provided.
          examples:
            - default_dataset
        datasetId:
          anyOf:
            - type: string
              format: uuid
            - type: string
              const: ''
            - type: 'null'
          title: Datasetid
          examples:
            - ''
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: >-
            Session to attribute this memory to (e.g. claude-code-1718000000).
            When set, the data is stored in the session cache (and bridged into
            the permanent graph in the background) and the session appears in
            the sessions dashboard. Leave empty for a direct add+cognify.
          examples:
            - ''
        node_set:
          anyOf:
            - items:
                type: string
                example: ''
              type: array
            - type: 'null'
          title: Node Set
          description: >-
            Tags the ingested data with named node sets (e.g. per-agent or
            per-project groups). Extracted graph nodes are linked to these sets,
            and recall/search can later be restricted to them via their
            node_name parameter. Leave empty to skip tagging.
          examples:
            - []
        run_in_background:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Run In Background
          description: >-
            If true, the request returns immediately (status 'running' with a
            pipeline_run_id) while ingestion and graph building continue
            server-side — poll GET /v1/datasets/status to track completion. If
            false, the request blocks until the knowledge graph is fully built,
            which can take minutes for large files.
          default: false
        self_improvement:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Self Improvement
          description: >-
            Run the self-improvement loop (improve) after the knowledge graph is
            built: triplet enrichment and, for session-backed data, the session
            bridge. Set to false for a plain add + cognify ingestion. Ignored
            with session_id.
          default: true
        custom_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Prompt
          description: >-
            Replaces the default entity-extraction prompt used during graph
            building. Use it to steer which entities and relationships get
            extracted (e.g. focus on technical concepts, people, or contracts).
            Leave empty for the default prompt.
          default: ''
        chunk_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chunk Size
          description: >-
            Maximum tokens per text chunk during ingestion (default: 4096). Each
            chunk is processed by the LLM separately for entity extraction:
            larger chunks give more context per extraction but fewer, coarser
            passes; smaller chunks give finer-grained extraction at higher LLM
            cost.
          default: 4096
        chunks_per_batch:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chunks Per Batch
          description: >-
            Number of chunks processed per cognify task batch (default: 36).
            Controls ingestion parallelism/throughput; rarely needs changing.
          default: 36
        ontology_key:
          anyOf:
            - items:
                type: string
                example: ''
              type: array
            - type: 'null'
          title: Ontology Key
          description: >-
            Keys of previously uploaded ontologies (see /v1/ontologies) to
            ground entity extraction. Leave empty to ingest without an ontology.
          examples:
            - []
        graph_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Graph Model
          description: >-
            JSON-serialised graph model schema (same format as the cognify
            endpoint), e.g. \{"title": "CompanyGraph", "type": "object",
            "properties": \{...\}\}. Must include a top-level 'title' key. Leave
            empty to use the default KnowledgeGraph model — a restrictive schema
            here can produce an empty graph. Invalid JSON or an unconvertible
            schema is rejected with 400.
          examples:
            - ''
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
          description: >-
            Set to 'skills' to ingest SKILL.md files as dataset-scoped Skill
            nodes, or 'code' to index whole code repositories (pass git URLs or
            server-local repo paths via 'raw_data') as an architectural code
            graph through the enola-backed pipeline. Leave empty for normal
            ingestion.
          examples:
            - ''
        import_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Import Mode
          description: >-
            COGX archive imports only: 'preserve' (default), 'hybrid', or
            're-derive'.
          examples:
            - ''
        skills_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Skills Text
          description: >-
            content_type='skills' only: inline SKILL.md markdown to ingest
            without a file upload (no-code path). When set and no files are
            uploaded, it is written to a temporary SKILL.md and ingested via the
            normal skills pipeline. Pair with skill_name to control the
            resulting skill name.
          examples:
            - ''
        skill_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Skill Name
          description: >-
            content_type='skills' + skills_text only: name/slug for the inline
            skill (defaults to 'skill').
          examples:
            - ''
        index_vectors:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Index Vectors
          description: >-
            content_type='code' only: also embed the extracted code facts so
            semantic/completion retrievers can see them (requires an embedding
            provider). Default false — the code graph pipeline is deterministic
            and makes no LLM or embedding calls, and SearchType.CODE uses graph
            indexes only.
          default: false
      type: object
      title: Body_remember_api_v1_remember_post
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````