Raku Memories API

The memories API from Raku — 3 operation(s) for memories.

GitHub OpenAPI

Operations 6

POST /api/v1/memories/ Create Memory #
GET /api/v1/memories/ List Memories #
POST /api/v1/memories/retain Retain Memory #
GET /api/v1/memories/{memory_id} Get Memory #
PUT /api/v1/memories/{memory_id} Update Memory #
DELETE /api/v1/memories/{memory_id} Delete Memory #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/raku-so:raku-so-memories-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

raku-so-memories-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Raku So Memories API
  version: 0.1.0
  description: 'Operations tagged memories across 2 of this provider''s published API definitions: openapi.json, raku-so-openapi.json. Each path carries the servers of the definition it was published in.'
tags:
- name: Memories
paths:
  /api/v1/memories/:
    post:
      tags:
      - Memories
      summary: Create Memory
      description: 'Create a memory with server-side embedding (ADR-10 graceful degradation).


        The happy path computes the embedding and stores it. On a TRANSIENT embedding

        failure (OpenAI down / circuit open) the memory is still stored with

        `embedding = NULL, needs_embedding = 1` and the response carries

        `pipeline_status.embedding = "deferred"` — the backfill worker computes the

        vector later (RKU-65 §5). A persistence failure is the one hard-fail: 503 +

        `Retry-After` (§5.1, §7.3). Returns 409 if the tenant hit the memory limit.'
      operationId: create_memory_api_v1_memories__post
      security:
      - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryWriteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Memories
      summary: List Memories
      description: 'List memories with pagination and optional filters.


        Only currently-valid memories (is_current = 1) are returned — soft-closed

        rows are accessible via GET /memories/{id} but not via list or search.'
      operationId: list_memories_api_v1_memories__get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 200
          minimum: 1
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: memory_type
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/MemoryType'
          - type: 'null'
          title: Memory Type
      - name: tag
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Tag
      - name: created_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Created After
      - name: created_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Created Before
      - name: sort_by
        in: query
        required: false
        schema:
          type: string
          pattern: ^(created_at|importance|last_accessed)$
          default: created_at
          title: Sort By
      - name: sort_order
        in: query
        required: false
        schema:
          type: string
          pattern: ^(asc|desc)$
          default: desc
          title: Sort Order
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/memories/retain:
    post:
      tags:
      - Memories
      summary: Retain Memory
      description: 'Retain a memory through the full 8-step pipeline (Memory Engine v2.0).


        ADMIT → EMBED → SCORE IMPORTANCE → ASSIGN CONFIDENCE → EXTRACT ENTITIES →

        CONSOLIDATE → RESOLVE CONFLICTS (real since R2.63 sub-build 4; spec slug

        628069ab72e8). Admission may reject/deduplicate without storing — that is a

        200 with ``memory: null`` and ``admission_decision``. External-step failures

        degrade gracefully (ADR-10); only a libSQL persistence failure is a hard

        fail → 503 + Retry-After (RKU-65 §5.1, §7.3).'
      operationId: retain_memory_api_v1_memories_retain_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetainResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/memories/{memory_id}:
    get:
      tags:
      - Memories
      summary: Get Memory
      description: Get a single memory by ID. Updates access tracking.
      operationId: get_memory_api_v1_memories__memory_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: memory_id
        in: path
        required: true
        schema:
          type: string
          title: Memory Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - Memories
      summary: Update Memory
      description: Update a memory. Re-embeds only if content changes.
      operationId: update_memory_api_v1_memories__memory_id__put
      security:
      - HTTPBearer: []
      parameters:
      - name: memory_id
        in: path
        required: true
        schema:
          type: string
          title: Memory Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Memories
      summary: Delete Memory
      description: 'Soft-close a memory — never deletes, always preserves history.


        Sets valid_to = tx_to = now and is_current = 0. The row remains readable

        by ID via GET /memories/{id} (history access) but is filtered out of

        list and search responses. Hard delete is a Phase 2 admin endpoint.


        Returns 404 if the memory is already soft-closed (is_current = 0) — we

        treat a double-delete the same as deleting a nonexistent row rather

        than re-closing an already-closed row, so clients get a consistent

        404 signal either way.'
      operationId: delete_memory_api_v1_memories__memory_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: memory_id
        in: path
        required: true
        schema:
          type: string
          title: Memory Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ResolvedEntity:
      properties:
        id:
          type: string
          title: Id
        text:
          type: string
          title: Text
        entity_type:
          type: string
          title: Entity Type
        confidence:
          type: number
          title: Confidence
        is_new:
          type: boolean
          title: Is New
      type: object
      required:
      - id
      - text
      - entity_type
      - confidence
      - is_new
      title: ResolvedEntity
      description: Entity resolved against the entity table.
    RetainResponse:
      properties:
        memory:
          anyOf:
          - $ref: '#/components/schemas/MemoryResponse'
          - type: 'null'
        admission_decision:
          $ref: '#/components/schemas/AdmissionDecision'
        pipeline_status:
          $ref: '#/components/schemas/PipelineStatus'
        entities_extracted:
          items:
            $ref: '#/components/schemas/ResolvedEntity'
          type: array
          title: Entities Extracted
          default: []
        relationships_extracted:
          items:
            $ref: '#/components/schemas/ResolvedRelationship'
          type: array
          title: Relationships Extracted
          default: []
        contradictions:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Contradictions
          default: []
        consolidated_from:
          items:
            type: string
          type: array
          title: Consolidated From
          default: []
        flagged_conflicts:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Flagged Conflicts
          default: []
        pipeline:
          $ref: '#/components/schemas/PipelineTiming'
      type: object
      required:
      - memory
      - admission_decision
      - pipeline_status
      - pipeline
      title: RetainResponse
      description: 'POST /memories/retain response — the full 8-step Retain pipeline outcome.


        `memory` is null when the ADMIT step rejects or deduplicates (nothing

        stored). On admission it carries the stored memory plus the per-step

        pipeline status, the extracted knowledge-graph slice, and timing.


        `contradictions` / `consolidated_from` / `flagged_conflicts` are populated

        since R2.63 (sub-build 4): CONSOLIDATE + RESOLVE CONFLICTS are real —

        contradictions rows follow the spec shape {superseded_memory_id, decision,

        merged_content, explanation}; flagged_conflicts rows are {memory_id,

        explanation}; consolidated_from lists sources merged away by step 6.'
    MemoryCreate:
      properties:
        content:
          type: string
          maxLength: 50000
          minLength: 1
          title: Content
          description: Memory content text
        source:
          anyOf:
          - type: string
            maxLength: 500
          - type: 'null'
          title: Source
          description: Where this memory came from
        memory_type:
          $ref: '#/components/schemas/MemoryType'
          default: fact
        importance:
          type: number
          maximum: 1.0
          minimum: 0.0
          title: Importance
          description: Importance score 0-1
          default: 0.5
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
          description: Arbitrary JSON metadata
        tags:
          items:
            type: string
          type: array
          maxItems: 20
          title: Tags
          description: Max 20 tags
        confidence_score:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Confidence Score
        source_type:
          anyOf:
          - $ref: '#/components/schemas/SourceType'
          - type: 'null'
        evidence_count:
          type: integer
          minimum: 0.0
          title: Evidence Count
          default: 0
        contradiction_count:
          type: integer
          minimum: 0.0
          title: Contradiction Count
          default: 0
        confidence_decay_rate:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Confidence Decay Rate
        last_validated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Validated At
          description: 'ISO-8601: last confidence review'
        valid_from:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid From
          description: 'ISO-8601: when this fact became true'
        valid_to:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid To
          description: 'ISO-8601: when this fact stopped being true'
      type: object
      required:
      - content
      title: MemoryCreate
      description: "Create a new memory. Embedding generated server-side.\n\nInvariants:\n    - content is required and must be 1-50,000 characters\n    - tags are normalised to lowercase and stripped of whitespace\n    - metadata JSON must not exceed 10,000 characters\n    - importance must be between 0.0 and 1.0"
    SourceType:
      type: string
      enum:
      - direct_data
      - user_stated
      - system_observed
      - inference
      - hearsay
      - speculation
      - corrected
      - external_api
      - derived
      title: SourceType
      description: 'Confidence source classification (v3.3).


        Classifies how a memory was obtained, informing confidence scoring.

        Ordering roughly tracks epistemic strength: direct_data and user_stated

        are high-trust; speculation and hearsay are low-trust.'
    PipelineStatus:
      properties:
        embedding:
          $ref: '#/components/schemas/StepStatus'
        importance:
          $ref: '#/components/schemas/StepStatus'
        entities:
          $ref: '#/components/schemas/StepStatus'
        consolidation:
          $ref: '#/components/schemas/StepStatus'
        conflicts:
          $ref: '#/components/schemas/StepStatus'
      type: object
      required:
      - embedding
      - importance
      - entities
      - consolidation
      - conflicts
      title: PipelineStatus
      description: Outcome of each write-pipeline step (RKU-65 §7.4).
    MemoryResponse:
      properties:
        id:
          type: string
          title: Id
        content:
          type: string
          title: Content
        source:
          anyOf:
          - type: string
          - type: 'null'
          title: Source
        memory_type:
          type: string
          title: Memory Type
        importance:
          type: number
          title: Importance
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        last_accessed:
          type: string
          title: Last Accessed
        access_count:
          type: integer
          title: Access Count
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        confidence_score:
          anyOf:
          - type: number
          - type: 'null'
          title: Confidence Score
        source_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Source Type
        evidence_count:
          type: integer
          title: Evidence Count
          default: 0
        contradiction_count:
          type: integer
          title: Contradiction Count
          default: 0
        confidence_decay_rate:
          anyOf:
          - type: number
          - type: 'null'
          title: Confidence Decay Rate
        last_validated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Validated At
        valid_from:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid From
        valid_to:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid To
        tx_from:
          anyOf:
          - type: string
          - type: 'null'
          title: Tx From
        tx_to:
          anyOf:
          - type: string
          - type: 'null'
          title: Tx To
        superseded_by:
          anyOf:
          - type: string
          - type: 'null'
          title: Superseded By
        is_current:
          type: boolean
          title: Is Current
          default: true
      type: object
      required:
      - id
      - content
      - memory_type
      - importance
      - created_at
      - updated_at
      - last_accessed
      - access_count
      title: MemoryResponse
      description: "API response for a single memory.\n\nEXCLUDED always (never add these fields):\n    - embedding vector (RAKU-3 — can be reverse-engineered)\n    - tenant_id (OWASP-MT §3 — no cross-tenant data)\n    - raw metadata (may contain sensitive data)"
    MemoryUpdate:
      properties:
        content:
          anyOf:
          - type: string
            maxLength: 50000
            minLength: 1
          - type: 'null'
          title: Content
        source:
          anyOf:
          - type: string
            maxLength: 500
          - type: 'null'
          title: Source
        memory_type:
          anyOf:
          - $ref: '#/components/schemas/MemoryType'
          - type: 'null'
        importance:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Importance
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
        tags:
          anyOf:
          - items:
              type: string
            type: array
            maxItems: 20
          - type: 'null'
          title: Tags
        confidence_score:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Confidence Score
        source_type:
          anyOf:
          - $ref: '#/components/schemas/SourceType'
          - type: 'null'
        evidence_count:
          anyOf:
          - type: integer
            minimum: 0.0
          - type: 'null'
          title: Evidence Count
        contradiction_count:
          anyOf:
          - type: integer
            minimum: 0.0
          - type: 'null'
          title: Contradiction Count
        confidence_decay_rate:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Confidence Decay Rate
        last_validated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Validated At
        valid_from:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid From
        valid_to:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid To
          description: 'ISO-8601: when this fact stopped being true'
        superseded_by:
          anyOf:
          - type: string
          - type: 'null'
          title: Superseded By
          description: ID of the memory that replaces this one
      type: object
      title: MemoryUpdate
      description: 'Partial update for a memory.


        Only provided fields are updated. If content changes, embedding is

        regenerated server-side. If content is not provided, embedding is

        NOT regenerated.'
    ResolvedRelationship:
      properties:
        id:
          type: string
          title: Id
        source_entity_id:
          type: string
          title: Source Entity Id
        target_entity_id:
          type: string
          title: Target Entity Id
        relationship_type:
          type: string
          title: Relationship Type
        confidence:
          type: number
          title: Confidence
      type: object
      required:
      - id
      - source_entity_id
      - target_entity_id
      - relationship_type
      - confidence
      title: ResolvedRelationship
      description: Relationship with resolved entity IDs.
    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
    AdmissionDecision:
      type: string
      enum:
      - admitted
      - rejected
      - deduplicated
      - merged
      title: AdmissionDecision
      description: 'Outcome of the ADMIT step (Retain pipeline step 1).


        `MERGED` is emitted since R2.63 (sub-build 4): the CONSOLIDATE step

        synthesized the new memory with existing fragments — the response carries

        the merged memory and `consolidated_from` lists the soft-closed sources.'
    MemoryType:
      type: string
      enum:
      - fact
      - event
      - preference
      - procedure
      - insight
      title: MemoryType
      description: "Types of memory that can be stored.\n\nv2.0 taxonomy (migration 005):\n    observation → event, reflection → insight, instruction → procedure.\n    fact and preference unchanged."
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StepStatus:
      type: string
      enum:
      - ok
      - deferred
      - skipped_rss
      - skipped_due_to_degradation
      - unavailable
      title: StepStatus
      description: Per-step outcome in the write pipeline (RKU-65 §7.4).
    MemoryListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/MemoryResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
        has_more:
          type: boolean
          title: Has More
      type: object
      required:
      - items
      - total
      - limit
      - offset
      - has_more
      title: MemoryListResponse
      description: Paginated list response for memories.
    MemoryWriteResponse:
      properties:
        id:
          type: string
          title: Id
        content:
          type: string
          title: Content
        source:
          anyOf:
          - type: string
          - type: 'null'
          title: Source
        memory_type:
          type: string
          title: Memory Type
        importance:
          type: number
          title: Importance
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        last_accessed:
          type: string
          title: Last Accessed
        access_count:
          type: integer
          title: Access Count
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        confidence_score:
          anyOf:
          - type: number
          - type: 'null'
          title: Confidence Score
        source_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Source Type
        evidence_count:
          type: integer
          title: Evidence Count
          default: 0
        contradiction_count:
          type: integer
          title: Contradiction Count
          default: 0
        confidence_decay_rate:
          anyOf:
          - type: number
          - type: 'null'
          title: Confidence Decay Rate
        last_validated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Validated At
        valid_from:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid From
        valid_to:
          anyOf:
          - type: string
          - type: 'null'
          title: Valid To
        tx_from:
          anyOf:
          - type: string
          - type: 'null'
          title: Tx From
        tx_to:
          anyOf:
          - type: string
          - type: 'null'
          title: Tx To
        superseded_by:
          anyOf:
          - type: string
          - type: 'null'
          title: Superseded By
        is_current:
          type: boolean
          title: Is Current
          default: true
        pipeline_status:
          $ref: '#/components/schemas/PipelineStatus'
        pipeline:
          $ref: '#/components/schemas/PipelineTiming'
      type: object
      required:
      - id
      - content
      - memory_type
      - importance
      - created_at
      - updated_at
      - last_accessed
      - access_count
      - pipeline_status
      - pipeline
      title: MemoryWriteResponse
      description: 'POST /memories response — the created memory plus pipeline status + timing.


        Subclasses MemoryResponse so the memory fields stay at the top level (the

        existing POST client contract is preserved) and adds the two pipeline fields.'
    PipelineTiming:
      properties:
        admission_ms:
          type: integer
          title: Admission Ms
        embedding_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Embedding Ms
        importance_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Importance Ms
        entities_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Entities Ms
        consolidation_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Consolidation Ms
        conflicts_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Conflicts Ms
        store_ms:
          type: integer
          title: Store Ms
        total_ms:
          type: integer
          title: Total Ms
      type: object
      required:
      - admission_ms
      - embedding_ms
      - importance_ms
      - entities_ms
      - consolidation_ms
      - conflicts_ms
      - store_ms
      - total_ms
      title: PipelineTiming
      description: Per-step wall-clock timing in ms. `None` means the step did not run.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
x-refined-from:
- openapi.json
- raku-so-openapi.json