{
  "id": "hindsight-memory",
  "name": "Hindsight Memory",
  "description": "Cross-session memory via Hindsight. Injects LLM-free recall context before each reply (before_prompt_build) and retains each turn asynchronously after it ends (agent_end); Hindsight extracts/consolidates server-side, so there is no client-side cognify sweep. Structural successor to cognee-memory (kb #75, H3).",
  "activation": {
    "onStartup": true
  },
  "contracts": {
    "tools": ["hindsight_recall", "hindsight_reflect"]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "enabled": { "type": "boolean" },
      "hindsightUrl": { "type": "string" },
      "bankId": { "type": "string" },
      "agents": { "type": "array", "items": { "type": "string" } },
      "budget": { "type": "string", "enum": ["low", "mid", "high"] },
      "recallMaxTokens": { "type": "integer", "minimum": 128, "maximum": 32000 },
      "maxContextChars": { "type": "integer", "minimum": 200, "maximum": 20000 },
      "recallTimeoutMs": { "type": "integer", "minimum": 500, "maximum": 30000 },
      "retainTimeoutMs": { "type": "integer", "minimum": 500, "maximum": 60000 },
      "minTextChars": { "type": "integer", "minimum": 1, "maximum": 200 },
      "types": { "type": "array", "items": { "type": "string" } },
      "injectHeader": { "type": "string" }
    }
  },
  "uiHints": {
    "enabled": {
      "label": "Hindsight Memory",
      "help": "Enable cross-session Hindsight memory (recall inject + async turn retain)."
    },
    "hindsightUrl": {
      "label": "Hindsight URL",
      "help": "Base URL of the Hindsight REST API (default http://hindsight:8888)."
    },
    "bankId": {
      "label": "Bank ID",
      "help": "Hindsight memory bank to read/write (default \"adolf\" — the same shared bank the MCP tool surface uses, so hook-based and tool-based memory stay consistent)."
    },
    "agents": {
      "label": "Target Agents",
      "help": "Agent ids that use Hindsight memory. Empty means all agents."
    },
    "budget": {
      "label": "Recall/Reflect Budget",
      "help": "Effort level for recall and reflect calls (low/mid/high). Higher costs more latency."
    },
    "recallMaxTokens": {
      "label": "Recall Max Tokens",
      "help": "Hindsight's own token budget for a single recall call's results."
    },
    "maxContextChars": {
      "label": "Max Injected Context Chars",
      "help": "Hard cap on the size of the injected memory block."
    },
    "recallTimeoutMs": {
      "label": "Recall Timeout (ms)",
      "help": "Budget for the LLM-free recall on the reply path. On timeout the turn proceeds with no injected memory."
    },
    "retainTimeoutMs": {
      "label": "Retain Timeout (ms)",
      "help": "Budget for the post-turn async retain call to Hindsight (off the reply path; async:true itself makes Hindsight's extraction non-blocking, this only bounds the HTTP request)."
    },
    "minTextChars": {
      "label": "Minimum Text Chars",
      "help": "Skip recall/retain for text shorter than this."
    },
    "types": {
      "label": "Recall Types",
      "help": "Fact types to recall: world, experience, observation. Defaults to world and experience."
    },
    "injectHeader": {
      "label": "Inject Header",
      "help": "Header line prepended to the injected memory block."
    }
  }
}
