langgenius/dify-plugin-daemon
Go daemon for Dify plugin lifecycle and local, debug, and serverless execution
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Dify Plugin Daemon is a Go service between the Dify API server and plugin executors. Dify uses HTTP to query plugin state, including workspace installations, and to invoke plugins. The daemon launches local plugins as subprocesses and exchanges data over stdin/stdout. In debug mode, it listens for an incoming plugin connection over full-duplex TCP. For serverless execution, it invokes the packaged plugin over HTTP through the Serverless Runtime Interface (SRI), with AWS Lambda as an example target.
The repository separates the server entry point at cmd/server/main.go from command-line tooling under cmd/commandline/. The dependency manifest includes go-redis and redisotel, Prometheus, and OpenTelemetry instrumentation for Gin and HTTP. Redis supports caching, pub/sub, and distributed locks. This is Dify-specific execution infrastructure: it manages and routes plugins rather than selecting models or providing an independent agent runtime.
Key Capabilities & Differentiators
The daemon gives Dify a common management and invocation interface across three execution modes. Operators can run plugins alongside Dify, developers can attach a plugin to the debug listener, and serverless deployments can move plugin execution to an external platform without changing the Dify-facing HTTP interface. The separate Dify CLI supports local plugin development and is distributed via Homebrew and release binaries.
For Python plugins, uv manages dependencies. The daemon can probe official PyPI and candidate mirrors in parallel at startup, and an explicit PIP_MIRROR_URL overrides auto-detection. PLUGIN_IGNORE_UV_LOCK allows resolution without the lockfile when using a mirror, at the cost of potentially resolving different dependency versions. REDIS_KEY_PREFIX defaults to plugin_daemon and covers both keys and pub/sub channels; switching the prefix selects a new namespace without migrating existing cache or coordination data.
Trade-offs & Limitations
Compared with calling an AWS Lambda function directly, the daemon adds Dify workspace lifecycle management, a shared invocation interface, and local and debug execution paths. That integration is useful when Dify owns the plugin lifecycle but adds a service to deploy and monitor for a standalone function. Local mode avoids an external execution service, but Python initialization and plugin resource use share host capacity with Dify. Serverless mode shifts execution off-host while adding an HTTP and provider dependency.
The unreleased HTTP error-handling change is an upgrade consideration, not a guarantee of 0.6.16 behavior. Once the change is deployed, clients should use status and error codes rather than matching exception text. If a response stream fails after headers are sent, clients must treat the body as incomplete and discard partial results. Updating only some daemon nodes or leaving plugins on older SDK builds is insufficient to cover all paths that can expose exception details.
Hardware & Deployment Guide
The daemon supports Linux and macOS. For source deployment, copy .env.example to .env and configure database connectivity, including DB_HOST. The Go manifest declares Go 1.26.0 and toolchain go1.26.10. Install uv and point PYTHON_INTERPRETER_PATH at Python 3.11 or newer for local Python plugins. The server entry point is cmd/server/main.go, and the database migration command is go run ./cmd/commandline/ migrate.
In Docker, use a Docker-managed volume for the shared plugin working directory; network volumes and off-host mounts can delay plugin startup. Do not assume the community edition will scale cleanly by adding Kubernetes replicas. Release 0.6.14 fixed JSON preservation across agent calls and history; 0.6.15 added periodic activation for long-running serverless invocations and fixed multipart temporary-file cleanup; 0.6.16 updated brotli, x/net, and compress for CVEs.
Self-hosted Dify operators who need workspace-scoped plugin management, and plugin developers who need local execution or TCP debugging before deploying to a serverless runtime.
You need a standalone agent framework, only invoke functions outside Dify, or require a community daemon that scales smoothly by adding Kubernetes replicas.
Quick Start & Installation
brew tap langgenius/dify brew install dify
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| dify-plugin-daemon ★ | 463 | +1 | Go | Apache-2.0 | Go daemon for Dify plugin lifecycle and local, debug, and serverless execution |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| ag-ui | 22.6k | +611 | TypeScript | MIT | A typed event protocol and SDKs that connect agent backends to interactive apps |
| ruflo | 82.8k | +342 | TypeScript | MIT | A TypeScript orchestration layer for coding agents, with shared memory and MCP |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/langgenius/dify-plugin-daemon.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about dify-plugin-daemon
Where does the daemon sit in a Dify plugin invocation?
Does the daemon need a GPU, and what should I measure for sizing?
Can we self-host it commercially under Apache-2.0?
Why use the daemon instead of calling AWS Lambda directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy