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

# Save a memory

> Save one distilled observation — a sentence or a paragraph, not raw
event logs — to the end user's memory.

Good save triggers: the user states a preference, goal, or constraint;
completes or abandons something meaningful; a conversation ends.
Saving identical content twice is a no-op (`deduped: true`).




## OpenAPI

````yaml /api/openapi.yaml post /api/v1/memories
openapi: 3.1.0
info:
  title: Conare API
  version: 1.2.0
  summary: Per-end-user memory for AI applications.
  description: >
    The Conare API gives your application a persistent, personalized

    memory layer. Production applications authenticate as an organization-owned

    Integration. Every request names an `endUserId`, and

    that end user's memory lives in its own isolated ConareDB namespace. The

    physical tenant is an opaque HMAC derived from the Integration and end-user

    ID; clients cannot select namespaces or address another tenant.


    On top of storage the API provides hybrid retrieval (vector + BM25, fused
    and

    reranked, sub-second), LLM-synthesized **deep recall**, and **proactive

    suggestions** grounded in a user's memory.


    Authentication uses a scoped server-side Integration Bearer key
    (`cint_...`).

    The secret is shown once and persisted by Conare only as a SHA-256 digest.

    Keep it in a server-side secret manager; never ship it to the browser.

    Legacy personal `cmem_...` keys remain accepted during migration.


    Every response includes `X-Request-Id`. Send a caller-generated safe value

    (1–128 characters; first alphanumeric, then `A-Za-z0-9._:-`) to correlate

    one request through the Conare edge and memory plane; otherwise Conare
    generates one. Errors use a

    stable `{ statusCode, code, message, requestId, details? }` envelope and

    never include internal tenant IDs or backend error text.
  contact:
    name: Conare
    url: https://conare.ai
    email: artem@conare.ai
servers:
  - url: https://api.conare.ai
    description: Production (dedicated partner-API host)
  - url: https://conare.ai
    description: Production (alias — same API, on the main host)
security:
  - bearerAuth: []
tags:
  - name: Integration
    description: Credential, configuration, and backend readiness.
  - name: Memories
    description: Write and search a single end user's memory.
  - name: Recall
    description: LLM-synthesized personalization primitives.
  - name: Embeddings
    description: Embed text with Conare's own retrieval embedding model.
  - name: Connectors
    description: >-
      Let end users connect any of ~200 data sources that flow into their
      memory.
  - name: Users
    description: End-user lifecycle (GDPR).
paths:
  /api/v1/memories:
    post:
      tags:
        - Memories
      summary: Save a memory
      description: |
        Save one distilled observation — a sentence or a paragraph, not raw
        event logs — to the end user's memory.

        Good save triggers: the user states a preference, goal, or constraint;
        completes or abandons something meaningful; a conversation ends.
        Saving identical content twice is a no-op (`deduped: true`).
      operationId: saveMemory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveMemoryRequest'
            examples:
              profile:
                value:
                  endUserId: u_123
                  content: >-
                    User prefers smaller islands, wants to avoid crowds. ASA 104
                    certified.
                  containerTag: profile
                  metadata:
                    source: chat
      responses:
        '200':
          description: Memory saved (or deduplicated).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaveMemoryResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    SaveMemoryRequest:
      type: object
      required:
        - endUserId
        - content
      properties:
        endUserId:
          $ref: '#/components/schemas/EndUserId'
        content:
          type: string
          minLength: 1
          description: The distilled observation to remember.
          example: User prefers smaller islands, wants to avoid crowds.
        containerTag:
          type: string
          description: |
            Optional free-form grouping label (e.g. `"profile"`, `"sessions"`).
            Omit and everything goes to `"default"`.
          example: profile
        metadata:
          type: object
          additionalProperties: true
          description: Optional arbitrary JSON stored alongside the memory.
          example:
            source: chat
    SaveMemoryResponse:
      type: object
      properties:
        success:
          type: boolean
        memory:
          $ref: '#/components/schemas/Memory'
        deduped:
          type: boolean
          description: True when identical content already existed (no-op write).
        created:
          type: boolean
          description: True when a new memory row was created.
      required:
        - success
    EndUserId:
      type: string
      pattern: ^[A-Za-z0-9@._-]{1,128}$
      minLength: 1
      maxLength: 128
      description: Your stable internal user ID. No colon allowed.
      example: u_123
    Memory:
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        container_tag:
          type: string
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        created_at:
          type: integer
          description: Unix ms.
        updated_at:
          type: integer
          description: Unix ms.
      required:
        - id
        - content
        - container_tag
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        code:
          type: string
          description: Stable snake_case machine error code.
        message:
          type: string
        requestId:
          type: string
          description: Correlates this response through Conare services and logs.
        details:
          type: object
          additionalProperties: true
      required:
        - statusCode
        - code
        - message
        - requestId
  responses:
    BadRequest:
      description: Missing or invalid fields (e.g. bad `endUserId`, empty `query`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid Bearer key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The Integration credential does not include the required operation
        scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PayloadTooLarge:
      description: |
        `content` exceeds the 65536-byte (64 KB) cap. Save distilled
        observations, not raw documents.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >
        Rate limit exceeded (reads 300/min, writes 100/min on the current plan),

        enforced atomically per (account, end user). Rate-window exhaustion
        carries

        a `Retry-After` header (seconds); `details` also has
        `retryAfterSeconds`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: The per-minute request cap for this operation.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests remaining in the current window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix-seconds timestamp when the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    RequestId:
      description: Caller-provided or generated request correlation identifier.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cint_
      description: |
        A scoped Integration key, prefixed `cint_`. Send as
        `Authorization: Bearer cint_...` on every request. Server-side only.
        Legacy personal `cmem_...` keys remain accepted during migration;
        team/org-scoped `cmem_...` keys are not valid on this API.

````