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

# Get memory trends over time

> Returns a time series of memory creation, hourly or daily (oldest
first), with summary statistics. `direction` is `up` or `down` when
the last point differs from the first by more than 10 %. Hourly
series cover at most the last 1,000 hours of the range.

Requires `ai-insights-v2:analytics` (`read`). Rate limit: 100
requests per minute.




## OpenAPI

````yaml /api-reference/ai-insights-v2/swagger.yml get /v1/analytics/memories/trends
openapi: 3.0.3
info:
  version: 1.0.0
  title: AI Insights API
  description: |
    Public REST API for the Prisme.ai AI Insights workspace - analyzed
    conversations, analysis triggering and status, evaluation criteria,
    message feedback, organization analytics, LLM consumption, memory
    analytics, and the agent relationship graph.

    **Organization scope.** Every endpoint reads and writes the data of the
    caller's organization, taken from the session (or from the org API key).
    No parameter lets a caller target another organization.

    **Permissions.** Each endpoint checks an organization IAM permission
    `ai-insights-v2:<resource>` with the action `read` or `write`
    (`manage` grants both). The resources are `conversations`, `feedback`,
    `analytics`, and `queue`; each operation states the one it requires.
    Platform admins and workspace admins are always allowed.

    **Rate limits.** Limits are counted per caller (user, or org API key)
    and per endpoint, over a sliding window. Depending on the endpoint, an
    exceeded limit returns one of two 429 bodies; both are documented on
    each operation.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:ai-insights-v2/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Insights
    description: Per-conversation analysis results and analysis status.
  - name: Agents
    description: >-
      Analysis triggering, evaluation criteria, conversations, and users of one
      agent.
  - name: Feedback
    description: Like / dislike feedback on agent messages.
  - name: Analytics
    description: Organization-wide usage, quality, latency, and adoption metrics.
  - name: Consumption
    description: LLM requests, tokens, cost, and carbon footprint, per user and over time.
  - name: Queue
    description: State of the conversation analysis queue.
  - name: Memories
    description: Analytics built from the memories users accumulate with agents.
  - name: Graph
    description: >-
      Agent relationship graph - tools, categories, delegations, similarity, and
      clusters.
paths:
  /v1/analytics/memories/trends:
    get:
      tags:
        - Memories
      summary: Get memory trends over time
      description: |
        Returns a time series of memory creation, hourly or daily (oldest
        first), with summary statistics. `direction` is `up` or `down` when
        the last point differs from the first by more than 10 %. Hourly
        series cover at most the last 1,000 hours of the range.

        Requires `ai-insights-v2:analytics` (`read`). Rate limit: 100
        requests per minute.
      operationId: getMemoryTrends
      parameters:
        - in: query
          name: period
          schema:
            type: string
            enum:
              - 24h
              - 7d
              - 30d
              - 90d
            default: 7d
          description: Sliding window ending now. Any other value uses `7d`.
        - $ref: '#/components/parameters/FromDate'
        - $ref: '#/components/parameters/ToDate'
        - in: query
          name: granularity
          schema:
            type: string
            enum:
              - hourly
              - daily
            default: daily
          description: Size of each point in the series.
        - in: query
          name: type
          schema:
            $ref: '#/components/schemas/MemoryType'
          description: >-
            When set, each point also carries `filtered_value`, the count for
            this memory type. `statistics` always use the total.
      responses:
        '200':
          description: Memory trend series.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryTrends'
        '400':
          $ref: '#/components/responses/InvalidArguments'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    FromDate:
      in: query
      name: from_date
      schema:
        type: string
        format: date-time
        maxLength: 64
      description: >-
        Start of a custom range, ISO 8601. Used only together with `to_date`,
        and then takes precedence over `period` (`period` is returned as
        `custom`).
    ToDate:
      in: query
      name: to_date
      schema:
        type: string
        format: date-time
        maxLength: 64
      description: End of a custom range, ISO 8601. Used only together with `from_date`.
  schemas:
    MemoryType:
      type: string
      enum:
        - fact
        - preference
        - relationship
        - instruction
    MemoryTrends:
      type: object
      properties:
        trends:
          type: array
          items:
            allOf:
              - type: object
                properties:
                  timestamp:
                    type: string
                    format: date-time
                  filtered_value:
                    type: integer
                    description: Count for the requested `type`, when set.
              - $ref: '#/components/schemas/MemoryCounts'
        statistics:
          type: object
          properties:
            min:
              type: integer
            max:
              type: integer
            avg:
              type: number
            total:
              type: integer
            direction:
              type: string
              enum:
                - up
                - down
                - stable
            change_pct:
              type: number
              description: Change between the first and last points, in percent.
        metadata:
          type: object
          properties:
            orgSlug:
              type: string
            granularity:
              type: string
              enum:
                - hourly
                - daily
            period:
              type: string
              description: The `period` sent (or `7d`), or `custom`.
            type_filter:
              type: string
            start_time:
              type: string
              format: date-time
            end_time:
              type: string
              format: date-time
            generated_at:
              type: string
              format: date-time
    MemoryCounts:
      type: object
      properties:
        total:
          type: integer
        fact:
          type: integer
        preference:
          type: integer
        relationship:
          type: integer
        instruction:
          type: integer
        unique_users:
          type: integer
          nullable: true
    RuntimeError:
      type: object
      description: Error raised by the Prisme.ai runtime before the endpoint logic runs.
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Error code (e.g. `FORBIDDEN`), or error message on some validation
            errors.
        message:
          type: string
          description: Human-readable message.
  responses:
    InvalidArguments:
      description: >-
        A parameter does not match its schema (length, pattern, type, or
        required field).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RuntimeError'
          example:
            error: InvalidArgumentsError
            message: Invalid arguments
            details:
              errors: []
    Unauthenticated:
      description: Missing or invalid credentials, or no organization context.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAUTHORIZED
            message: Authentication required
    Forbidden:
      description: The caller lacks the permission required by the endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: FORBIDDEN
            message: 'Access denied: missing permission ''ai-insights-v2:analytics:read'''
    TooManyRequests:
      description: >-
        Rate limit exceeded. Retry after the number of seconds given in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RuntimeError'
          example:
            error: TooManyRequests
            message: Too many requests for 'Insights'
            details:
              name: Insights
              ok: false
              retryAfter: 42.5
              limit: 100
              window: 60
              remaining: 0
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`. The organization and the
        permissions applied are those of this user.
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`), managed from the
        AI Governance UI. It is not tied to a user: its access is defined by
        the permissions attached to it, and all keys of an organization share
        the same rate-limit counters. Endpoints that describe "your own"
        data, such as `GET /v1/users/{user_id}`, need a user credential.
        Send as `x-prismeai-api-key: iak_...`.

````

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