Você não pode selecionar mais de 25 tópicosOs tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
"description": "Universal AI Agent Memory platform, phases 1-3: memories with revisions and verification, sessions with checkpoints, Markdown/text document ingestion with chunk locators, lexical search and recall, health. Authenticate with `Authorization: Bearer <api key>`; the tenant is derived from the key. Anything the caller cannot see is reported as 404. Phase 3: POST /context assembles a budgeted task briefing."
},
"servers": [
{
"url": "/api/v1"
}
],
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
},
"schemas": {
"Error": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "string"
}
},
"request_id": {
"type": "string"
}
}
}
}
},
"RememberRequest": {
"type": "object",
"required": [
"namespace_id",
"type",
"title",
"content"
],
"properties": {
"namespace_id": {
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"working",
"episodic",
"semantic",
"procedural",
"preference",
"decision",
"constraint",
"lesson",
"hypothesis",
"goal",
"solution"
]
},
"title": {
"type": "string",
"maxLength": 200
},
"content": {
"type": "string",
"maxLength": 100000
},
"summary": {
"type": "string",
"maxLength": 2000,
"nullable": true
},
"tags": {
"type": "array",
"items": {
"type": "string",
"maxLength": 64
},
"maxItems": 32
},
"attributes": {
"type": "object",
"description": "Free-form JSON object, max 16 KB"
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"importance": {
"type": "number",
"minimum": 0,
"maximum": 1
}
}
},
"RememberResponse": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"revision": {
"type": "integer"
},
"status": {
"type": "string"
},
"verification_status": {
"type": "string"
},
"indexing_status": {
"type": "string",
"example": "not_indexed"
},
"duplicate": {
"type": "boolean",
"description": "true when an identical active memory already existed (HTTP 200)"
}
}
},
"Memory": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"namespace_id": {
"type": "string"
},
"type": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"active",
"retired",
"superseded"
]
},
"current_revision": {
"type": "integer"
},
"revision": {
"type": "integer"
},
"verification_status": {
"type": "string",
"enum": [
"unverified",
"verified",
"disputed",
"rejected"
]
},
"title": {
"type": "string"
},
"summary": {
"type": "string",
"nullable": true
},
"content": {
"type": "string"
},
"attributes": {
"type": "object",
"nullable": true
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"confidence": {
"type": "number",
"nullable": true
},
"importance": {
"type": "number",
"nullable": true
},
"change_reason": {
"type": "string",
"nullable": true
},
"created_by": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"IngestRequest": {
"type": "object",
"required": [
"namespace_id",
"title",
"content"
],
"properties": {
"namespace_id": {
"type": "string",
"format": "uuid"
},
"title": {
"type": "string",
"maxLength": 200
},
"content": {
"type": "string",
"maxLength": 262144
},
"format": {
"type": "string",
"enum": [
"markdown",
"text"
],
"default": "markdown"
},
"source_uri": {
"type": "string",
"maxLength": 500,
"description": "Identifier only; never fetched. The same source_uri in a namespace is one document."
}
}
},
"IngestResponse": {
"type": "object",
"properties": {
"job": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"document_id": {
"type": "string"
},
"revision": {
"type": "integer"
},
"chunk_count": {
"type": "integer"
},
"unchanged": {
"type": "boolean",
"description": "true when identical text was already the current revision (no new chunks)"
},
"indexing_status": {
"type": "string",
"example": "lexical_indexed"
}
}
},
"SearchRequest": {
"type": "object",
"required": [
"query"
],
"properties": {
"query": {
"type": "string",
"maxLength": 1000
},
"namespace_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"max_results": {
"type": "integer",
"minimum": 1,
"maximum": 50
},
"detail_level": {
"type": "string",
"enum": [
"full",
"snippet"
]
}
}
},
"RecallRequest": {
"type": "object",
"required": [
"query"
],
"properties": {
"query": {
"type": "string",
"maxLength": 1000
},
"namespace_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"types": {
"type": "array",
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"max_results": {
"type": "integer"
},
"detail_level": {
"type": "string",
"enum": [
"full",
"summary"
]
},
"verification_filter": {
"type": "string",
"enum": [
"verified_only",
"include_unverified"
],
"default": "verified_only"
}
}
},
"VerifyRequest": {
"type": "object",
"required": [
"result",
"method",
"revision"
],
"properties": {
"result": {
"type": "string",
"enum": [
"verified",
"disputed",
"rejected"
]
},
"method": {
"type": "string",
"maxLength": 200
},
"notes": {
"type": "string",
"maxLength": 2000
},
"revision": {
"type": "integer",
"description": "Must be the current revision"
}
}
},
"SaveStateRequest": {
"type": "object",
"required": [
"state"
],
"properties": {
"state": {
"type": "object",
"description": "Structured working state, max 64 KB"
},
"expected_revision": {
"type": "integer"
}
}
},
"ContextRequest": {
"type": "object",
"required": [
"task"
],
"properties": {
"task": {
"type": "string",
"maxLength": 2000,
"description": "What the agent is about to do; used as the lexical query for decisions, lessons, knowledge and references."
},
"namespace_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "Restrict to these namespaces (intersected with what the caller can read)."
},
"session_id": {
"type": "string",
"description": "Include the session's latest checkpoint as working_state. 404 when the session is not visible."
},
"include": {
"type": "array",
"items": {
"type": "string",
"enum": [
"constraints",
"preferences",
"decisions",
"lessons",
"knowledge",
"references",
"working_state"
]
},
"description": "Sections to assemble (default all). Constraints and conflicts are always included."
},
"verification_filter": {
"type": "string",
"enum": [
"verified_only",
"include_unverified"
],
"default": "verified_only"
},
"detail_level": {
"type": "string",
"enum": [
"full",
"summary"
],
"default": "full",
"description": "summary returns the stored summary (or first 240 characters); constraints are always full."
},
"max_context_tokens": {
"type": "integer",
"minimum": 100,
"maximum": 32000,
"default": 4000
},
"max_items": {
"type": "integer",
"minimum": 1,
"maximum": 50,
"default": 10,
"description": "Per-section cap for conflicts, decisions, lessons, knowledge and unverified (preferences: 50)."
"description": "False when not every applicable constraint/preference could be considered; do not treat the briefing as complete."
},
"truncated": {
"type": "boolean",
"description": "True when items were left out to fit the budget."
}
}
},
"omitted": {
"type": "object",
"properties": {
"over_budget": {
"type": "integer"
},
"over_limit": {
"type": "integer"
},
"duplicates": {
"type": "integer"
},
"unverified_excluded": {
"type": "integer"
}
}
},
"constraints": {
"type": "array",
"items": {
"type": "object"
}
},
"working_state": {
"type": "object",
"nullable": true
},
"preferences": {
"type": "array",
"items": {
"type": "object"
}
},
"conflicts": {
"type": "array",
"items": {
"type": "object"
}
},
"decisions": {
"type": "array",
"items": {
"type": "object"
}
},
"lessons": {
"type": "array",
"items": {
"type": "object"
}
},
"knowledge": {
"type": "array",
"items": {
"type": "object"
}
},
"references": {
"type": "array",
"items": {
"type": "object"
}
},
"unverified": {
"type": "array",
"items": {
"type": "object"
},
"description": "Only with verification_filter include_unverified."
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"paths": {
"/remember": {
"post": {
"summary": "Create a memory",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"required": false,
"description": "Replays the stored response for an identical body; a different body with the same key is 409.",
"schema": {
"type": "string",
"maxLength": 200
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RememberRequest"
}
}
}
},
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RememberResponse"
}
}
}
},
"200": {
"description": "Exact duplicate (or idempotent replay of a 200)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RememberResponse"
}
}
}
},
"400": {
"description": "Invalid JSON / body",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Idempotency-Key reused with a different body",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/memories": {
"get": {
"summary": "List memories (newest first)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "namespace_id",
"in": "query",
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "type",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"enum": [
"active",
"retired",
"superseded",
"all"
],
"default": "active"
}
},
{
"name": "verification_status",
"in": "query",
"schema": {
"type": "string",
"enum": [
"unverified",
"verified",
"disputed",
"rejected"
]
}
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 20
}
},
{
"name": "cursor",
"in": "query",
"description": "next_cursor from the previous page",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Page of memories",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Memory"
}
},
"next_cursor": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"400": {
"description": "Invalid cursor",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Invalid filter",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/memories/{id}": {
"get": {
"summary": "Get a memory (optionally an older revision)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "revision",
"in": "query",
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "The memory",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Memory"
}
}
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"patch": {
"summary": "Correct a memory: creates the next revision, unverified",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "If-Match",
"in": "header",
"required": false,
"description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"summary": {
"type": "string"
},
"content": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"attributes": {
"type": "object"
},
"confidence": {
"type": "number"
},
"importance": {
"type": "number"
},
"change_reason": {
"type": "string"
},
"expected_revision": {
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "New revision",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RememberResponse"
}
}
}
},
"400": {
"description": "Bad body / revision",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Memory is not active",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"412": {
"description": "Stale revision (ETag header carries the current one)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"428": {
"description": "If-Match missing",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"delete": {
"summary": "Forget: permanently delete the memory and its revisions (needs delete permission)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Deleted"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/memories/{id}/retire": {
"post": {
"summary": "Retire: exclude from ordinary listing",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Retired"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/memories/{id}/versions": {
"get": {
"summary": "Revision history, newest first",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Revisions"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/sessions": {
"post": {
"summary": "Start a session",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"required": false,
"description": "Replays the stored response for an identical body; a different body with the same key is 409.",
"schema": {
"type": "string",
"maxLength": 200
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"namespace_id",
"objective"
],
"properties": {
"namespace_id": {
"type": "string",
"format": "uuid"
},
"objective": {
"type": "string",
"maxLength": 2000
}
}
}
}
}
},
"responses": {
"201": {
"description": "Started"
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Idempotency conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/sessions/{id}/state": {
"get": {
"summary": "Restore the latest checkpoint (revision 0 / state null when none)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Checkpoint; ETag = revision"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"put": {
"summary": "Save a checkpoint (If-Match = current checkpoint revision, 0 for the first)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "If-Match",
"in": "header",
"required": false,
"description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SaveStateRequest"
}
}
}
},
"responses": {
"200": {
"description": "Saved; ETag = new revision"
},
"409": {
"description": "Session closed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"412": {
"description": "Stale revision",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"428": {
"description": "If-Match missing",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/sessions/{id}/complete": {
"post": {
"summary": "Complete a session",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"outcome": {
"type": "string",
"maxLength": 4000
}
}
}
}
}
},
"responses": {
"200": {
"description": "Completed"
},
"409": {
"description": "Already closed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/memories/{id}/verifications": {
"post": {
"summary": "Record a verification of the current revision (needs the verify permission)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VerifyRequest"
}
}
}
},
"responses": {
"200": {
"description": "Recorded; returns the new verification_status"
},
"409": {
"description": "Not the current revision",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/recall": {
"post": {
"summary": "Lexical recall over active memories; unverified memories are hidden unless verification_filter=include_unverified",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecallRequest"
}
}
}
},
"responses": {
"200": {
"description": "Ranked results with warnings"
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/ingestion/jobs": {
"post": {
"summary": "Ingest a Markdown/text document (chunked, indexed)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"required": false,
"description": "Replays the stored response for an identical body; a different body with the same key is 409.",
"schema": {
"type": "string",
"maxLength": 200
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IngestRequest"
}
}
}
},
"responses": {
"201": {
"description": "Ingested (new document or new revision)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IngestResponse"
}
}
}
},
"200": {
"description": "Unchanged or idempotent replay",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IngestResponse"
}
}
}
},
"400": {
"description": "Invalid JSON",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Idempotency-Key reused with a different body",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/jobs/{id}": {
"get": {
"summary": "Ingestion job state",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Job"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/documents/{id}": {
"get": {
"summary": "Document metadata (?include_content=true adds the normalized text)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "include_content",
"in": "query",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Document"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/chunks/{id}": {
"get": {
"summary": "One chunk with heading path and source locator (character offsets into the normalized document text)",
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Chunk"
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/search": {
"post": {
"summary": "Lexical (FTS5/bm25) search over current document chunks; results are untrusted reference data",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchRequest"
}
}
}
},
"responses": {
"200": {
"description": "Ranked chunks with locators and content_trust"
},
"422": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/health/live": {
"get": {
"summary": "Liveness",
"responses": {
"200": {
"description": "Live"
}
}
}
},
"/health/ready": {
"get": {
"summary": "Readiness (database reachable)",
"responses": {
"200": {
"description": "Ready"
},
"503": {
"description": "Unavailable"
}
}
}
},
"/context": {
"post": {
"summary": "Assemble a token-budgeted task briefing: constraints by scope, working state, preferences, conflicts, lexical matches and reference passages",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContextRequest"
}
}
}
},
"responses": {
"200": {
"description": "Briefing",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContextResponse"
}
}
}
},
"400": {
"description": "Empty body or invalid JSON",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing, invalid, revoked or expired API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "session_id not found or not visible to the caller",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"422": {
"description": "Validation failed, unsupported_character (code points above U+FFFF), or context_budget_exceeded (the applicable constraints do not fit max_context_tokens; the error also carries required_tokens)",