# Repository Briefing: langgenius/dify-plugin-daemon
> Source: https://repoforai.com/repo/langgenius/dify-plugin-daemon (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/langgenius/dify-plugin-daemon
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Go
- **License**: Apache-2.0
- **Engineering Health**: A+ (95/100 · Maintenance 35/35 · Adoption 20/25 · Releases 20/20 · License 20/20)
- **Latest Release**: 0.6.16 (2026-11-30) — https://github.com/langgenius/dify-plugin-daemon/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Self-Hosted, CLI
- **Momentum**: 463 ★ total (+0 24h / +1 7d) · 328 forks
- **When to Use**: Best for: 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. Skip if: You need a standalone agent framework, only invoke functions outside Dify, or require a community daemon that scales smoothly by adding Kubernetes replicas.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Runtime routing: one Dify-facing HTTP API dispatches to subprocess stdio, full-duplex TCP, or serverless HTTP.
- Workspace lifecycle: the daemon exposes which plugins are installed in each Dify workspace and handles invocation requests.
- Python setup: uv manages plugin dependencies; PyPI mirrors can be probed at startup or selected explicitly.
- Redis isolation: REDIS_KEY_PREFIX namespaces keys and pub/sub channels; changing it does not migrate existing data.
- Observability dependencies: go.mod includes Prometheus, OpenTelemetry instrumentation for Gin and HTTP, and Redis instrumentation via redisotel.
- Developer tooling: the Dify CLI is available via Homebrew or release binaries; Homebrew supports Linux and macOS on arm64 and amd64.
```

## Quick Start / Clone
```bash
brew tap langgenius/dify
brew install dify
```
