feat(dify): add TencentDB Agent Memory adapter#394
Open
bugkeep wants to merge 2 commits into
Open
Conversation
Author
|
Validation evidence for this Dify adapter PR: Quickstart e2eDify package/installRuntime invocation through Dify |
This was referenced Jul 4, 2026
Author
|
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: |
Author
|
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:
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description | 描述
This PR adds a Dify platform adapter for TencentDB Agent Memory so Dify workflows can reuse the existing Gateway/Core memory pipeline for capture, recall, search, and session flush instead of reimplementing memory logic in Dify.
Besides the adapter itself, this PR also fixes the Gateway
/recalltransport response so HTTP clients such as Dify receive the merged recall context, including dynamic recalled memory snippets, rather than only the stable system-side context.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 -> structured recall./recallresponse composition so transport clients receive merged recall context (prependContext + appendSystemContext).Related Issue | 关联 Issue
Closes #235
Change Type | 修改类型
Self-test Checklist | 自测清单
Validation | 验证
Python / TypeScript tests
Minimal CI added in repo
Dify CLI packaging / install
Real quickstart e2e (Gateway + mock Dify plugin server)
Real Dify runtime path verified
Actual L1 / L2 / L3 results | 实际 L1 / L2 / L3 结果
L0 immediate read-back
tdai_conversation_searchis used as the adapter's immediateL0 read path.L1 actual recalled result
The structured recall path (
tdai_recall) returned a non-empty L1 memory block over the real plugin path.Actual
tdai_recall.contextexcerpt:Strict read-back summary from the quickstart run:
{ "ok": true, "strategy": "hybrid", "memory_count": 2 }L2 actual aggregation result
In the same Dify-backed environment, L2 materialized a scene block and scene index entry from the same session.
Actual generated scene block excerpt:
Actual generated scene index entry:
Checkpoint/log evidence from the same environment:
L3 actual persona result
Actual
tdai_recall.context/persona.mdexcerpt:Actual generated persona also includes scene navigation:
Checkpoint evidence from the same environment:
So the real Dify plugin path now demonstrates:
L0immediate read-back viatdai_conversation_searchL1recalled and returned to Dify via<relevant-memories>L2aggregated into a concrete scene block / scene indexL3generated and returned to Dify via<user-persona>Open Code Review
Additional Notes | 其他说明
tdai_conversation_searchis documented as the adapter's immediateL0 read pathfor read-after-write validation.tdai_recallis the structured recall path and is now verified with non-empty context over the real Dify plugin runtime path.FORCE_VERIFYING_SIGNATURE=falsewas used in the local plugin daemon. Production deployments should keep signature verification enabled unless the package is signed and trusted.