$ show knowflow-ai/KnowFlow
KnowFlow (forked from RAGFlow) is a full-stack enterprise Retrieval-Augmented Generation (RAG) platform. It ingests documents (PDF, DOCX, Excel, images, etc.) via multiple parsing engines (DeepDOC, MinerU, PaddleOCR, DOTS), chunks them using configurable strategies (naive, smart, title, regex, parent-child, etc.), embeds them via LLM providers, and stores vectors in Elasticsearch/OpenSearch/Infinity. The platform provides a visual agent builder (React Flow canvas) where users compose workflows from nodes (retrieval, generate, categorize, iterate, code execution, etc.) and tools (web search, email, SQL, financial data, etc.). It also offers chat interfaces with SSE streaming, knowledge base management with RBAC, team sharing, and a Python SDK. The architecture is a Flask backend with separate task executors and a sandboxed code execution service, deployed via Docker Compose with MinIO, MySQL, Redis, and optional OCR microservices. The frontend is primarily React (with a legacy Vue codebase), using Ant Design and shadcn/ui components.
The LLM identified 4 files worth highlighting for reuse:
Implements a generic Switch component for agent workflows that routes execution based on conditional operators (contains, empty, numeric comparisons, etc.) with logical AND/OR grouping. It is self-contained, parameterized via JSON DSL, and can be extracted into any workflow engine with minimal modification.
A resume parsing module that extracts structured information (name, education, work experience, skills) using custom entity dictionaries (schools, corporations, industries, regions) with ranking and frequency data. The module is isolated, uses its own data files, and demonstrates non-obvious skill in entity recognition without deep learning.
A Docker-based code execution manager that runs user-submitted code in isolated containers with memory limits, timeout enforcement, and seccomp profiles. It provides a REST API for execution and supports multiple languages. The pattern is reusable for any platform needing secure code execution.
A Lexical-based rich text editor component that supports variable insertion (e.g., {{question}}, {{context}}) via custom plugins and nodes. It is self-contained, themeable, and can be extracted into any React application needing a prompt editor with dynamic variable support.