Dify LLM Application Development Platform
repository·main·Indexed 12 days ago
https://github.com/langgenius/difyAn open-source LLM application development platform providing a visual interface for AI workflows, RAG pipelines, and agentic capabilities. It features a modular provider architecture for Vector Databases (VDB) and observability tracing, including Enterprise telemetry support via OpenTelemetry (OTEL) for integration with Prometheus, Grafana, Jaeger, and Honeycomb.
What's inside Dify
- The Deployment Access Permissions feature provides the environment permission section used for viewing and editing access policies on deployment environments. It allows administrators to manage who has access to specific deployment environments through defined access policies.
Overview of Agent V2 Configuration Runtime
mainThe
agent-v2/agent-detail/configurefeature manages the runtime for the Agent V2 configuration interface. This includes the Agent App configuration page and the inline Agent configuration surface within workflows.Key capabilities managed by this module include:
- Editable Composer Drafts: Wiring for managing unsaved changes in the agent composer.
- Chat Session Building: Constructing and managing chat sessions for testing.
- Version Management: Viewing different versions of the agent configuration.
- Draft Mode: Building and managing agent drafts before deployment.
- Previewing: Providing side panels for real-time previewing of agent behavior.
Overview of Dify Agent runtime
mainDify Agent is a runtime that hosts Agenton-composed Pydantic AI runs via a FastAPI API. It is structured into two main components:
- Dify Agent Logic: Located in
src/dify_agent, containing the specific implementation for Dify. - Agenton Framework: Located in
src/agentonandsrc/agenton_collections, providing framework-neutral code used to compose agents.
For details on managing the local server, refer to the operations guide.
- Dify Agent Logic: Located in
What is Dify?
mainDify is an open-source LLM app development platform designed to take applications from prototype to production. It provides a visual interface for building AI workflows and includes several core capabilities:
- Workflow: A visual canvas for building and testing complex AI workflows.
- Model Support: Integration with hundreds of proprietary and open-source LLMs (e.g., GPT, Mistral, Llama3) via various providers or OpenAI-compatible APIs.
- Prompt IDE: Tools for crafting prompts, comparing model performance, and adding features like text-to-speech.
- RAG Pipeline: End-to-end Retrieval Augmented Generation capabilities, including document ingestion (PDF, PPT, etc.) and retrieval.
- Agent Capabilities: Support for LLM Function Calling or ReAct agents with over 50 built-in tools (e.g., Google Search, DALL·E, WolframAlpha).
- LLMOps: Observability features to monitor application logs and performance, with integrations for Opik, Langfuse, and Arize Phoenix.
- Backend-as-a-Service: Full API coverage for all Dify offerings to integrate them into existing business logic.
Overview of Deployment Instances route
mainThe Deployment Instances route is responsible for listing all environment deployments and providing an interface to execute row-level actions on specific running deployments.Overview of Dify core features
mainDify is an open-source LLM app development platform designed to move prototypes to production quickly. Key capabilities include:
- Workflow: Visual canvas for building and testing AI workflows.
- Comprehensive Model Support: Integration with hundreds of proprietary and open-source LLMs (GPT, Mistral, Llama3, etc.) via OpenAI-compatible APIs.
- Prompt IDE: Interface for prompt engineering, model comparison, and adding features like text-to-speech.
- RAG Pipeline: End-to-end Retrieval Augmented Generation, including document ingestion (PDF, PPT, etc.) and retrieval.
- Agent Capabilities: Support for LLM Function Calling or ReAct agents with 50+ built-in tools (e.g., Google Search, DALL·E, WolframAlpha).
- LLMOps: Observability for monitoring application logs, performance, and production data annotations.
- Backend-as-a-Service: Full API coverage for all Dify features to allow integration into existing business logic.
Overview of the New RAG Feature
mainThe New RAG feature in Dify provides a comprehensive interface for managing Retrieval-Augmented Generation (RAG) workflows. It is built upon a
KnowledgeFSbackend and handles the following core functionalities:- Knowledge Management: Rendering knowledge lists and managing knowledge spaces.
- Creation Flows: Facilitating the creation of new knowledge bases through various workflows.
- Source & Document Management: Managing data sources, individual documents, and document versions.
- Processing Tasks: Monitoring and managing document processing, chunking, and re-indexing tasks.
Overview of the Deployments List feature
mainThe Deployments List is a feature page designed for browsing app instances. It provides capabilities to:
- Filter deployments: Search for specific instances using keywords or filter by environment.
- Monitor status: View deployment status via rendered status cards.
- Manage instances: Access deployment actions and release creation entry points directly from the list view.
Deployment Instances Row Actions Overview
mainThe
row-actionsmodule provides the UI components for managing environment deployments at the row level within the deployment interface. It specifically handles the row action menu and the associated dialogs required for three primary lifecycle operations:- Deploying: Initiating a new deployment for an environment.
- Redeploying: Triggering a redeployment of an existing environment.
- Undeploying: Removing an existing environment deployment.
This module coordinates with internal modules to manage the deployment drawer and ensure the correct application instance identity is used during mutations.
Console API Overview
mainThe Console API (Version 1.0) provides management endpoints for Dify administration, including account management, app configuration, and monitoring.
Available Account Endpoints:
GET /account/avatar: Retrieve account avatar.POST /account/avatar: Update account avatar.POST /account/change-email: Initiate email change.POST /account/change-email/check-email-unique: Verify if a new email is unique.POST /account/change-email/reset: Reset email change process.POST /account/change-email/validity: Check email change validity.POST /account/delete: Delete account.POST /account/delete/feedback: Provide feedback during account deletion.
Manage Deployment API Tokens
mainThe API token management feature allows users to manage API endpoints, create new tokens, and list existing tokens for a specific deployment. This interface is used to handle the lifecycle of API keys required for programmatic access to the Dify deployment.Review dify-agent-runtime architecture and components
mainThe
dify-agent-runtimeis composed of several key binaries and internal components:shellctl: The main server binary (run viashellctl serve).sanitize-pty: A tmuxpipe-panePTY sanitizer that filtersstdintostdout.runner-exit: A post-drain SQLite exit recorder.dify-agent-cli: A CLI tool used to communicate with the agent backend.runner: A process runner used to bootstrap agent commands.internal/: Contains the core implementation logic.