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

# Store a memory (fact, event, document, note, profile, chunk).



## OpenAPI

````yaml api-reference/flumes.yaml post /v0/memories
openapi: 3.1.0
info:
  title: Flumes Memory API (MVP)
  version: 0.9.2
  description: >
    Unified memory + context assembly for LLM agents.

    Core endpoints: /v0/context/assemble, /v0/memories, /v0/recall,
    /v0/summarize, /v0/prune, /v0/observability/events.

    Private endpoints (not for SDKs): /v0/extract, /v0/memories:batch_upsert.
servers:
  - url: https://api.flumes.ai
    description: Production
  - url: https://staging.api.flumes.ai
    description: Staging
security:
  - bearerAuth: []
paths:
  /v0/memories:
    post:
      tags:
        - Memories
      summary: Store a memory (fact, event, document, note, profile, chunk).
      operationId: createMemory
      parameters:
        - $ref: '#/components/parameters/AgentHeader'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Memory'
      responses:
        '200':
          description: Stored
          headers:
            X-Request-Id:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: integer
            X-RateLimit-Reset:
              schema:
                type: integer
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  memory_id:
                    type: string
                  embedding_indexed:
                    type: boolean
                  cost:
                    $ref: '#/components/schemas/Cost'
                  request_id:
                    type: string
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '409':
          $ref: '#/components/responses/ErrorResponse'
        '422':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    AgentHeader:
      name: X-Flumes-Agent
      in: header
      required: false
      schema:
        type: string
        maxLength: 128
      description: Agent id within the org.
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        maxLength: 128
      description: Idempotency key for safe retries (unique per org).
  schemas:
    Memory:
      type: object
      description: >-
        Base memory record (open-world). Write requests ignore org fields; org
        is taken from header.
      properties:
        memory_id:
          type: string
          readOnly: true
        org_id:
          type: string
          readOnly: true
        namespace:
          type: string
          default: default
          maxLength: 64
        agent_id:
          type: string
          nullable: true
        entity_id:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - fact
            - event
            - document
            - note
            - profile
            - chunk
        text:
          type: string
          description: >-
            Human-readable content; for facts, this is a rendered form of
            subject/predicate/object.
          maxLength: 20000
        metadata:
          type: object
          additionalProperties: true
        tags:
          type: array
          items:
            type: string
            maxLength: 64
        timestamp:
          type: string
          format: date-time
        archived:
          type: boolean
          default: false
        sensitivity:
          type: string
          enum:
            - none
            - pii
            - auto
          default: auto
        subject:
          type: string
          nullable: true
          description: Entity id like ent:user_42
        predicate:
          type: string
          nullable: true
          maxLength: 128
        object:
          oneOf:
            - type: string
              maxLength: 4000
            - type: number
            - type: boolean
            - type: object
              additionalProperties: true
            - type: 'null'
        object_type:
          type: string
          enum:
            - literal
            - string
            - number
            - date
            - json
            - entity
          nullable: true
        unit:
          type: string
          nullable: true
          maxLength: 32
        keys:
          type: array
          items:
            type: string
            maxLength: 128
          nullable: true
          description: Conflict keys for supersession.
        valid_from:
          type: string
          format: date-time
          nullable: true
        valid_to:
          type: string
          format: date-time
          nullable: true
        confidence:
          type: number
          minimum: 0
          maximum: 1
          nullable: true
        status:
          type: string
          enum:
            - active
            - superseded
            - disputed
          default: active
        provenance:
          type: object
          additionalProperties: true
          description: 'Source info; e.g., { source_turn: memory_id }'
      required:
        - type
        - namespace
        - text
    Cost:
      type: object
      properties:
        input_tokens:
          type: integer
          default: 0
        embedding:
          type: integer
          default: 0
        llm_tokens:
          type: integer
          default: 0
        retrieval_ops:
          type: integer
          default: 0
    Error:
      type: object
      properties:
        error:
          type: string
          examples:
            - unauthorized
            - validation_error
            - rate_limited
            - conflict
        message:
          type: string
        request_id:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    ErrorResponse:
      description: Error envelope
      headers:
        X-Request-Id:
          schema:
            type: string
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
            description: UTC seconds until limit resets
        Access-Control-Allow-Origin:
          schema:
            type: string
          description: Present if CORS enabled
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIKey

````