{
  "components": {
    "schemas": {
      "CommittedOperationDTO": {
        "additionalProperties": false,
        "properties": {
          "committed_at": {
            "description": "RFC3339 timestamp",
            "type": "string"
          },
          "memory_id": {
            "description": "Memory UUID",
            "type": "string"
          }
        },
        "required": [
          "memory_id",
          "committed_at"
        ],
        "type": "object"
      },
      "CommittedOperationsDTO": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "description": "Created memory operations",
            "items": {
              "$ref": "#/components/schemas/CommittedOperationDTO"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "deleted": {
            "description": "Deleted memory operations",
            "items": {
              "$ref": "#/components/schemas/CommittedOperationDTO"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "updated": {
            "description": "Updated memory operations",
            "items": {
              "$ref": "#/components/schemas/CommittedOperationDTO"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "ConversationInput": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "description": "When the conversation started (RFC 3339). Defaults to now.",
            "format": "date-time",
            "type": "string"
          },
          "messages": {
            "description": "The messages in this conversation. Must contain at least one message.",
            "items": {
              "$ref": "#/components/schemas/MessageInput"
            },
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Arbitrary key-value metadata to attach to the conversation.",
            "type": "object"
          },
          "updated_at": {
            "description": "When the conversation was last updated (RFC 3339). Defaults to now.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "messages"
        ],
        "type": "object"
      },
      "CreateMemoryRequest": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/CreateMemoryRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "group": {
            "description": "Pipeline group name. Defaults to 'default'.",
            "type": "string"
          },
          "input": {
            "$ref": "#/components/schemas/Input",
            "description": "The input to process. Accepts one of string, conversation, or pre_extracted."
          },
          "properties": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Scope properties to associate with this memory. Must include every key any topic in the group is scoped by.",
            "type": "object"
          },
          "root": {
            "description": "Pipeline entry point. Overrides the default starting step.",
            "type": "string"
          },
          "user_id": {
            "description": "User ID (case-insensitive) to scope this memory to. Required when the topic is user-scoped. A new user is created automatically if the ID does not exist.",
            "type": "string"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": false,
        "properties": {
          "location": {
            "description": "Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'",
            "type": "string"
          },
          "message": {
            "description": "Error message text",
            "type": "string"
          },
          "value": {
            "description": "The value at the given location"
          }
        },
        "type": "object"
      },
      "ErrorModel": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/ErrorModel.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "detail": {
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "examples": [
              "Property foo is required but is missing."
            ],
            "type": "string"
          },
          "errors": {
            "description": "Optional list of individual error details",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "instance": {
            "description": "A URI reference that identifies the specific occurrence of the problem.",
            "examples": [
              "https://example.com/error-log/abc123"
            ],
            "format": "uri",
            "type": "string"
          },
          "status": {
            "description": "HTTP status code",
            "examples": [
              400
            ],
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "description": "A short, human-readable summary of the problem type. This value should not change between occurrences of the error.",
            "examples": [
              "Bad Request"
            ],
            "type": "string"
          },
          "type": {
            "default": "about:blank",
            "description": "A URI reference to human-readable documentation for the error.",
            "examples": [
              "https://example.com/errors/example"
            ],
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Input": {
        "additionalProperties": false,
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationInput",
            "description": "Conversation content. Exactly one of string, pre_extracted, or conversation must be set."
          },
          "pre_extracted": {
            "$ref": "#/components/schemas/PreExtractedInput",
            "description": "Pre-extracted content. Exactly one of string, pre_extracted, or conversation must be set."
          },
          "string": {
            "$ref": "#/components/schemas/StringInput",
            "description": "String content. Exactly one of string, pre_extracted, or conversation must be set."
          }
        },
        "type": "object"
      },
      "ListMemoriesRequest": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/ListMemoriesRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "group": {
            "description": "Pipeline group name. Defaults to 'default'.",
            "type": "string"
          },
          "limit": {
            "description": "Maximum number of results. Defaults to 20 when omitted.",
            "format": "int64",
            "maximum": 100,
            "type": "integer"
          },
          "properties": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Property filter. Searches all topics, narrowing results for topics scoped by passed properties.",
            "type": "object"
          },
          "topics": {
            "description": "Restrict the search to the listed topics. Each entry is either a topic name or an object with an optional per-topic property filter that composes with top-level properties.",
            "items": {
              "description": "A topic to include in the search. Either a topic name string, or an object with `name` and an optional per-topic `properties` filter.",
              "oneOf": [
                {
                  "description": "Topic name.",
                  "type": "string"
                },
                {
                  "properties": {
                    "name": {
                      "description": "Topic name.",
                      "type": "string"
                    },
                    "properties": {
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "description": "Per-topic property filter. Keys must be ones the topic is scoped by; unknown keys are rejected. Use null to clear an inherited global filter for this topic.",
                      "type": "object"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object"
                }
              ]
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user_id": {
            "description": "User ID (case-insensitive) to filter results by. Required when searching user-scoped topics.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Memory": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/Memory.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "content": {
            "description": "The stored memory content.",
            "type": "string"
          },
          "created_at": {
            "description": "When this memory was created (RFC 3339).",
            "format": "date-time",
            "type": "string"
          },
          "group": {
            "description": "The pipeline group this memory was created in.",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for this memory.",
            "type": "string"
          },
          "project_id": {
            "description": "The project this memory belongs to.",
            "type": "string"
          },
          "properties": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "All scope properties associated with this memory.",
            "type": "object"
          },
          "score": {
            "description": "Relevance score. Only present in search results.",
            "format": "double",
            "type": "number"
          },
          "topic": {
            "description": "The topic this memory belongs to.",
            "type": "string"
          },
          "updated_at": {
            "description": "When this memory was last updated (RFC 3339).",
            "format": "date-time",
            "type": "string"
          },
          "user_id": {
            "description": "User ID this memory is scoped to, if any.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "content",
          "topic",
          "group",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "MemoryList": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/MemoryList.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "memories": {
            "description": "The list of memories.",
            "items": {
              "$ref": "#/components/schemas/Memory"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "total": {
            "description": "Total number of memories returned.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "memories",
          "total"
        ],
        "type": "object"
      },
      "MessageInput": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "description": "The message text. May be empty for assistant messages that contain only tool calls.",
            "type": "string"
          },
          "created_at": {
            "description": "When this message was sent (RFC 3339). Defaults to now.",
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "description": "Name of the tool/function. Used on 'tool' role messages.",
            "type": "string"
          },
          "role": {
            "description": "The role of the message sender. 'tool' is mapped to 'user' and 'developer' to 'system' internally.",
            "enum": [
              "user",
              "assistant",
              "system",
              "tool",
              "developer"
            ],
            "type": "string"
          },
          "tool_call_id": {
            "description": "ID of the tool call this message responds to. Used on 'tool' role messages.",
            "type": "string"
          },
          "tool_calls": {
            "description": "Tool calls made by the assistant.",
            "items": {
              "$ref": "#/components/schemas/ToolCallInput"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "role"
        ],
        "type": "object"
      },
      "PreExtractedInput": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PreExtractedInputItem"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "PreExtractedInputItem": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          }
        },
        "required": [
          "content",
          "topic"
        ],
        "type": "object"
      },
      "RetrievalConfigDTO": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "default": 10,
            "description": "Maximum number of results to return (1–100). Defaults to 10.",
            "format": "int64",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "retrieval_type": {
            "description": "The search method: 'vector' for semantic similarity, 'bm25' for keyword matching, or 'hybrid' for a combination of both.",
            "type": "string"
          }
        },
        "required": [
          "retrieval_type"
        ],
        "type": "object"
      },
      "Run": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/Run.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "committed_operations": {
            "$ref": "#/components/schemas/CommittedOperationsDTO",
            "description": "Committed memory operations"
          },
          "created_at": {
            "description": "Creation timestamp",
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "description": "Error message if failed",
            "type": "string"
          },
          "group_id": {
            "description": "Group UUID",
            "type": "string"
          },
          "input_type": {
            "description": "Input type",
            "type": "string"
          },
          "run_id": {
            "description": "Pipeline run UUID",
            "type": "string"
          },
          "starting_step": {
            "description": "Starting step index",
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "Current status: running, completed, failed, in_buffer",
            "type": "string"
          },
          "updated_at": {
            "description": "Last update timestamp",
            "format": "date-time",
            "type": "string"
          },
          "user_id": {
            "description": "User name (if user-scoped run)",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "status",
          "group_id",
          "starting_step",
          "input_type",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "RunOutput": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/RunOutput.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "error": {
            "description": "Error details, present only when status is 'failed'.",
            "type": "string"
          },
          "run_id": {
            "description": "Unique identifier for the pipeline run. Use this to poll the run status.",
            "type": "string"
          },
          "status": {
            "description": "Current run status: 'running', 'completed', 'failed', or 'in_buffer'.",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "status"
        ],
        "type": "object"
      },
      "SearchMemoriesRequest": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "A URL to the JSON Schema for this object.",
            "examples": [
              "https://api.engram.weaviate.io/schemas/SearchMemoriesRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "group": {
            "description": "Pipeline group name. Defaults to 'default'.",
            "type": "string"
          },
          "properties": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Property filter. Searches all topics, narrowing results for topics scoped by passed properties.",
            "type": "object"
          },
          "query": {
            "description": "The search query text.",
            "minLength": 1,
            "type": "string"
          },
          "retrieval_config": {
            "$ref": "#/components/schemas/RetrievalConfigDTO",
            "description": "Controls the search method and result limit. Defaults to hybrid search with a limit of 10."
          },
          "topics": {
            "description": "Restrict the search to the listed topics. Each entry is either a topic name or an object with an optional per-topic property filter that composes with top-level properties.",
            "items": {
              "description": "A topic to include in the search. Either a topic name string, or an object with `name` and an optional per-topic `properties` filter.",
              "oneOf": [
                {
                  "description": "Topic name.",
                  "type": "string"
                },
                {
                  "properties": {
                    "name": {
                      "description": "Topic name.",
                      "type": "string"
                    },
                    "properties": {
                      "additionalProperties": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "description": "Per-topic property filter. Keys must be ones the topic is scoped by; unknown keys are rejected. Use null to clear an inherited global filter for this topic.",
                      "type": "object"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object"
                }
              ]
            },
            "type": [
              "array",
              "null"
            ]
          },
          "user_id": {
            "description": "User ID (case-insensitive) to filter results by. Required when searching user-scoped topics.",
            "type": "string"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "StringInput": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "ToolCallCustomInput": {
        "additionalProperties": false,
        "properties": {
          "input": {
            "description": "Input to the tool, as a string.",
            "type": "string"
          },
          "name": {
            "description": "The name of the custom tool.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "input"
        ],
        "type": "object"
      },
      "ToolCallFuncInput": {
        "additionalProperties": false,
        "properties": {
          "arguments": {
            "description": "JSON-encoded string of the function arguments.",
            "type": "string"
          },
          "name": {
            "description": "The name of the function.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "arguments"
        ],
        "type": "object"
      },
      "ToolCallInput": {
        "additionalProperties": false,
        "properties": {
          "custom": {
            "$ref": "#/components/schemas/ToolCallCustomInput",
            "description": "Custom tool details. Present when type is 'custom'."
          },
          "function": {
            "$ref": "#/components/schemas/ToolCallFuncInput",
            "description": "Function details. Present when type is 'function'."
          },
          "id": {
            "description": "Unique identifier for this tool call.",
            "type": "string"
          },
          "type": {
            "description": "Tool type: 'function' or 'custom'.",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Persistent memory for LLM agents and applications. Store, search, and manage memories using vector embeddings and LLM-powered processing.\n\n## Base URL\n\nThe base URL for all projects is:\n\n```\nhttps://api.engram.weaviate.io\n```\n\n## Authentication\n\nInclude your API key in the `Authorization` header:\n\n```\nAuthorization: Bearer eng_your_api_key\n```\n\nAPI keys are scoped to a project. All requests authenticated with a key operate within that project's scope.\n\n## Errors\n\nAll error responses use a consistent format:\n\n```json\n{\n  \"status\": 400,\n  \"message\": \"error description\"\n}\n```\n\n| Code | Description |\n|------|-------------|\n| 400 | Bad request — invalid input or missing required fields |\n| 401 | Unauthorized — missing or invalid API key |\n| 403 | Forbidden — insufficient permissions |\n| 404 | Not found — resource does not exist |\n| 500 | Internal server error |",
    "title": "Engram API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/memories": {
      "post": {
        "description": "Send content to be processed through the memory pipeline. Accepts raw text, pre-extracted facts, or a multi-turn conversation. Processing is asynchronous — use the returned `run_id` to track progress.",
        "operationId": "create-memory",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunOutput"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Store a memory",
        "tags": [
          "Memories"
        ]
      }
    },
    "/memories/list": {
      "post": {
        "description": "Returns all memories in the project. Results are scoped to the API key's project.",
        "operationId": "list-memories",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListMemoriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryList"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "List memories",
        "tags": [
          "Memories"
        ]
      }
    },
    "/memories/search": {
      "post": {
        "description": "Find relevant memories using vector similarity, BM25 keyword matching, or hybrid search.",
        "operationId": "search-memories",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchMemoriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryList"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Search memories",
        "tags": [
          "Memories"
        ]
      }
    },
    "/memories/{id}": {
      "delete": {
        "description": "Permanently remove a memory by its ID. You must provide `user_id` if the topic is user-scoped.",
        "operationId": "delete-memory",
        "parameters": [
          {
            "description": "Memory ID. Must be a valid UUID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "Memory ID. Must be a valid UUID.",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "User name (case-insensitive)",
            "explode": false,
            "in": "query",
            "name": "user_id",
            "schema": {
              "description": "User name (case-insensitive)",
              "type": "string"
            }
          },
          {
            "description": "Group name (defaults to 'default')",
            "explode": false,
            "in": "query",
            "name": "group",
            "schema": {
              "description": "Group name (defaults to 'default')",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Delete a memory",
        "tags": [
          "Memories"
        ]
      },
      "get": {
        "description": "Retrieve a single memory by its ID. You must provide `user_id` if the topic is user-scoped.",
        "operationId": "get-memory",
        "parameters": [
          {
            "description": "Memory ID. Must be a valid UUID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "Memory ID. Must be a valid UUID.",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "User name (case-insensitive)",
            "explode": false,
            "in": "query",
            "name": "user_id",
            "schema": {
              "description": "User name (case-insensitive)",
              "type": "string"
            }
          },
          {
            "description": "Group name (defaults to 'default')",
            "explode": false,
            "in": "query",
            "name": "group",
            "schema": {
              "description": "Group name (defaults to 'default')",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Memory"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get a memory",
        "tags": [
          "Memories"
        ]
      }
    },
    "/runs/{run_id}": {
      "get": {
        "description": "Check the status of an asynchronous pipeline run. Returns the current state and, once completed, the list of memory operations that were committed (created, updated, or deleted).",
        "operationId": "get-run-status",
        "parameters": [
          {
            "description": "The ID of the pipeline run. Must be a valid UUID.",
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "description": "The ID of the pipeline run. Must be a valid UUID.",
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "summary": "Get pipeline run status",
        "tags": [
          "Runs"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.engram.weaviate.io"
    }
  ]
}
