File size: 3,219 Bytes
cd800f0
 
 
6e738cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
license: apache-2.0
---
---
language:
- en
tags:
- nlp
- retrieval
- rag
- faiss
- bm25
- semantic-search
- stackoverflow
- code-generation
- information-retrieval
size_categories:
- 10M<n<100M
pretty_name: StackFix Indexes (Pre-Built)
---

# πŸ“š StackFix Indexes (Pre-Built)

Pre-built FAISS and BM25 indexes for high-quality StackOverflow retrieval.

Designed for:
- RAG systems
- Agentic debugging
- Code retrieval
- LLM augmentation
- Semantic search pipelines

These indexes were generated using the top-scoring 1.1 million StackOverflow Q&A pairs and optimized for programming-related retrieval tasks.

---

# πŸ“Š Dataset Statistics

| Metric | Value |
|---|---|
| Total Documents | 1,102,568 Q&A pairs |
| Selection Strategy | Highest-scored answer per question |
| Average StackOverflow Score | 3.31 |
| Embedding Model | `BAAI/bge-base-en-v1.5` |
| Embedding Dimensions | 768 |
| Similarity Metric | Cosine Similarity |
| Vector Normalization | Enabled |

# 🏷️ Top 10 Tags / Languages

| Tag | Question Count |
|---|---:|
| javascript | 108,637 |
| java | 100,781 |
| c# | 90,035 |
| php | 87,354 |
| android | 74,596 |
| jquery | 70,002 |
| python | 57,082 |
| html | 53,261 |
| c++ | 43,040 |
| ios | 39,329 |

---

# 🧠 Embedding Architecture

## Dense Retrieval

- Model: `BAAI/bge-base-en-v1.5`
- FAISS-based vector search
- Normalized embeddings for cosine similarity

## Sparse Retrieval

- BM25 keyword index
- Optimized for hybrid retrieval workflows

## Retrieval Text Construction

Questions, accepted/highest-scored answers, and code blocks were merged into a unified `retrieval_text` field during preprocessing.

This structure improves:
- semantic debugging retrieval
- code-aware search
- agentic reasoning pipelines
- long-context augmentation

---

# πŸ“¦ Included Files

| File | Description |
|---|---|
| `faiss_index/` | Pre-built FAISS vector index |
| `bm25_index.pkl` | Serialized BM25 retrieval index |

---

# πŸ“₯ Usage

1. Download the files from this repository.
2. Place them inside:

```bash
./model_cache/
```

3. Launch your application:

```bash
chainlit run app.py
```

The system will automatically detect and load the indexes.

---

# πŸ“š Source Dataset

The indexes were built using the public StackSample dataset hosted on Kaggle:

https://www.kaggle.com/datasets/stackoverflow/stacksample/data

The original data contains StackOverflow question-answer pairs and metadata.

---

# βš–οΈ Licensing & Attribution

This repository distributes derived retrieval indexes and preprocessing artifacts under the Apache 2.0 license.

Original StackOverflow content and associated rights belong to their respective owners.

Please ensure appropriate attribution when redistributing derived works or generated datasets.

---

# πŸš€ Recommended Use Cases

- Retrieval-Augmented Generation (RAG)
- AI coding assistants
- StackOverflow semantic search
- Agentic debugging systems
- Code question answering
- Hybrid retrieval pipelines

---

# ❌ Not Recommended For

- Exact code formatting retrieval
- Production-grade syntax reconstruction
- Legal/compliance-sensitive archival applications

---

# πŸ™Œ Acknowledgements

- StackOverflow
- BAAI
- FAISS
- Hugging Face