[feat] add Dify memory adapter#2
Conversation
|
Superseded by upstream PR: TencentCloud#394 The branch name was changed to |
|
补一条更严格的 Dify read-back 验证(2026-07-05,本地 Dify + 真实 plugin invoke):
关键点是这次 这条验证覆盖了真实 Dify 插件路径下的 L0 capture -> session_end flush -> L1 memory_search -> recall context read-back。 |
|
补充一组 L1 / L2 / L3 的真实实证(2026-07-05,本地 Dify + 真实 plugin invoke,Gateway L1 evidenceDify 工具链路: SQLite 实际落库: {
"counts": { "l0": 2, "l1": 1 },
"l1Rows": [
{
"type": "persona",
"priority": 90,
"scene_name": "我和用户讨论如何记住他的技术偏好",
"content": "用户偏好使用 Go 语言开发后端服务,并通常部署在 Kubernetes 集群上。",
"updated_time": "2026-07-05T04:33:31.647Z"
}
]
}Gateway log also shows: L2 evidence本次同一 session 生成了 scene block 和 scene index: Checkpoint / logs: Gateway log: L3 evidence本次同一 session 生成了 Gateway log: Dify-visible read path after L3重新从 Dify 调 {
"ok": true,
"memory_count": 1,
"strategy": "hybrid",
"context_length": 2013,
"has_relevant_memories": true,
"has_user_persona": true
}也就是说,这里不只是后台把 L2/L3 文件写出来了,
一起带回给 Dify / LLM 使用。 |
fae06e4 to
a6ac065
Compare
Add a Dify plugin adapter that connects Dify workflows to the TencentDB Agent Memory Gateway for recall, capture, health, search, and session flush operations. Include a mock Dify quickstart e2e script, adapter architecture notes, Mermaid workflow diagram, and cross-platform comparison documentation. Closes TencentCloud#235 Signed-off-by: bugkeep <1921817430@qq.com>
Merge dynamic and stable recall context in the gateway HTTP response so transport clients like Dify receive actual L1 memory snippets during read-back validation. Signed-off-by: bugkeep <1921817430@qq.com>
a6ac065 to
17caf3e
Compare
Motivation
Add a Dify platform adapter for TencentDB Agent Memory so Dify workflows can call the existing Gateway/Core memory pipeline instead of reimplementing memory behavior.
Related upstream issue: TencentCloud#235.
Changes
dify-plugin-tdai-memorywith Dify tool provider metadata and Python tool implementations for health, recall, capture, memory search, conversation search, and session end.tdai_conversation_searchas the adapter's immediateL0 read path;tdai_recallremains the structured recall path.Validation
python -m unittest discover -s dify-plugin-tdai-memory\tests(Ran 54 tests,OK)dify plugin package ./dify-plugin-tdai-memoryNotes
For local unsigned package installation in Dify,
FORCE_VERIFYING_SIGNATURE=falsewas used in the local plugin daemon. Production deployments should keep signature verification enabled unless the package is signed and trusted.