Model or dataset
phoenix-zhou/industrial-general-rag avatar
phoenix-zhou/industrial-general-rag

The router sends simple questions to MySQL and the rest to Milvus

The project integrates the RAG and FAQ dual mechanisms, introduces intent recognition, dynamic adaptive retrieval, and the RAGAS automated evaluation system, achieving a transformation from empirical optimization to data-driven optimization.

668 stars30 forksPythonLicense varies

At a glance

What is it?
phoenix-zhou's industrial QA system runs two retrieval engines behind one intent router: a BM25 FAQ store in MySQL with Redis caching answers common questions in under a hundred milliseconds, while everything the router judges complex falls through to BGE-M3 hybrid retrieval, a reranker and Qwen2.5. The evaluation loop with RAGAS is the part that changes how you tune it.
Who is it for?
Use this shape if your question set has a long head of repeat lookups and a long tail of everything else, because a FAQ table answering in under a hundred milliseconds is a different product from a vector search answering in seconds, and the router is what lets you have both without paying RAG latency on a question that was answered last week.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 117 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • phoenix-zhou/industrial-general-rag668 ★ · +240
Star history
Repository2026-09-172026-11-15
phoenix-zhou/industrial-general-rag428668

240 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

A fine-tuned BERT decides, and 0.85 decides again

The dispatch mechanism is described twice in slightly different ways, and both descriptions are worth having. The architecture diagram routes a user query through an intent recognition router, which sends high frequency or simple queries to an FAQ module backed by MySQL and Redis and complex or long tail queries to a RAG module backed by Milvus. The module description adds that the router identifies intent using a fine-tuned BERT model and dispatches dynamically. Inside the FAQ branch there is a second threshold: a similarity above 0.85 produces a direct answer rather than continuing. So there are two gates, a coarse one deciding which engine runs and a fine one deciding whether the FAQ hit is good enough to answer from. That second gate is the interesting one, because a BM25 keyword match on its own will happily return a confident wrong answer for a question that shares vocabulary with a stored one, and 0.85 is the only thing standing between that and the user. Whether 0.85 is well calibrated for your corpus is the first thing you would want to measure, and the evaluation section gives you the means.

Under a hundred milliseconds, then automatic degradation

The dual-engine idea is really a latency design. The FAQ path is BM25 keyword matching over MySQL with a Redis cache in front, and the stated figure is that high frequency questions are answered in under 100ms. Complex questions automatically degrade into the RAG process, which is where the design earns its keep: the fallback is not an error path but the expected majority path, and nothing in the user experience announces which one ran. Redis does double duty beyond caching, since the stack table lists it for hotspot caching and session management, and the multi-level indexing strategy is what gets the FAQ branch under its latency target rather than raw MySQL speed. The framing at the top is that the system targets millisecond responses for high frequency queries and second-level responses for complex reasoning. Two goals are being chased at once and they are in tension, so the routing decision is not just an optimisation, it is the mechanism that keeps both promises. In practice that means the accuracy figure you care about is conditional on the router, which is the part with no retrieval to blame when an answer is wrong.

Dense plus sparse, then a reranker throws most of it away

The RAG branch is where the accuracy claim comes from, and it has three named stages. Hybrid retrieval uses both semantic and keyword vectors on the stated rationale that this compensates for the shortcomings of single retrieval methods, which is the same argument for sparse indices that applies anywhere: dense vectors miss exact identifiers, sparse terms miss paraphrase. The retriever is BGE-M3, and Milvus holds both vector types. Re-ranking is a separate step using BGE-Reranker-Large, fine-tuning scores on the initial result set to ensure high quality top-K context, so the point of the reranker is subtraction rather than addition: the hybrid search returns a broad set and the reranker discards most of it. The stated effect of the combination is that accuracy goes up to 90 percent or better. Two retrieval strategies sit above that pipeline for harder questions, HyDE and sub-query decomposition, both aimed at multi-hop reasoning, so a question needing several lookups is broken up before retrieval rather than after it.

RAGAS is the part that changes how you tune it

The stated goal is a move from experience-based tuning to data-driven optimisation, and the RAGAS integration is the mechanism. The system builds a standardised evaluation dataset and automatically computes four key metrics, with faithfulness and answer relevancy named as examples of the set. Faithfulness is the one that matters most for this domain, because the project exists to answer hallucination complaints, and a faithfulness score that does not move when you change the retriever is the single most useful signal that a prompt change fixed wording rather than grounding. The evaluation runs automatically and regularly to monitor and optimise performance, and the claim is a visualised closed loop for algorithm iteration, which means an algorithm change should be something you can point at a metric and defend. Two details support that reading. The evaluation scripts live in their own directory inside the RAG package rather than being scattered through the pipeline code, and the stack pairs RAGAS with Pandas and Matplotlib, so the intended workflow is a dataset, a run and a chart rather than a print statement.

Five models, and no script fetches them

This is the deployment step that catches people. The model downloads section does not provide a script; it provides a link to a Baidu Pan share with an extraction code, and a list of five required models: `bert_query_classifier`, `bert-base-chinese`, `bge-m3`, `bge-reranker-large`, and a Chinese document segmentation model. Each maps onto a named part of the system, which is useful to know before you start downloading. The query classifier is the router's fine-tuned BERT. `bge-base-chinese` is the base encoder it builds on. BGE-M3 is the hybrid retriever and the reranker is the large reranking model. The segmentation model is for splitting documents before they ever reach the retriever, which for industrial documents in Chinese is where a lot of the quality comes from. Two services carry them in production, Qwen2.5-7B for generation and the retrieval stack in front of it, but the list to obtain by hand is the five above. The surrounding framework choices are LangChain and Transformers on Python 3.10 or later, with Gunicorn serving behind Docker Compose.

The clone command points at a placeholder and the directory does not match

The quick start is four steps and the first one will not work as printed. It asks you to clone a repository at a URL that still contains the words your-username and names the project differently from the directory it then changes into:

code
git clone https://github.com/your-username/Industrial-Intelligent-QA.git
cd Industrial-Intelligent-RAG

So expect to substitute the real repository and reconcile the directory name yourself. The rest of the sequence is straightforward and is the path the project expects. Services come up either through the provided script or directly:

bash
chmod +x start_compose.sh
./start_compose.sh

or with `docker-compose up -d --build`. The compose file orchestrates Milvus, Redis, MySQL and the backend service in one pass, which is what makes the whole thing a one-click private deployment rather than four setup guides. That claim depends on the host though, since Milvus is a vector database with its own storage requirements, so a machine that was sized for a laptop demo may not be sized for a real index. Knowledge base initialisation is a directory and a script: put the industrial general documents into the `rag_qa/data` directory, then run `python rag_qa/core/ingest_data.py`. Two endpoints confirm the service is alive, API documentation at the docs path on port 8000 and a health check at the health path on the same port. The ingestion script is also where segmentation happens, since the document segmentation model sits ahead of the retriever, so a bad chunking decision is baked in before you ever see a retrieval score.

FAQ, RAG and evaluation are separate packages on purpose

The project structure makes the two-engine claim concrete, since the FAQ side and the RAG side are physically separate trees under one application root. The base directory holds shared configuration and logging. The MySQL QA package is the FAQ module with its Redis caching logic in a cache subdirectory and similarity calculation in a retrieval subdirectory, which is where BM25 lives. The RAG package holds the full orchestration in core, document loaders in their own directory, model definitions for embedding and reranking in another, and the RAGAS evaluation scripts in a fourth. The entry point is a Flask or FastAPI application, and compose orchestration sits beside it. At the top of the repository the application directory sits alongside a separate `others/` directory and a README, so there is more in the tree than the application itself. One presentational quirk is worth flagging before you read it: the README repeats its own content in full in a second language, so the document you are reading appears twice and the second copy is cut off partway through the stack table rather than being a shorter appendix. That duplication is the most reliable signal in the repository about what kind of project this is: a single-authored reference implementation, written for one vertical and one language, with the README doubling as documentation, as a Chinese-language landing page and as a blog post elsewhere that walks through building it step by step. Useful to learn from, and correspondingly not something to treat as a maintained product with a support contract behind it. The tree reflects the same thing, since the application sits in one directory with a catch-all `others/` beside it rather than being split into packages with published versions.

Editorial conclusion

Use this shape if your question set has a long head of repeat lookups and a long tail of everything else, because a FAQ table answering in under a hundred milliseconds is a different product from a vector search answering in seconds, and the router is what lets you have both without paying RAG latency on a question that was answered last week. Do not adopt it as a general retrieval library, because the routing thresholds, the evaluation dataset and the model set are all tuned for one vertical domain and one language. Three things to check before you try it. The clone command in the quick start carries a placeholder repository name and a directory name that do not match, so expect to fix that on the first run. The five models, which are not pulled by any script and have to be obtained separately. And the accuracy figure, which the project states as a percentage improvement rather than as a measured result with a dataset attached, so treat it as a claim to test with your own RAGAS run rather than a benchmark.

Frequently asked questions

What does phoenix-zhou/industrial-general-rag do?

It is an intelligent Q&A system for the general industrial vertical domain, built on a dual-engine retrieval architecture. MySQL with BM25 keyword matching and Redis caching handles high frequency questions in under 100ms, while complex or long-tail questions fall through to Milvus for BGE-M3 hybrid retrieval, reranking and Qwen2.5 generation.

How does the FAQ plus RAG architecture decide which engine answers?

An intent recognition router built on a fine-tuned BERT model dispatches dynamically, sending high frequency or simple queries to the FAQ module and complex or long-tail queries to the RAG module. Inside the FAQ branch there is a second gate: a similarity above 0.85 produces a direct answer.

Which models do I need before the system runs?

Five, obtained from a linked file share rather than by any script: bert_query_classifier, bert-base-chinese, bge-m3, bge-reranker-large, and nlp_bert_document-segmentation-chinese-base. The generator is Qwen2.5-7B. The stack is Python 3.10 or later with LangChain and Transformers.

What is RAGAS used for in this project?

It closes the optimisation loop. The system builds a standardised evaluation dataset and automatically computes four key metrics, with faithfulness and answer relevancy named among them, and runs those tests regularly to monitor performance. The stated goal is moving from experience-based tuning to data-driven optimisation.

How do I start the industrial RAG system?

Clone the repository and change into the project directory, then either run the provided script with `chmod +x start_compose.sh` followed by `./start_compose.sh`, or bring the stack up with `docker-compose up -d --build`. Compose orchestrates Milvus, Redis, MySQL and the backend. Place documents in rag_qa/data and run `python rag_qa/core/ingest_data.py`.

Official sources

  1. Issues
  2. phoenix-zhou/industrial-general-rag on GitHub
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/phoenix-zhou-industrial-general-rag.svg)](https://hysenlabs.com/projects/phoenix-zhou-industrial-general-rag)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/phoenix-zhou-industrial-general-rag.svg)](https://hysenlabs.com/projects/phoenix-zhou-industrial-general-rag)

Was this useful?