Skip to content

Dify workflows use native Loom memory and knowledge tools - #763

Merged
zlareb1 merged 11 commits into
mainfrom
feat/dify-loom-plugin
Nov 17, 2026
Merged

zlareb1 merged 11 commits into
mainfrom
feat/dify-loom-plugin

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

A Dify plugin exposes remember, recall and knowledge-search tools against a configured Loom deployment.

Why

Dify workflows need native tools with provider credentials and form-bound end-user identity. The plugin implements the installed SDK's tool and provider interfaces and packages with the official CLI. It uses the published Loom SDK over HTTP; no database, local memory fallback or model provider is added.

Provider configuration fixes the organization, namespace and agent. The end-user id is a required form field, outside model-generated arguments. Searches pin the configured namespace. Each request constructs, calls and closes its SDK client in a native worker thread so concurrent greenlets do not share an event loop. Credentials are copied before dispatch, and errors cross the worker boundary without logging response details. Requests use a 15-second HTTP timeout, a 30-second SDK call wait and one attempt; pool admission, client setup and closure are separate. The manifest supplies the repository and public contact required by the marketplace validator. The package includes its privacy policy and an automated native-test/package workflow. The public-copy check accepts the verified public feedback role inbox required by the marketplace contact field; regression cases still reject personal addresses, including names containing that role word.

Scope and risk

Three native tools, credentials, package assets, privacy policy, CI and documentation. Remember persists memory; recall reads user memories and knowledge search reads shared namespace documents. An administrator controls the HTTP destination and token, so network access must be constrained by the runner's policy. URLs reject embedded credentials, queries and fragments. Remote errors do not reveal token or response details. No local Dify application is running for an end-to-end UI check; that limitation is documented.

Compatibility, rollout and rollback

  • Wire: none; existing memory and knowledge operations are used.
  • Operator steps: install the packaged plugin and configure its Loom endpoint and scoped token.
  • Rollback: remove the adapter or package. Existing Loom rows remain subject to the normal deletion and erasure operations. No schema migration or backfill is required.

Tests

  • make format-check, make lint, make typecheck and generated-file checks pass.
  • Documentation link and public-copy modules: 250 passed; strict documentation build passes.
  • TypeScript SDK checks: 427 tests passed, with built-package checks. The Python wheel installs and passes the SDK smoke check with lowest direct dependencies on Python 3.11.
  • Complete native plugin tests: 30 passed, including live SDK calls and concurrent native worker calls. The isolated test tenant is purged after writers stop, with the client closed and no recorded residue.
  • All applicable coding-agent plugin checks pass, including the real CLI check against a local fake provider.
  • The pinned official CLI produces an archive containing exactly the 19 expected source files. Its bytes match the archive accepted by the official local package validators; dependency-resolution warnings and skipped advisory checks do not establish vulnerability clearance.
  • Complete repository unit tests and all offline benchmarks run in PR CI and must pass before merge.
  • No full Dify application UI, Cloud or remote-debug check is claimed. Local package validation does not establish marketplace approval.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Claude Code and Codex. Checked the installed framework interface, native behavior, stored scope and provenance, packaging and test coverage.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local formatting, lint, types, generators and adapter checks pass.
  • All required PR CI checks pass.
  • Generated files are regenerated from their source; no migration is added.
  • No coding-agent plugin behavior or frontend is changed.
  • Documentation names the current behavior, operator steps and wire changes.
  • Public copy contains no internal deployment details, and commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Run each overlap in a fresh process with Dify imported first and an owned loopback HTTP fixture. Separate credential scopes and responses expose native SDK loop collisions without changing framework guards.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Construct, call and close each client in one native worker so overlapping tool invocations keep separate event loops and credentials.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Return failures from the complete SDK lifecycle and raise them in the caller, where tool and credential validation sanitization applies.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
The plugin manifest requires a public email contact. The copy check recognizes the public feedback inbox alongside the existing role inboxes and continues to reject individual addresses and near matches.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 1df9cd9 into main Nov 17, 2026
53 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
7 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant