diff --git a/README.md b/README.md index 3117fc8..de42975 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ session_end ├─ finalize (LLM): EVENT → SKILL promotion └─ maintenance: dedup → PageRank → community detection -Next session → before_agent_start +Next session → before_prompt_build ├─ Dual-path recall (precise + generalized) └─ Personalized PageRank ranking → inject into context ``` @@ -404,4 +404,4 @@ graph-memory/ ## License -MIT \ No newline at end of file +MIT diff --git a/README_CN.md b/README_CN.md index 91d1192..1d1f335 100644 --- a/README_CN.md +++ b/README_CN.md @@ -152,7 +152,7 @@ session_end ├─ finalize(LLM):EVENT → SKILL 升级 └─ maintenance:去重 → PageRank → 社区检测 -下次新对话 → before_agent_start +下次新对话 → before_prompt_build ├─ 双路径召回(精确 + 泛化) └─ 个性化 PageRank 排序 → 注入上下文 ``` @@ -406,4 +406,4 @@ graph-memory/ ## 许可证 -MIT \ No newline at end of file +MIT diff --git a/index.ts b/index.ts index 6b57f18..16f2f31 100755 --- a/index.ts +++ b/index.ts @@ -232,9 +232,9 @@ const graphMemoryPlugin = { return next; } - // ── before_agent_start:召回 ──────────────────────────── + // ── before_prompt_build:召回 ──────────────────────────── - api.on("before_agent_start", async (event: any, ctx: any) => { + api.on("before_prompt_build", async (event: any, ctx: any) => { try { const rawPrompt = typeof event?.prompt === "string" ? event.prompt : ""; const prompt = cleanPrompt(rawPrompt); @@ -854,4 +854,4 @@ function sliceLastTurn( return { messages: kept, tokens, dropped }; } -export default graphMemoryPlugin; \ No newline at end of file +export default graphMemoryPlugin;