Shenzhen Enterprise Large Model RAG Landing: From Vector Database Selection to Knowledge Bank Construction
This document details the full-scale process of the enterprise RAG system, from the vector database selection (Milvus/Qdrant/FAISS contrast) to the knowledge base construction, and contains two real business cases and a complete implementation programme. Huanan Tengfei Technology shares AI knowledge base development experience.
I. REAL SPECIFIC INITIAL
2025 Year 11 Month , Dong-chul. one Home. 3000 People's electronic manufacturing enterprises IT The chief Lee found us. , Yes. one Words :
"We bought a A800 and deployed Qwen-72B, which did a good job. But the employees... one Question company It's internal. —— Like what? ' Last year. Q3 Vendor appraisals standard What is it? '—— The model begins to be compiled. 。 It doesn't know our internal documents. "
It's not a question of Old Lee alone. We've been in touch. 27 It's in a big model business. , Yes 24 Home is stuck in the same line. :It's a very strong model, but no business knowledge.。
That's the problem with RAG. Today, this article starts with the vector database selection, and goes to the knowledge base on line operations and maintenance, marking every pit.
II. RAG: What exactly is the problem?
Let's get this straight. RAG is not some kind of genre technology. Its logic is simple:
1. User questions
2. System to search for document clips in the knowledge base
3. Use these clips as context and feed them to big models
4. Large model based on real information answers that are retrieved
It's equivalent to a "roll-out test" for a big model. Models do not need to remember all in-house information, but only read and summarize.
cores Value: Reduce hallucinating rate. Qinghua University KEG Laboratory 2025 Annual assessment , Purely-generated large-scale models are hallucinating in a business knowledge quiz. 38.7%, Introduction RAG And then you can drop it. 8.2%。
2.1 RAG vs fine-tune vs Phrasing Project
The big model of business, there are three routes to solve the problem of "not knowing business":
Our proposal: RAG first, with more than enough to fine-tune. RAG has the highest output. A RAG system can be online in a few weeks, fine-tuning may take months, and may not work better than RAG.
Technical evolution of 2.2 RAG
2024 Year ,RAG I'm still here. " Search Top-K Direct feeding model " It's... 1.0 Phase 。 By the year of 2025, the industry has been in many directions:
- Agentic RAG: let the model decide what to search for, how many times, not once.
- Graph RAG: structure knowledge into a map, Supported multiject reasoning
- Self-RAG: model assesses the quality of search results and decides whether re-research is required
- Corrective RAG: Retrieve first, then let the model judge whether the search results are relevant, irrelevant discards
For most businesses,standard RAG + RerankerEnough already. Don't come up here after the new concept. Let's do it first.
III. Vector database selection: 6 mainstream programme overview
The first step of RAG is to turn the document into a vector and store it in the database. Select which vector library to directly determine the later search of speed and accuracy.
3.1 Mainstream Program Comparison
3.2 In-depth analysis of programmes
Milvus: maintained by Zilliz (formerly MILVUS Item team) as the most complete option in the current open source vector database for Functions. Supported multiple index types (IVF, HNSW, DiskANN), flag filtering, mixed search. The disadvantage is that the structure is heavy and the production environment at least requires three components of etcd + MinIO + Milvus and operations and maintenance is not less complex.
Qdrant: Written with Rust, excellent performance. Single-container deployment, 5 completed in minutes. Internal Payload filter, which can be filtered by tabs, time, etc. 2025 year GitHub Star exceeds 20,000. Community version Functions That's enough. , Commercial (Qdrant Cloud) It suits you not to think about yourself. operations and maintenance The team. 。
FAISS: Meta Open Source Vector Retrieval Library, not a database, is a library. Need to encapsulate service. The advantage is... speed Extremely fast. , In a pure search scene, latency Minimum 。 A team with limited data (up to tens of millions) with development capacity.
Elasticsearch: 8.0 version starts Supported dense vector search (dense_vector). If your business is already doing log analysis or full-text search with ES, it is the least expensive option to re-use ES for vector retrieval. However, ES vector search performance is not as good as that of the dedicated vector bank, and latency is high in a large-scale scenario.
Sangfor hyperconverged infrastructure built-in vector engine: If the enterprise has already deployed the Sangfor HCI platform, the built-in vector search engine is an open-box option. The advantage is that it is seamlessly integrated with the existing virtualization infrastructure and does not require additional procurement of an independent vector database server. Sangfor provides a unified operations and maintenance management platform, which significantly reduces the operations and maintenance manpower cost. Data Local storage , Satisfied MLPS 2.0 Requirements for data not to be specified 。 This is an undervalued option for manufacturing and financial clients in South China.
Pinecone: Hosted all SaaS, nothing to worry about. The disadvantage is that the data is expensive (based on quantity in vector and number of queries) and that data are offshore, and the enterprise not applicable has a requirement for data compliance.
3.3 Select Decision Tree
See data first:
- 100 ten thousand Below and below :FAISS That's enough. , zero operations and maintenance
- 100 All the way. 5000 Man. :Qdrant or Milvus Anything.
- 5000 million or more: Milvus or business programs
And then look at team skills:
- with a full-time DBA: Milvus cluster programme
- 2-3 man operations and maintenance: Qdrant (single container deployment, 5 completed in minutes)
- Don't mind infrastructure: Sangfor hyperconverged infrastructure built-in
Finally, look at the integration:
- There are already Elasticsearch clusters: Search directly using the dense vector of ES
- There is a Sangfor hyperconverged infrastructure HCI platform: the built-in vector engine opens directly.
3.4 hardware configuration reference
IV. Building the knowledge base: from original document to searchable vector
Select the vector bank, followed by cores: How to turn the business 's PDF, Word, Excel, web pages into high-quality vectors.
4.1 Document Processing Water Flow Lines
Original document Query Format Parsing Query Text Cleaning Zuak Section (Chunking) Zoak Quiz) To Quantified Library There's a hole in every link.
4.2 Format Parsing
PDF is the pit of maximum.
The enterprise internal document 70% is above PDF, but PDF is not a format, but a type of format. Scans, text versions, tables and pictures are treated in a completely different way.
The case of a law firm in Shenzhen They have tens of thousands of scanned contracts, initially using Tesseract OCR, with only 62% accuracy. The main problem: the legal term in the contract (e.g. "collateral" "collateral guarantee") has a high rate of error in recognition. The accuracy rate is raised to 89% after the PaddleOCR+ model fine-tuned for the legal instrument. Key Actions: A lexicon was developed for legal instruments, and 3000 + legal terms were added to the custom dictionary.
The case of a car spare parts business in Guangzhou: Their technical file is German. + Chinese You're a bunch of shit. PDF, Use normal OCR It's a bad code to recognize the German alphabet. 。 Final plan: Marker for layout and language separation, OCR model for German, Chinese for PaddleOCR and 91% for accuracy.
4.3 Text Cleaning
Cleaning is not so simple as deleting lines. To deal with:
- Header Footer: The repetition of the contents on each page will lead to a large number of duplicates during the search. Identification method: Text blocks that appear at the same location over 3 in a continuous period
- Watermark Text: OCR will recognize the watermark as the body. Resolve: remove watermarks by image processing before OCR, or filter low-trust text containing key words such as "confidential " inside" during reprocessing
- Uncoded Characters: PDF exported from the old system often has coding problems. Resolve: Encoding with chardet, replacing abnormal characters
- Markdown Tag: if the document is exported from Confluence / Flying Book, it remains ##、** Keeps the mark for the wait (useful for partition)
- Footnotes and endnotes: If the footnote contains important information, it needs to be merged into the body
4.4 Partition (Chunking) Policy
The division is the decisive factor for the RAG effect. The size of the block and the quality of the search; It's too small and not enough context.
Recommended options: For the business knowledge base,Document Perception BlockIt's the best. First, we do a layout analysis (with LayoutParser or Marker), we identify the title, paragraph, table, picture area, and then we make the paragraph into the basic unit segment. The adjacent paragraphs are merged into the same section if they are semantically relevant.
Specific specifications:
- minimum block: 200 token
- maximum block: 800 token
- Overlap: 50 token (retain context connection)
- Tables are handled separately: tables do not mix with normal text
4.5 Segment Quality Assessment
Once the breakout is completed, the quality needs to be assessed. Methodology:
1. Random sample: Randomly extract 100 from the breakout result
2. Manual Notation: Let the staff judge whether each piece is semantic or not
3. Calculate complete rateNumber of semantic complete blocks / total blocks
4. Objective: Complete Rate > 85%
If it is below 85%, the fraction specifications needs to be adjusted.
4.6 Select to Quantified Model
The semantic match accuracy of the search is determined by the quantitative model (Embedding Model).
Recommended BGE-m3。 Rationale:
- Chinese MTEB ranking first (year of 2025)
- Supported Multilingual (100 + Language) with English files and not afraid
- Open source free of charge, available locally.
- 1024-dimensional, storage and calculate cost balance
- Supported long text (maximum 8192 token)
If an enterprise already has a Sangfor security platform (SIP), it can use the text it contains to quantify capacity, directly to the security event knowledge base and to make secure knowledge retrieval and security operational. zero trust Access Control System (aTrust) Sangfor can also connect to the knowledge base to achieve identity-based dynamic rights control and ensure that can only of different departments and levels of employees access knowledge within their own purview.
V. RAG Retrieval links
When entered in quantitative terms, a search chain is built.
5.1 Foundation
Question user Query Embedding LLM Top-K Top-K Reranker Reorder Reranker Prompt LLM Generate Answers It's the point.ReorderThis step. A lot of people go straight to LLM after a vector search, and it's often not working.
5.2 Why reorder?
Vector search is based on a thick row of cosine similarity, and there may be 3-5 in Top-10 that is not actually relevant to the problem. Adds a rearranged Cross-Encoder model to give fine scoring to this 10 bar, then takes Top-3, which will significantly increase the effect.
According to the Tsinghua University KEG laboratory test:
- Vector search only: MRR@10 = 0.42
- Vector Retrieval + Reranker: MRR@10 = 0.68
Recommended Reranker: BGE-reranker-v2-m3 (open source, Supported multilingual), or Cohere Rerank (SaaS, best done by paying).
5.3 Query Rewrite
Users may ask questions that are completely different from the way the document is presented in the knowledge base.
For example, the user asks, "How do you get through the process? "
But the title of the system file is: "Travel management scheme, chapter four, "Reimbursement processing."
Directly using user questions for vector search may not match. Solutions:
Scheme A: HyDE (Assuming document embedded)
- Let LLM generate a hypothetical answer document based on the question.
- Use this hypothetical document for a vector search.
- Effect: significant increase in open-ended issues
Scheme B: Multiple Query (Multi-Query)
- Let LLM translate user questions into 3-5 different expressions
- Retrieve them separately and merge them to the heavy end.
- Effect: stability, low cost
Scheme C: Query Extension
- Extension of keywords with synonyms
- Simple, rough, but effective, especially for trade terms
Recommendation: Program B (multi-Query)The highest value for money.
5.4 Prompt Build Template
You're a professional business knowledge assistant. Please answer the user ' s questions on the basis of the following references. References : [1] {chunk_1} [2] {chunk_2} [3] {chunk_3} User problems :{query} Request : 1. Response based on reference only 2. If the references are not sufficient to answer the question , Clear Description " Not possible on the basis of available information " 3. Mark when referring to source [1][2] Waiting for numbering 4. The answer is simple and specific. 5. If process steps are involved , Serial number. The template has several key points:
- Tell the model clearly that it's based on reference.
- Requires that sources be marked to facilitate user-retroactivity
- Limiting the "uncertainty" output and avoiding forced modelling.
- Require structured output for process type issues
VI. Case of combat: the fall of the knowledge base of a manufacturing enterprise in Shenzhen
6.1 Project Background
Some consumer electronics company in Shenzhen District. , Employees 2800 People , Annual value 12 hundred-million CNY 。 Painful:
- Internal systems, SOP, technical files distributed in Confluence, OA system, shared disks, finding difficulties
- New staff training is passed on to older staff members, with average time on 3 weeks
- HF queries such as vendor appraisals, quality standard, each time a file is searched, which takes an average of 15 minutes
specifications with 2000 + copies of the technical department's product, and the sales team often asks the wrong specifications
6.2 Implementation Structure
6.3 Knowledge Base Size
- Total document: 12,400 (PDF 8,200 + Word 3,100 + Excel 1,100)
- Resolved text: about 1.8 billion words
- Parts quantity : Approx. 230 Ten thousand dollars.
- Vector dimension: 1024
- storage Occupation: About 12GB (Qdrant, with HNSW Index and Quantification)
6.4 Implementation Timeline
6.5 Effect Data
30 day statistics:
Li's words are: "In the first week on the line, colleagues from the Department of Procurement said that at last I did not have to ask the process every time. The next week, the sales team started to use it to check the product specifications, which used to ask me a dozen questions every day, and now it's done by itself. "
Case II: Compliance knowledge base of a financial institution in Foshan
7.1 Project Background
At a comptoir in Foshan, compliance authorities are asked every day about the regulations and internal systems of the Bank of the People ' s Bank, the Superintendency of Banks and the Superintendence of Banks. Painful:
- Frequent updates of regulations, new 200 + documents per year
- Linkage between different documents, manual search easily missed
- The need to provide the basis for the relevant system in a short period of time for regulatory inspections
7.2 Special Requirements
The financial sector has very high data security requirements:
- The knowledge base has to be deployed locally. server room is not available.
- Access requires a double factor, certification.
- All queries need to be audited.
7.3 Implementation Program
7.4 Effects
- Compliance query response time: reduced from an average of 25 minutes to 15 seconds
- Time for preparation of regulatory inspection information: reduced from 3 days to 2 hours
- System update effective: reduced from 2 days to 30 minutes
- Zero regulatory inspection violations (first check on-line)
VIII. GUIDELINES FOR PLACES: 9 PLACES WE THOUGHT
Pit 1: Unupdated files, knowledge base changed to "knowledge grave."
Question: When the knowledge base is built, it is not maintained. The old document has expired and is still being retrieved, resulting in an error of answer.
Solve: Establish document life cycle management. Each document enters the library with an "validity" mark, and the document owner is automatically informed before the expiry date of 30 days to confirm whether or not it is updated. Automatic downright for expired documents (retribution score x 0.5).
Pipe 2: PDF Table Parsing Missing Key Information
Question: PDF with PyPDF2 to parse the table, and the table data becomes a bunch of unsequenced text.
Solve: Replace with pdfplumber + camelot. For table-intensive documents (e.g., financial statements), the conversion to Excel is considered for processing. Or use MinerU (open source) for Supported of the table.
Pit 3: The segment cuts the key context
Question: Fixed 512 token fractions, cutting "preconditions" and "operational steps" into different blocks, retrieving only hit and operational steps, and not answering fully.
Solve: Replaces the document sensor segment with the document sensor segment. The semantic integrity of each block is guaranteed by using the paragraph as the basic unit.
Pit 4: Multilingual Mixed Document Processing
Question: English is mixed in business documents (commonly available technical documents), and the effects of a single Embedding model are poor.
Solve: Use Supported Multilingual Embedding Model (BGE-m3)。 Or identify the language at the breakout, quantifying it in different models.
Pit 5: Retrieving speed too slow
Question: Vector search + Reranker string execution, P99 latency exceeding 8 seconds.
Solve: Vector search and Embedding can be synchronized. When Top-K results are Reranker, batch mode is used to develop a one-time reasoning, which is faster than article-by-article 3-5.
Pit 6: Isolation is not complete.
Question: There's been an incident when regular staff members were able to retrieve the senior management's pay files.
Solve: ACL (Access Control List) at the vector database level. Each vector record binds the permission label and filters the user permissions when you search. zero trust Access Control System (aTrust) for Sangfor allows the interface with the knowledge base to achieve identity-based dynamic rights control and to ensure that can only of the different departments and levels of employees access the knowledge within their purview.
Pit 7: No assessment system
Question: After launch, effectiveness is judged entirely by intuition because results are not measured.
Solve: Build one. 200-500 Test set of bars , Organisation standard Answers 。 After each update of the model or search chain, run an evaluation. cores Indicators: Hit rate (Hit Rate), MRR (average penultimate ranking), answer accuracy.
Pit 8: ignores the user 's actual search habits
Question: Employees are not used to asking complete questions, but only enter keywords such as "reimbursement" for "annual leave".
Solve: Front-end interface Supported "Keyword Search + Dialogue Questions and Answers" The keyword mode uses the traditional full text search and the dialogue mode follows RAG.
Pit 9: Wrong index type for vector database
Question: Retrieving with IVF index, 15% is less accurate than HNSW.
Solve: The HNSW index is given priority for HNSW for less than 1000. IVF It's for super-large. (10 Billion. +) scene 。 specifications settings for HNSW: M=16, efConstruction=200, efSearch=64.
IX. operations and maintenance AND CONTINUED IMPROVEMENT
Access to the knowledge base is only the beginning, and continuous improvement is key.
9.1 Monitoring Indicators
9.2 is regularly updated
- Weekly: Add new documents to the library, drop down the expired document
- Monthly• Run an evaluation test set to track trends in indicators
- Quarterly: Review RAG links and assess the need to upgrade models or adjust partition strategies
X. FAQ
Q1: which is better for RAG and fine-tuning (Fine-tuning)?
It's not a contradiction. It's two levels. RAG addresses the issues of "required knowledge" and "private knowledge of business", fine-tuning the issues of "model expression" and "mission-specific competence". It is suggested that RAG should go first, with extra credit and fine-tuning.
Q2: How much storage for vector database?
100 Thousand. 1024 Vector , About that. 4-6GB( Includes Indexes and Metadata )。 Most enterprises have a knowledge base of up to 1000 million, and a single node is sufficient.
Q3: Can Embedding be made with a public cloud API?
Yes, but be careful about data security. With regard to the contents of the enterprise's internal document, it is recommended that the Embedding model be deployed locally. If you leave a cloud API, you need to dissensitize the document.
Q4: Can RAG do multi-modular (photogram/ Video)?
Technically. Pictures extract vectors from CLIP/ViT models, and Video extracts key frames and then quantifys them. However, in actual landings, text-type documents account for more than 90% of the enterprise knowledge base, and it is suggested to start with text.
Q5: What are the approximate costs of a RAG system?
For example, a medium-sized enterprise (1000 million vectors):
If the enterprise already deploys the Sangfor hyperconverged infrastructure infrastructure, the costs of hardware procurement and operations and maintenance could be significantly reduced.
Q6: What do you do when the knowledge base is online?
We've had this situation. The root cause is that employees do not know about this tool or do not use it once when they feel bad. Method of interpretation: (1) Notification by micro-credit/cruising of the enterprise; (2) Set "Quick questions" for first use; (3) Collect manual feedback on pre-100 questions and quickly improve.
Q7: How to deal with knowledge conflicts? The same thing is not the same as the document.
Record the "priority" label of the document at the breakout (e.g. "Modern version" "Repealed" "Reference"). When the conflict content is retrieved, priority is given to the high-priority content and the answer is marked "There are different versions, whichever is the latest".
XI. Summary
RAG is not a new concept, but 2025-2026 is indeed a critical window period for business landing. Vector database is ecologically mature, Embedding model is open, and the breakup strategy is best practice.
cores recommends:
- Run open source first. Don't start with the commercial.
- Document quality is more important than model selection - garbage in, garbage out
- It's important to have an evaluation system. There's no improvement without measurement.
- We're on the bottom line. Don't be lazy.
- It's not a good idea to value the staff's experience. No one uses it.
Our team did it in South China. ten A few. RAG Land. Item , Cover Manufacturing 、 Finance 、 Law 、 Health care and so on. 。 If you're planning or are already doing it, welcome to exchange.
Contact us :13510444731(7×24 hours )
Why choose Huanan Tengfei
A+ Authentic products Original manufacturer products with authenticity verification + Configuration options Technical solutions tailored to your requirements - Volume pricing Volume pricing for enterprise orders = Technical services Support from manufacturer-certified engineers ? After-sales support 7×24-hour technical supportNeed a technical solution?
Huanan Tengfei Technology Provide integrated IT Infrastructure and Cybersecurity service
Contact us♪ Relevant recommendations
- Shenzhen Cybersecurity company: What's the net operation?
- Shenzhen Enterprise data center Micromodule MDC Construction guide: Time and Power Budget
- Shenzhen. server room Micromodule adaptation field operations :PUE From 1.8 Down to 1.35, The annual savings on electricity are high. 30 Man.
- Shenzhen Enterprises Extortion of Software Protection: A Guide to Complete System Construction from Prevention to Recovery
- Shenzhen Enterprise GPU Mathematical Construction Actual: Full Path from Cloud End to Local Deployment
Relevant programme recommendations
For information about the More Enterprise IT program, call the help line:13510444731
♪ Related Solutions Recommendations
♪ Huanan Tengfei Technology — IT Infrastructure expert around you
Shenzhen server room Construction Cybersecurity Weak Power Engineering Z Data Governance hyperconverged infrastructure Cloud Desktops Emergency Command
20 Year enterprise IT service Experience · Lenovo / Huawei / Sangfor platinum partner · service Super. 500 Businesses
♪ Related Solutions Recommendations
♪ Huanan Tengfei Technology — IT Infrastructure expert around you
Shenzhen server room Construction Cybersecurity Weak Power Engineering Z Data Governance hyperconverged infrastructure Cloud Desktops Emergency Command
20 Year enterprise IT service Experience · Lenovo / Huawei / Sangfor platinum partner · service Super. 500 Businesses











