{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/geniffy-com/json-schema/geniffy-com-add-in-schema.json",
  "title": "AddIn",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/geniffy-com-openapi.json#/components/schemas/AddIn",
  "properties": {
    "text": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000000,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Text",
      "description": "A note to remember"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000,
          "minLength": 4
        },
        {
          "type": "null"
        }
      ],
      "title": "Url",
      "description": "Or a web page, read once"
    },
    "messages": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "type": "array",
          "maxItems": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Messages",
      "description": "Or a conversation or an agent's session, as your framework already holds it: content as a string, blocks or parts, with its tool calls and results. Who said what is kept, so the user's words become facts about the user; a tool's output is never a fact about anyone, and is how Geniffy learns what happened. System and developer messages are skipped."
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Title",
      "description": "What to call it in the app"
    },
    "said_at": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ],
      "title": "Said At",
      "description": "When it was said or written, for a note or conversation from the past: an ISO 8601 date or time (2026-03-04, 2026-03-04T09:30:00Z). Left out, now. What it teaches is dated by it"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone",
      "description": "Where it was said: an IANA zone (America/Los_Angeles) or an offset (+05:30), so \"tomorrow\", \"Friday\" and \"the end of the month\" are read on the clock of whoever said them. Left out: the offset said_at or the messages' times carry, else the user's own zone (PUT /v1/timezone), else UTC"
    },
    "external_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "External Id",
      "description": "Your own id for this source, such as a ticket's or a document's. Send again under the same id and the source is updated, not added twice: only what changed is learned, and what was removed is taken back. One id names one source in each space"
    },
    "session": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Session",
      "description": "With messages, for an agent or a chat saving as it goes: your id for the session. Each call adds its messages to one memory for the whole session, so send only the turns that are new since the last call. However long the session gets, it stays one source"
    },
    "labels": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Labels",
      "description": "Up to 20 of your own name/value pairs, such as {\"channel\": \"email\", \"project\": \"apollo\"}, to filter what you recall by. A name is letters, digits, dots, dashes or underscores. Sent again under the same external_id, they replace the old ones (nothing is learned again); left out, they are kept; {} clears them"
    },
    "space": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 128
        },
        {
          "type": "null"
        }
      ],
      "title": "Space",
      "description": "One of your own users. Leave it out for your own memory; a blank one is refused."
    }
  },
  "type": "object",
  "$defs": {
    "Message": {
      "properties": {
        "role": {
          "type": "string",
          "maxLength": 40,
          "title": "Role",
          "description": "user, assistant, tool, system, or a name of your own"
        },
        "content": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200000
            },
            {
              "items": {},
              "type": "array",
              "maxItems": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Content",
          "description": "The words: a string, or the list of blocks or parts your framework holds, tool calls and tool results included",
          "default": ""
        },
        "parts": {
          "anyOf": [
            {
              "items": {},
              "type": "array",
              "maxItems": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Parts",
          "description": "Or the parts, as the Vercel AI SDK and Gemini hold a message"
        },
        "name": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "Who, when the role does not say; for a tool result, the tool"
        },
        "tool_calls": {
          "anyOf": [
            {
              "items": {},
              "type": "array",
              "maxItems": 100
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Calls",
          "description": "The tools an assistant called, as OpenAI and LangChain hold them"
        },
        "tool_call_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Call Id",
          "description": "For a tool result, the call it answers"
        },
        "function_call": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Function Call",
          "description": "OpenAI's older single tool call"
        },
        "time": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ],
          "title": "Time",
          "description": "When it was said, ISO 8601, if your app keeps it"
        }
      },
      "type": "object",
      "required": [
        "role"
      ],
      "title": "Message"
    }
  }
}