skygazer42/MimirQ
About
A Chinese-first enterprise RAG knowledge base with controllable parsing, governance, chunking, hybrid retrieval, reranking, citations, graphs, evaluation, and Dify integration.
AI & Machine LearningMeasured star growth
- in 24h
- 0
- in 7 days
- +4
- in 15 days
- +14
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_EN.md
Original
MimirQ
Full-stack, open-source, Chinese-first enterprise RAG knowledge base
Turns parsing, governance, chunking, retrieval, reranking, and citations into an inspectable, replaceable, regression-tested knowledge pipeline.
Why MimirQ · Screenshots · Quick Start · Dify Integration · 800-question benchmark · v1.0.1 Release Notes
Why MimirQ
The hard part of an enterprise knowledge base is not embedding documents. It is locating failures, replacing strategies, and proving quality did not regress.
MimirQ began with a real government knowledge-base delivery. When an answer was wrong, the team needed to determine whether parsing lost a table, governance missed a rule, chunking broke the meaning, retrieval missed the evidence, reranking misplaced it, or generation departed from its citations. Hiding that path behind an “upload and chat” button makes prototypes fast, but long-term delivery difficult to estimate, validate, and govern.
A controllable enterprise knowledge pipeline
Assess data→Select parsers→Govern content→Chunk by domain
→Vector / full-text index→Hybrid retrieval→Rerank and cite→Golden regression
A real project starts with representative samples: measure scanned pages, images, tables, formulas, and layout complexity; validate parser quality; and estimate compute and review costs. Complex layouts and scans can start with MinerU or DeepDoc, formula-, table-, or layout-heavy material should include Docling in the evaluation, and digitally born Office or plain-text files can begin with a lighter path such as MarkItDown. High-risk corpora still require human review.
After scripts, rule DSLs, or plugins govern the parsed output, content is chunked by headings, sections, business records, or parent-child structure instead of one fixed length and overlap window. The index can combine Milvus or another vector store with BM25, vector retrieval, and reranking. The application above it can be Dify, LangGraph, PydanticAI, or a small API service.
MimirQ does not try to replace every platform:
- For simple, stable, low-code applications, Dify or RAGFlow is usually the faster path.
- For an integrated DeepDoc and GraphRAG experience, RAGFlow is a mature choice.
- When the knowledge path must be replaceable, auditable, and regression-tested, MimirQ keeps that capability independent from the chat application and can serve as Dify's external knowledge layer.
The repository currently covers 30 parsing backends, 86 chunking strategies, 13 reranker families, and a fixed 800-question evaluation trail. Those counts show breadth; the product goal is to inspect every stage, trace citations and versions, and protect releases with Golden sets. See the enterprise knowledge-pipeline design principles.
Latest stable release: v1.0.1. See the release notes and release index.
Product Screenshots
These screens use the public government-service plugin samples included in the repository. No production knowledge-base data is shown.
Knowledge Graph Search and analyze entities, events, and relations on one canvas. |
|
Dataset Management Track datasets, documents, chunks, and ingestion status in one place. |
Golden Regression Evaluation Inspect golden cases, run history, Recall, MRR, and related metrics together. |
System Settings Review dependency health, parsing capabilities, and model-service integrations. |
Conversation History and Evidence Search previous sessions and review complete answers, sources, and feedback controls. |
Ingestion Execution Monitor Track parsing, chunking, governance, export, and retry status per dataset. |
Data Governance Preview documents and run quality checks, cleaning, and annotation in one workspace. |
Quick Start
Prerequisites
- Docker 20.10+ & Docker Compose 2.0+
- GNU Make; Docker startup also needs Python 3.9+ to generate local config
- Source development mode also needs Python 3.11+, Node.js 20+, and pnpm 10.26
- At least 4 CPU cores / 16 GB RAM / 50 GB disk
Initialize
git clone --depth 1 --single-branch https://github.com/skygazer42/MimirQ.git
cd MimirQ
make init
make init creates only missing .env and web/.env.local files. Edit .env for the selected deployment:
- Default model calls:
LLM_API_KEY(required) - Custom LLM:
LLM_API_BASE,LLM_MODEL - Separate embedding service:
EMBEDDING_API_BASE,EMBEDDING_API_KEY,EMBEDDING_MODEL - Reranker:
ENABLE_RERANKER,RERANKER_API_BASE,RERANKER_API_KEY,RERANKER_MODEL - Initial administrator:
INITIAL_ADMIN_EMAIL,INITIAL_ADMIN_USERNAME,INITIAL_ADMIN_PASSWORD
See Model Services and Initial Administrator Configuration for values, separate-service examples, and bootstrap rules.
For the full path from dataset creation and ingestion through retrieval, cited answers, governance, evaluation, Dify, and operations, use the online operation guide.
| Startup mode | Best for | Where the app runs |
|---|---|---|
| Docker (recommended) | First use and server deployment | Web, API, worker, and dependencies run in containers |
| Source development | Frontend/backend development and hot reload | .venv + pip run the API, pnpm runs the Web app, and Docker runs infrastructure |
Option 1: Start everything with Docker
make up-web
make api-ping
Open http://localhost:3000 after startup. If no administrator was preconfigured, register the first account in the UI. First-build, proxy, production-secret, and network guidance is in the Docker Compose deployment guide.
Use make down to stop the stack, make docker-reset to delete persisted data, or make docker-purge to also delete this project's service images. MimirQ uses the isolated Compose project name mimirq, so a Dify stack on the same host is not part of its cleanup scope. The last two commands are destructive; see the Docker Compose deployment guide for PowerShell commands, ownership checks, legacy-data migration, recovery, and the exact deletion scope.
Optional parsers by document workload
MimirQ uses built-in DeepDoc by default. Start other parsers only when required:
| Document workload | Recommended parser | Extra requirement | Start after the main stack |
|---|---|---|---|
| Regular PDF / Office / text | Built-in DeepDoc | None | No extra container |
| PDF to Markdown without a server GPU | Marker | CPU | make up-marker |
| Mixed layout, tables, and images | ETL4LLM | CPU | make up-etl4llm |
| Scans, OCR, and complex layouts | PaddleOCR-VL | NVIDIA GPU; reserve 10 GiB | make up-paddlevl |
| PDFs with many tables, formulas, and images | MinerU pipeline | NVIDIA GPU; first-run model download | make up-mineru |
| VLM-based complex PDFs | MinerU VLM | NVIDIA GPU; high resource use | make up-mineru-vlm |
| High-accuracy PDF OCR | olmOCR | NVIDIA GPU; 48-GiB-class VRAM recommended | make up-olmocr |
| Formula/table PDF to Markdown | MagicPDF | NVIDIA GPU | make up-magicpdf |
| PDF/image OCR through an external vision model | Qianfan-OCR | Upstream URL and API key; no local GPU | make up-qianfanocr |
See the Docker Compose deployment guide and parser documentation for full settings and platform limits.
Option 2: Develop from source (Python venv + pip + pnpm)
This is the conventional local-development path and does not require Conda. FastAPI runs from a Python .venv, Next.js runs with pnpm, and Docker is used only for infrastructure such as PostgreSQL, Redis, and Milvus:
make setup-host
make setup-host creates .venv, installs the pip and pnpm dependencies, prepares parser models, and starts the Docker infrastructure. The default in-process background mode requires two terminals:
# Terminal 1: FastAPI with hot reload
make backend
# Terminal 2: Next.js with hot reload
make web
See Model Services and Initial Administrator Configuration for the optional worker configuration. Verify the host services with:
make api-ping
After stopping the host processes, run make infra-down to stop the dependency services.
Service URLs
| Service | URL |
|---|---|
| Frontend UI | http://localhost:3000 |
| API Docs | http://localhost:8000/docs |
For a lighter setup, use
make up-lite; runmake webseparately when the UI is required.
Advanced model, parser, proxy, and Windows guidance is in the Development Guide. The public government-service sample is documented in the plugin guide.
Dify Integration
MimirQ can plug into existing Dify applications as a governable RAG layer, without re-implementing the workflow canvas. Two integration modes are supported today:
- External Knowledge API: Dify handles orchestration and generation; MimirQ handles document governance, retrieval, reranking, permission filtering, and evidence return.
- Workflow HTTP node: Dify handles custom routing and parameters; MimirQ returns evidence and a trace scoped to the requested knowledge range.
Workflow HTTP node
A real Dify HTTP sub-chain (redacted): safely build the JSON request → HTTP node calls MimirQ's retrieval endpoint → transform the result → merge knowledge evidence.
External Knowledge API
A real Dify Chatflow (redacted): the green knowledge-retrieval node calls MimirQ through the External Knowledge API, then merges evidence uniformly; click to view the full image.
The regional routing in the diagram comes from the optional sample plugin; the MimirQ core ships no region, service-item, or industry rules.
The standard Dify external-knowledge endpoint is POST /api/v1/integrations/dify/retrieval; POST /api/v1/integrations/dify/conversation-turns optionally reports answers, citations, and a conversation identifier. See .env.example for configuration, the readiness gate for pre-deploy validation, and Real-world Validation for measured results.
Core Feature Comparison
Expand to compare with Dify, RAGFlow, FastGPT, AnythingLLM, and LangChain
| Capability | MimirQ | Dify | RAGFlow | FastGPT | AnythingLLM | LangChain |
|---|---|---|---|---|---|---|
| Document parsing | 30 backends for PDF, OCR, layout, tables, formulas, and VLM | Knowledge Pipeline for PDF, PPT, and other common formats | DeepDoc for complex layouts and scans; MinerU / Docling | PDF and scans with tables and formulas converted to Markdown | Document pipeline for PDF, TXT, DOCX, and more | Document Loaders and third-party parser integrations |
| Chunking | 86 strategies including recursive, semantic, parent-child, RAPTOR, and late chunking; visual preview | General, parent-child, Q&A, and pipeline-defined processing | Template-based chunking with visual human intervention | Automatic, manual, Q&A, and enhanced processing | Automatic document-pipeline chunking | Text Splitters composed in application code |
| Retrieval / reranking | Milvus / FAISS / Chroma + BM25 / SPLADE / ColBERT / LTR / RRF; 13 rerankers | Semantic, full-text, and hybrid retrieval with optional reranking | Multiple recall with fused reranking | Semantic, full-text, and hybrid retrieval + RRF + reranking | Multiple vector databases with source citations | Retriever and reranker components assembled by the application |
| Knowledge graph | Entity, relation, and event extraction; entity resolution, community discovery, and multi-hop retrieval | Connected through workflows, plugins, or external services | Built-in GraphRAG | Connected through workflows or external services | Connected through agents or tools | Graph integrations and custom chains |
| Agents / MCP | LangGraph agents, Self-RAG / CRAG / FLARE, and MCP client / server | Function Calling / ReAct agents, tools, and MCP | Agentic Workflow, MCP, and code executor | Agent V2, tools, MCP, and VM execution | No-code Agent Builder, MCP, and scheduled tasks | Agents / LangGraph / MCP with a code-first model |
| Visual workflows | No general node canvas; focused on RAG debugging, governance screens, and APIs | Core feature for application and agent orchestration | Agent and ingestion-pipeline orchestration | Core feature with flow-node orchestration | No-code Agent Builder | No built-in product UI; supplied by the application |
| Evaluation / governance | RAGAS, regression gates, leaderboard, significance tests, and evidence audits | Run logs, observability, and human annotations | Retrieval tests, chunk inspection, and citation tracing | Runtime details, retrieval debugging, and logs | Source citations; no built-in RAG regression gate | Requires LangSmith or a custom evaluation stack |
| Safety guards | InputGuard / OutputGuard, PII / secret redaction, and hop-by-hop SSRF validation | Moderation nodes and workflow rules | Sandboxed code execution; business guards require configuration | Workflow-based content review and VM sandbox | Local-first deployment and agent-tool permissions | Implemented through application middleware and deployment boundaries |
| Enterprise access / compliance | Document ACL + Security Trimming, RBAC, SCIM / SSO / SAML, and audit logs | Workspace permissions; organization and SSO features in enterprise editions | Account and API authentication; fine-grained compliance is deployment-specific | ABAC + RBAC for teams, groups, and resources | Multi-user permissions in the Docker edition | Not supplied by the framework; implemented by the application |
| RAG debugging UI | Chunk preview, retrieval trace, rerank steps, sentence citations, KG, and evaluation dashboards | Dataset tests, workflow traces, and application logs | Chunk visualization, matched passages, and citations | Knowledge-base tests and workflow runtime details | Workspaces, source citations, and chat UI | No built-in UI; connect an observability platform |
| Dify external knowledge | Native Dify External Knowledge API compatibility | Native external-knowledge consumer | Requires an API adapter | Requires an API adapter | Requires an API adapter | Build an adapter in application code |
| Getting started | Docker Compose / Helm with a complete enterprise RAG stack | Docker Compose / Cloud | Docker Compose; official baseline is 4 cores / 16 GB / 50 GB | Docker / Cloud | Desktop / Docker | Python / JS library; assemble the application yourself |
This comparison reflects the capability surface directly exposed by public releases and official documentation as of 2026-07; it is not a uniform benchmark. Plugins, commercial editions, and later releases may change individual entries.
Real-world Validation
MimirQ has powered a municipal government Q&A assistant across seven district-level and one city-level knowledge base. On 2026-07-27, the same fixed 800 questions were rerun with real self-hosted models; all five paths ultimately completed 800 / 800.
“Retrieval core” is not LLM question answering. It runs embedding, hybrid retrieval, and reranking, then returns Top-K evidence directly. “RAG generation” continues by asking an LLM to produce the answer.
Retrieval Core (No LLM Generation)
| Evidence path | Accuracy | Usability | Evidence coverage | Latency (mean / P95) |
|---|---|---|---|---|
| MimirQ retrieval core | 98.9% | 100% | 99.5% | 3.64s / 12.58s |
End-to-End Answers (With LLM Generation)
| Answer path | Accuracy | Usability | Coverage (evidence / answer) | Latency (mean / P95) |
|---|---|---|---|---|
| MimirQ RAG generation | 90.9% | 100% | 99.7% / 96.6% | 2.59s / 8.15s |
| Dify HTTP → MimirQ | 64.3% | 92.1% | 96.3% / 83.6% | 13.15s / 17.33s |
| Dify External → MimirQ | 62.7% | 91.7% | 99.7% / 83.8% | 12.14s / 23.49s |
| Dify native knowledge¹ | 38.6% | 74.5% | 83.8% / 66.1% | 13.67s / 29.55s |
¹ Dify native knowledge does not use MimirQ. See the detailed report for accurate, partially accurate, and insufficient-evidence counts.
Dify HTTP / External reached 96.3% / 99.7% retrieval-evidence coverage, while generated-answer clause coverage was 83.6% / 83.8%. The main loss was in Dify answer generation rather than MimirQ retrieval.
Test boundary, concurrency, and generality notes
- The retrieval core returns evidence; the other four paths return generated answers. Accuracy and latency across the two tables are not direct like-for-like comparisons.
- Retrieval concurrency 5 initially triggered 15 configured admission-backpressure responses. Retrying only those cases at concurrency 3 restored 800 / 800.
- MimirQ contains no region, service-item, or question-specific special cases. A generic retrieval layer shards multi-dataset requests across different embedding runtimes.
Full methodology, metric definitions, and historical reruns · Dify integration modes and real workflows
Deployment Options
Supported deployment modes:
| Mode | Command | Description |
|---|---|---|
| Standard | make up |
Full stack: Postgres + Milvus + Etcd + MinIO + Redis + API + Worker |
| Standard + Web | make up-web |
Recommended first run; initializes local config and starts the complete web stack |
| Lite Mode | make up-lite |
Chroma/FAISS instead of Milvus, no MinIO — quick evaluation |
| Dev Mode | make infra-up |
Infrastructure only, run backend/frontend locally |
| Helm / K8s | helm install |
Production-grade with HPA, PDB, CronJob, PrometheusRule |
| Parser Extensions | Docker Compose guide | Start CPU / GPU profiles as required |
See the Docker Compose guide, Helm guide, and runbook for production settings and upgrade order.
Feature Guides
| Guide | Description |
|---|---|
| Chunk Preview | Visual document chunking and parameter tuning |
| Knowledge Graph | KG extraction, visualization, and RAG enhancement |
| Document ACL | Document-level access control & security trimming |
| URL Import | Remote URL fetching and batch import |
| Document Versions | Pipeline version management and rollback |
| Sparse Retrieval | SPLADE sparse retrieval channel |
| ColBERT Reranking | ColBERT late-interaction reranking |
| RAG Optimization | Retrieval and answer quality optimization |
| Retrieval Debugging | Retrieval issue diagnosis |
| SAML SSO | SAML single sign-on integration |
| Public Benchmarks | Reproducible Chinese benchmarks (MIRACL-zh / CFEVER) |
| Quick Start | Development from source |
| Runbook | Production operations & troubleshooting |
Development
Run CI-consistent checks before pushing (backend + frontend):
# Full check (backend lint/test + frontend lint/test)
make enterprise-checks
# Backend only
make verify && make test
# Frontend only
cd web && pnpm lint && pnpm test
Roadmap
Delivered capabilities are in the comparison table above. Near-term plans:
- RAG-specific debugging orchestration (not a general agent canvas)
- More data-source connectors (Confluence / S3 / Notion)
- Cross-language retrieval
- Unified LLM-as-Judge (G-Eval + Self-Consistency)
The roadmap, feature requests, and voting are managed through GitHub Issues.
Contributing
Before contributing code, reporting an issue, or proposing a feature, read CONTRIBUTING.md. See Quick Start for local development and run make enterprise-checks before pushing.
# Fork and clone
git clone https://github.com/<your-username>/MimirQ.git
cd MimirQ
make init
# Local development
make infra-up # Start infrastructure
make models # Download and verify the pinned DeepDoc models
cd web && pnpm dev # Frontend dev
python main.py # Backend dev
# Pre-push checks
make enterprise-checks
License
This project is licensed under the Apache License 2.0. Attribution for third-party components (including code vendored from RAGFlow/DeepDoc and build-provisioned model weights) is recorded in NOTICE.
PyMuPDF (AGPL-3.0) notice: Default PDF parsing may use PyMuPDF, which is licensed under AGPL-3.0 / commercial dual license. Offering this software as a network service (SaaS) may require release of the entire combined work under the AGPL network clause. To avoid this constraint, use a permissively licensed parsing backend (pypdf / pdfplumber). See NOTICE for details.
Acknowledgements
MimirQ is built on the shoulders of outstanding open-source projects:
Dify · RAGFlow · FastAPI · LangChain · LangGraph · Milvus · Next.js · PostgreSQL · RAGAS · PyMuPDF · MinerU · Tailwind CSS · shadcn/ui
Explore related projects
Loading…