// Package memory manages the Flyto agent's long-term memory: per-session // memories, cross-session recall, extraction from transcripts, relevance // scoring, and optional sync to external stores. // // Consumer integration surfaces fall into three shapes. For the full // taxonomy see `docs/api-reference.md` section "API 消费形态 / API // Consumption Patterns". // // Synchronous callback — form 3: // - Store: persistent storage backend (consumers can plug filesystem, DB, // or remote store); engine calls CRUD synchronously // - MemoryExtractor: extracts durable memories from a transcript; // engine calls Extract synchronously after turn boundaries // - RelevanceScorer: ranks memory candidates for a given prompt; engine // calls Score synchronously before prompt assembly // - SyncAdapter: push/pull memories to external systems (Notion, // GitHub gist, etc.); engine calls Sync synchronously when configured // - MemorySelector: AI-driven memory selection; consumer can plug model // - Backupper: on-demand or scheduled snapshot to backup medium // // Pull — form 2: // - Store.List / Get: consumer querying current memory state (beyond the // engine's use, SaaS admin UIs list/inspect memories via Store) // // Package memory 管理 Flyto agent 的长期记忆: 每会话记忆 / 跨会话召回 / // 从对话记录提取 / 相关性打分 / 可选的外部 store 同步. // // 消费者接入面分三种形态. 完整分类见 `docs/api-reference.md` "API 消费形态 / // API Consumption Patterns" 章节. // // 同步回调 (callback) —— 形态三: // - Store: 持久化后端 (消费者可换文件系统 / DB / 远端); 引擎同步调 CRUD // - MemoryExtractor: 从对话记录抽取持久记忆; 引擎在 turn 边界后同步调 Extract // - RelevanceScorer: 对记忆候选按当前 prompt 排序; 引擎在拼 prompt 前同步调 Score // - SyncAdapter: 与外部系统 (Notion / GitHub gist 等) 同步; 配置后引擎同步调 Sync // - MemorySelector: AI 驱动记忆选取; 消费者可换模型 // - Backupper: 按需或定时快照到备份介质 // // 调取 (pull) —— 形态二: // - Store.List / Get: 消费者主动查询当前记忆状态 (引擎之外, SaaS admin UI // 经 Store 列举/查看记忆) package memory