Dify is an open-source LLM application development platform that serves as a visual workflow builder, agent orchestration engine, RAG pipeline, and LLMOps backend-as-a-service. In production, it enables users to create, deploy, and monitor AI-powered applications including chatbots, text generation, autonomous agents, and complex multi-step workflows. The architecture is a monorepo consisting of a Python/Flask API backend with SQLAlchemy and Alembic migrations, a Next.js web console, a TypeScript CLI (difyctl), a Go-based agent runtime sandbox, and shared packages for contracts and UI components. Key entry points include the console web app for building and managing apps, the service API for integrating external systems, and the OpenAPI surface for third-party clients. Primary data flows involve user authentication, workflow execution (triggered by APIs, schedules, or webhooks), knowledge ingestion and retrieval (document extraction, chunking, embedding, vector search), and agent invocation (tool calls, LLM interactions). External dependencies include multiple vector databases (pgvector, Qdrant, Weaviate, etc.), LLM providers (OpenAI, Anthropic, etc.), object storage (S3, Azure Blob, etc.), Redis, Celery, and various observability backends (OpenTelemetry, Langfuse, etc.). The platform supports multi-tenancy, RBAC, billing, and enterprise features, and is deployed via Docker Compose, Kubernetes, or cloud-specific distributions.
AnythingLLM is a full-stack, self-hosted AI chat platform designed for Retrieval-Augmented Generation (RAG) over private documents. It provides a web interface where users create workspaces, upload documents (PDF, DOCX, images with OCR, audio, etc.), which are then chunked, embedded, and stored in a vector database (default LanceDB, with support for PGVector, Pinecone, Qdrant, and others). Chat queries retrieve relevant document chunks and feed them to an LLM of choice (supporting 30+ providers including OpenAI, Anthropic, Ollama, and local models via KoboldCPP). The platform also features an extensible agent system (aibitat) with plugins for file system operations, SQL databases, Gmail, Google Calendar, web scraping, image generation, and scheduled jobs. A separate 'collector' microservice handles document ingestion and format conversion, while the 'open-computer' subproject provides a QEMU-based virtual machine for autonomous browser automation. The frontend is a React SPA with multi-user support, role-based access, internationalization, embeddable chat widgets, and a community hub for sharing agent skills, system prompts, and slash commands. The architecture is a monolith (Express server) with the collector as an isolated service, and the open-computer as a standalone CLI/service. It relies on external AI APIs, vector databases, and local storage, making it suitable for both cloud and on-premises deployment.