feat(dify): add TencentDB Agent Memory adapter#394
Conversation
|
Validation evidence for this Dify adapter PR: Quickstart e2eDify package/installRuntime invocation through Dify |
|
Added the requested minimal CI and reran the validation path. Immediate read-back is now documented and asserted as:
Latest passing CI runs on the head branch in the fork:
Latest real quickstart e2e log: |
|
Follow-up validation after the latest Gateway recall fix on the same PR branch. Real Dify strict read-backEnvironment:
Runtime path:
{
"ok": true,
"memory_count": 1,
"strategy": "hybrid",
"context_length": 2013,
"has_relevant_memories": true,
"has_user_persona": true
}L1 / L2 / L3 evidence from the same sessionL1:
L2:
L3:
So this is no longer only an L0 read-back proof. The real Dify plugin path now shows:
|
a6ac065 to
17caf3e
Compare
|
Update on structured recall evidence (2026-07-05): The latest quickstart evidence on this PR is no longer the old Current end-to-end quickstart snippet: So for the Dify adapter path we now have both:
This is the strongest answer to the “when does tdai_recall become non-empty for LLM injection?” question in this PR. |
|
Triage note for #235 scope cleanup: The Dify plugin work is platform-specific and should be reviewed separately from the generic adapter SDK cleanup. However, this PR currently also carries Gateway /recall transport response changes, which overlap with the focused and locally verified MCP/Gateway compatibility work in #372. Recommended re-scope:
This keeps the Dify integration review focused while still preserving the platform-specific contribution. |
|
Thanks, I agree with these three scope decisions.
I’ve already aligned my local branch in that direction. |
17caf3e to
a59da6d
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. Keep the PR scoped to Dify plugin code, packaging, documentation, and Dify-side tests. Shared Gateway recall response compatibility remains outside this Dify-specific review surface. Closes TencentCloud#235 Signed-off-by: bugkeep <1921817430@qq.com>
a59da6d to
31fbf33
Compare
Description | 描述
This PR adds a Dify-specific TencentDB Agent Memory adapter so Dify workflows can call the existing Gateway/Core memory pipeline for recall, capture, search, and session flush without reimplementing memory logic inside Dify.
This PR is intentionally scoped as a platform-specific Dify integration. The review surface is limited to the Dify plugin itself: packaging, provider/tool definitions, the Python runtime transport shim, Dify workflow guidance, and Dify-side tests.
What changed
dify-plugin-tdai-memory, a Dify tool plugin that forwards:tdai_healthtdai_recalltdai_capturetdai_memory_searchtdai_conversation_searchtdai_session_endto the TencentDB Agent Memory Gateway.
Gateway -> mock Dify server -> capture -> conversation_search -> session_end -> recall.tdai_recallconsume both the legacycontextfield and the split recall fields from the Gateway/MCP compatibility path (prepend_context+append_system_context).Scope Notes | 范围说明
This PR is kept Dify-specific on purpose.
/recallresponse compatibility work is not part of this PR scope and is left to the focused Gateway/MCP compatibility path in feat(adapter): add Codex MCP gateway bridge #372.TdaiGatewayClientin this plugin is only a thin Dify-runtime transport shim. It mirrors the existing Gateway API contract for the Python plugin runtime and is not intended as a new shared cross-platform SDK layer.Related Issue | 关联 Issue
Closes #235
Change Type | 修改类型
Self-test Checklist | 自测清单
Validation | 验证
Python tests
Minimal CI added in repo
Dify CLI packaging / install
Real quickstart e2e (Dify adapter smoke test)
Real Dify runtime path verified
Read-back Positioning | 读回定位
For this Dify-specific PR:
tdai_conversation_searchis the immediateL0 read path.tdai_recallis the structured recall path exposed through the Dify adapter.contextresponse and the split Gateway/MCP recall fields (prepend_contextandappend_system_context).tdai_recall.contextis non-empty depends on the deployed Gateway build plus the existing memory consolidation pipeline, so it is not used here as the sole pass condition of the Dify-only smoke test.Additional Notes | 其他说明
conversation_idassession_key.