QuantaSparkLabs commited on
Commit
3a46063
Β·
verified Β·
1 Parent(s): 029ba3a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +181 -17
README.md CHANGED
@@ -1,43 +1,207 @@
1
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  # ApexRetriever-Pro
3
 
4
- A 5-stage hybrid retrieval pipeline.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- ## Stages
 
7
 
8
- 1. BM25 sparse retrieval
9
- 2. Dense semantic retrieval
10
- 3. MMR diversity filtering
11
- 4. CrossEncoder reranking
12
- 5. Final optimized retrieval
13
 
14
- ## Components
15
 
16
- - BAAI/bge-small-en-v1.5
17
- - cross-encoder/ms-marco-MiniLM-L-6-v2
18
- - FAISS
19
- - BM25
20
- - MMR
21
 
22
- ## Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  ```python
25
  from pipeline import ApexRetrieverPro
26
 
27
  retriever = ApexRetrieverPro(model_dir=".")
28
 
 
 
29
  docs = [
30
  "Python was created by Guido van Rossum.",
31
- "Paris is the capital of France."
 
32
  ]
33
 
 
 
34
  retriever.index_documents(docs)
35
 
 
 
36
  results = retriever.retrieve(
37
  "Who created Python?",
38
  top_k=3
39
  )
40
 
41
  print(results)
42
- ````
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - rag
7
+ - retrieval
8
+ - semantic-search
9
+ - faiss
10
+ - bm25
11
+ - reranker
12
+ - cross-encoder
13
+ - sentence-transformers
14
+ - flan-t5
15
+ - hybrid-search
16
+ - dense-retrieval
17
+ - ai
18
+ - llm
19
+ - search
20
+ - question-answering
21
+ pipeline_tag: sentence-similarity
22
+ library_name: sentence-transformers
23
+ ---
24
  # ApexRetriever-Pro
25
 
26
+ A powerful 5-stage hybrid retrieval system combining sparse retrieval, dense semantic search, diversity optimization, reranking, and generative refinement.
27
+
28
+ Built for:
29
+ - RAG pipelines
30
+ - AI agents
31
+ - semantic search
32
+ - document QA
33
+ - memory systems
34
+ - knowledge retrieval
35
+ - research assistants
36
+
37
+ ---
38
+
39
+ # Architecture
40
+
41
+ ApexRetriever-Pro uses a multi-stage retrieval pipeline:
42
+
43
+ ## Stage β‘  β€” BM25 Sparse Retrieval
44
+ Fast keyword-based retrieval using BM25.
45
+
46
+ ## Stage β‘‘ β€” Dense Semantic Retrieval
47
+ Semantic vector search powered by:
48
+
49
+ - `BAAI/bge-small-en-v1.5`
50
+
51
+ Uses FAISS for high-speed similarity search.
52
+
53
+ ## Stage β‘’ β€” MMR Diversity Filtering
54
+ Maximal Marginal Relevance (MMR) improves result diversity and reduces duplicate-style retrieval.
55
+
56
+ ## Stage β‘£ β€” CrossEncoder Reranking
57
+ High-quality neural reranking using:
58
+
59
+ - `cross-encoder/ms-marco-MiniLM-L-6-v2`
60
+
61
+ Improves relevance precision significantly.
62
 
63
+ ## Stage β‘€ β€” FLAN-T5 Refinement
64
+ Final answer refinement using:
65
 
66
+ - `google/flan-t5-base`
 
 
 
 
67
 
68
+ Generates concise refined outputs from retrieved context.
69
 
70
+ ---
 
 
 
 
71
 
72
+ # Features
73
+
74
+ - Hybrid sparse+dense retrieval
75
+ - FAISS accelerated search
76
+ - MMR diversity optimization
77
+ - Neural reranking
78
+ - Generative refinement
79
+ - GPU acceleration
80
+ - Plug-and-play pipeline
81
+ - Lightweight deployment
82
+ - Kaggle compatible
83
+ - HuggingFace compatible
84
+
85
+ ---
86
+
87
+ # Repository Structure
88
+
89
+ ```text
90
+ ApexRetriever-Pro/
91
+ β”‚
92
+ β”œβ”€β”€ bi_encoder/
93
+ β”œβ”€β”€ reranker/
94
+ β”œβ”€β”€ flan_t5/
95
+ β”œβ”€β”€ pipeline.py
96
+ └── README.md
97
+ ````
98
+
99
+ ---
100
+
101
+ # Installation
102
+
103
+ ```bash
104
+ pip install -U \
105
+ sentence-transformers \
106
+ transformers \
107
+ faiss-cpu \
108
+ rank-bm25 \
109
+ torch
110
+ ```
111
+
112
+ ---
113
+
114
+ # Quick Start
115
 
116
  ```python
117
  from pipeline import ApexRetrieverPro
118
 
119
  retriever = ApexRetrieverPro(model_dir=".")
120
 
121
+ # Example documents
122
+
123
  docs = [
124
  "Python was created by Guido van Rossum.",
125
+ "Paris is the capital of France.",
126
+ "Transformers power modern LLMs."
127
  ]
128
 
129
+ # Build index
130
+
131
  retriever.index_documents(docs)
132
 
133
+ # Retrieve
134
+
135
  results = retriever.retrieve(
136
  "Who created Python?",
137
  top_k=3
138
  )
139
 
140
  print(results)
141
+ ```
142
+
143
+ ---
144
+
145
+ # Example Output
146
+
147
+ ```python
148
+ [
149
+ 'Python was created by Guido van Rossum.'
150
+ ]
151
+ ```
152
+
153
+ ---
154
+
155
+ # Use Cases
156
+
157
+ * Retrieval-Augmented Generation (RAG)
158
+ * AI chatbots
159
+ * Local document search
160
+ * Agent memory systems
161
+ * Knowledge bases
162
+ * Research copilots
163
+ * Semantic indexing
164
+ * QA systems
165
+ * Enterprise search
166
+
167
+ ---
168
+
169
+ # Performance Notes
170
+
171
+ Recommended:
172
+
173
+ * CUDA GPU
174
+ * 16GB+ RAM
175
+ * Python 3.10+
176
+
177
+ Works on:
178
+
179
+ * Kaggle
180
+ * Colab
181
+ * Local GPU systems
182
+ * Linux
183
+ * Windows
184
+
185
+ ---
186
+
187
+ # Model Components
188
+
189
+ | Component | Model |
190
+ | ------------- | ------------------------------------ |
191
+ | Dense Encoder | BAAI/bge-small-en-v1.5 |
192
+ | Reranker | cross-encoder/ms-marco-MiniLM-L-6-v2 |
193
+ | Refiner | google/flan-t5-base |
194
+ | Vector Engine | FAISS |
195
+ | Sparse Search | BM25 |
196
+
197
+ ---
198
+
199
+ # License
200
+
201
+ Apache 2.0
202
+
203
+ ---
204
+
205
+ # Author
206
 
207
+ QuantaSparkLabs