ANIDIAGRAM / SOURCE-BACKED CASE STUDY SOURCE-READING DRAFT
From documents to answers.
How do Dify’s three layers work?
Uploading a file does not finish a knowledge index. Online chat does not always go through a task queue. Follow both paths across real service and storage boundaries.
Document ingestionOnline chatShared interfaces
Same architecture and source evidence; presentation only.
10 nodes · 13 selected relationships · Three logical layers, not three deployed services. Switch between “Document ingestion” and “Online chat” in the interactive viewer. On small screens, open it and zoom in. Arrows show calls or task delivery, not a complete execution sequence.
Indexing is queued. The chat path shown here is not.
Basic CHAT retrieves knowledge, assembles context and calls the model in a new thread inside the API process. A separate Celery Worker extracts, splits and embeds documents, then writes the index.
Pinned source: Dify 1.17.0 · 09a855d
This architecture draft is based on source reading. Verified references do not establish semantic accuracy. Independent semantic review is pending; Dify has not been run and no real model calls were made.
What does this diagram include—and leave out?
- Scope: self-hosted Dify, local text files,
high_quality paragraph indexing, basic AppMode.CHAT, a configured and selected internal dataset with semantic retrieval, and successful paths.
- Three data forms: original files in file storage; metadata and chunks in SQL; vector indexes in the vector database. PostgreSQL and Weaviate are the choices shown here, not the only supported stores.
- The indexing Worker is a separate Celery process. Chat and RAG code within the API are not additional microservices.
- A Redis query-embedding cache hit skips the embedding-model call. Dataset routing may call an LLM first, so the edges are not a strict execution order.
- Model calls are traced only to the Plugin Daemon HTTP interface. Its separate repository and specific provider plugins have not been reviewed; downstream calls are not drawn as verified relationships.
- Workflow, Chatflow, Agent, knowledge pipelines, multimodal processing, reranking, errors, retries, Web server hosting and other database/cache accesses are excluded.
Ask another Agent to review this case
Use AniDiagram to analyze langgenius/dify at the pinned commit
09a855dcef24c0edc7431c46c0cfaa494481daf5 (1.17.0).
Trace high_quality paragraph indexing of local text files and basic CHAT
using semantic_search on a selected internal dataset to generate an answer.
Check when documents are committed and indexing tasks are dispatched.
Which process owns the Chat worker thread? What do files, SQL, Redis and
the vector database store? How do embedding cache hits change model calls?
Distinguish modules from deployed services. Do not route all chat through Celery.
Give pinned source references for each key edge. Review semantics before visuals.
Source index and build commands · Fact-check report · Semantic Plan