mirror of
https://github.com/langgenius/dify.git
synced 2026-09-02 22:36:15 +08:00
74 lines
4.3 KiB
Plaintext
74 lines
4.3 KiB
Plaintext
# ------------------------------------------------------------------
|
|
# KnowledgeFS integration service (started by the default Dify Compose deployment).
|
|
# Copy to knowledge-fs.env and configure durable dependencies before enabling product traffic.
|
|
# The Dify product flag remains disabled by default and no public proxy route is added.
|
|
# Dify inner API connection values and integrated mode are injected by docker-compose.yaml.
|
|
# Physical object storage is owned by Dify's configured STORAGE_TYPE and credentials; do not copy
|
|
# provider endpoints, bucket names, access keys, or secret keys into this service.
|
|
# Optional feature flags and capacity tunables use safe runtime defaults and belong here only when
|
|
# an operator intentionally enables or overrides that feature.
|
|
# ------------------------------------------------------------------
|
|
|
|
# Required durable database. Do not point this at Dify's application database or reuse
|
|
# Dataset/Document tables. Apply KnowledgeFS migrations before starting product traffic.
|
|
DATABASE_URL=
|
|
KNOWLEDGE_DOCUMENT_COMPILATION_RUNTIME=on
|
|
|
|
# PDF image elements are rasterized by the Poppler executable bundled in the API image. The
|
|
# limits are per document/asset operation. Set the mode to off as an emergency or low-resource
|
|
# kill switch; do not set a host-specific command path when using the published image.
|
|
KNOWLEDGE_PDF_RASTERIZER=poppler
|
|
KNOWLEDGE_PDF_RASTERIZER_DPI=144
|
|
KNOWLEDGE_PDF_RASTERIZER_THUMBNAIL_DPI=48
|
|
KNOWLEDGE_PDF_RASTERIZER_TIMEOUT_MS=30000
|
|
KNOWLEDGE_PDF_RASTERIZER_MAX_ASSETS=500
|
|
KNOWLEDGE_PDF_RASTERIZER_MAX_CONCURRENCY=2
|
|
|
|
# Ingestion-time LLM concurrency. The per-document outline limit improves one document's latency;
|
|
# the process-wide fair limit prevents simultaneous imports from multiplying provider pressure.
|
|
# The global value is per API replica and also covers embedding transport requests.
|
|
KNOWLEDGE_OUTLINE_SUMMARY_MAX_CONCURRENCY=8
|
|
KNOWLEDGE_OUTLINE_SUMMARY_BATCH_SIZE=8
|
|
KNOWLEDGE_OUTLINE_SUMMARY_BATCH_MAX_INPUT_CHARS=32000
|
|
KNOWLEDGE_MODEL_RUNTIME_GLOBAL_CONCURRENCY=16
|
|
KNOWLEDGE_SEMANTIC_EXTRACTION_BATCH_SIZE=8
|
|
KNOWLEDGE_SEMANTIC_EXTRACTION_MAX_CONCURRENCY=4
|
|
# Dify/plugin-daemon embedding requests carry at most 16 texts each. Two concurrent requests
|
|
# improve large-document latency while keeping high-dimensional response memory bounded.
|
|
KNOWLEDGE_EMBEDDING_REQUEST_CONCURRENCY=2
|
|
|
|
# Required before enabling integrated product traffic. Set ENABLED=true only after providing the
|
|
# public-only current/previous JWKS that matches Dify's signer. Never copy Dify's private key here.
|
|
KNOWLEDGE_FS_CAPABILITY_V2_ENABLED=false
|
|
KNOWLEDGE_FS_CAPABILITY_V2_PUBLIC_JWKS=
|
|
|
|
# Internal Dify API-to-KnowledgeFS data paths. These flags do not expose browser CORS routes.
|
|
# Integrated document staging depends on upload sessions. The 32 MiB fallback covers Dify's
|
|
# current 15 MiB document limit without copying provider credentials into KnowledgeFS.
|
|
KNOWLEDGE_DIRECT_UPLOAD_ENABLED=on
|
|
KNOWLEDGE_DIRECT_UPLOAD_SMALL_FALLBACK_MAX_BYTES=33554432
|
|
# Enable Research task SSE only when the durable task progress repository is ready.
|
|
KNOWLEDGE_DIRECT_STREAM_ENABLED=off
|
|
# One generous cap avoids a second full Judge call when a reasoning model consumes hidden tokens.
|
|
# Judge prompts still require compact JSON and supported OpenAI reasoning models use low effort.
|
|
KNOWLEDGE_RESEARCH_REASONING_MAX_OUTPUT_TOKENS=8192
|
|
KNOWLEDGE_RESEARCH_REASONING_TIMEOUT_MS=60000
|
|
|
|
# Optional image-query retrieval. This remains off unless the existing visual-embedding provider,
|
|
# model/plugin selection, visual index, and query mode are configured for the deployment.
|
|
KNOWLEDGE_QUERY_IMAGE_RETRIEVAL_ENABLED=false
|
|
# Deep/Research perform at most one vision expansion per query; durable Research retries reuse it.
|
|
KNOWLEDGE_QUERY_IMAGE_EXPANSION_TIMEOUT_MS=8000
|
|
|
|
# Complex-document parser reachable from the default Compose network or an external endpoint.
|
|
# Leave both values blank only when PDF/Office parsing is intentionally unavailable.
|
|
UNSTRUCTURED_API_URL=
|
|
UNSTRUCTURED_API_KEY=
|
|
# Bound parser fan-out independently from the document-compilation batch size.
|
|
UNSTRUCTURED_MAX_CONCURRENCY=2
|
|
UNSTRUCTURED_REQUEST_TIMEOUT_MS=120000
|
|
UNSTRUCTURED_MAX_RESPONSE_BYTES=33554432
|
|
|
|
# Bound authenticated Dify object-storage calls so cleanup cannot hang a compilation lease forever.
|
|
DIFY_OBJECT_STORAGE_REQUEST_TIMEOUT_MS=60000
|