File size: 7,918 Bytes
0155adc
 
 
96d3c6f
 
0155adc
96d3c6f
0155adc
96d3c6f
 
 
 
 
 
 
 
 
 
aa62385
0155adc
aa62385
 
0155adc
 
aa62385
0155adc
aa62385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0155adc
 
 
 
 
aa62385
 
 
 
 
0155adc
aa62385
0155adc
 
 
 
 
 
 
 
 
 
 
 
 
 
aa62385
 
 
 
 
 
 
 
0155adc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa62385
 
0155adc
 
 
 
 
 
 
 
 
 
 
aa62385
0155adc
aa62385
0155adc
 
aa62385
 
0155adc
 
 
 
 
 
 
 
aa62385
 
0155adc
 
 
 
 
 
 
aa62385
0155adc
aa62385
0155adc
aa62385
 
 
0155adc
aa62385
 
 
 
 
 
 
0155adc
aa62385
 
 
 
 
 
0155adc
 
 
aa62385
 
 
 
 
0155adc
aa62385
 
 
 
0155adc
 
aa62385
 
 
0155adc
 
 
aa62385
 
0155adc
 
 
aa62385
0155adc
 
 
aa62385
0155adc
aa62385
 
0155adc
 
 
aa62385
 
 
 
0155adc
 
 
 
 
 
 
 
 
aa62385
0155adc
aa62385
 
 
 
 
 
 
 
 
 
 
 
0155adc
 
aa62385
0155adc
aa62385
 
0155adc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa62385
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
---
license: cc-by-nc-4.0
task_categories:
- text-retrieval
- question-answering
language:
- en
tags:
- rag
- retrieval-augmented-generation
- biomedical
- neuroscience
- rare-disease
- STXBP1
- epilepsy
- chromadb
- vector-database
- sentence-transformers
- bge
size_categories:
- 100K<n<1M
pretty_name: STXBP1 RAG Database v9 - BGE Embeddings
---

# 🧬 STXBP1-ARIA RAG Database v9 - BGE Embeddings

A pre-built ChromaDB vector database containing **~570,000 indexed text chunks** from **~17,000 curated PubMed Central (PMC) biomedical papers** related to STXBP1, Munc18-1, synaptic transmission, epileptic encephalopathy, and therapeutic research.

> πŸ’‘ **This is the lightweight version** β€” BGE-base runs efficiently on **CPU/system RAM** without requiring a GPU, making it ideal for free-tier deployments and local development. For maximum retrieval quality with NVIDIA's state-of-the-art 2048-dimensional embeddings (requires GPU with 2-4GB VRAM), see our premium database: **[STXBP1-RAG-Nemotron](https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Nemotron)**

## πŸ†• What's New in v9

| Feature | v8 (Previous) | v9 (Current) |
|---------|---------------|--------------|
| **Embedding Model** | all-MiniLM-L6-v2 | **BGE-base-en-v1.5** |
| **Dimensions** | 384 | **768** |
| **Model Params** | 22M | **110M** |
| **MTEB Score** | ~56 | **~63** |
| **Corpus** | 31,786 papers (unfiltered) | **~17,000 papers (curated)** |
| **Chunks** | 1.19M (58% noise) | **~570K (high relevance)** |
| **Quality Focus** | Quantity | **Precision** |

### Why BGE?

- **2x embedding dimensions** = finer semantic distinctions
- **5x larger model** = better understanding of biomedical terminology  
- **Curated corpus** = removed irrelevant papers, kept STXBP1-focused content
- **MTEB benchmark leader** = proven retrieval performance

## πŸ“Š Dataset Statistics

| Metric | Value |
|--------|-------|
| **Total Chunks** | ~570,000 |
| **Source Papers** | ~17,000 PMC articles |
| **Database Size** | ~8-10 GB |
| **Embedding Model** | `BAAI/bge-base-en-v1.5` (768 dimensions) |
| **Chunk Size** | ~1500 chars with 200 char overlap |
| **Index Type** | ChromaDB with HNSW |
| **Build Date** | January 2026 |

## 🎯 Purpose

This database powers the **STXBP1-ARIA** therapeutic discovery system, enabling:

- **Literature-grounded responses** with PMC citations
- **Semantic search** across decades of research
- **Real-time retrieval** for AI-assisted variant analysis
- **Evidence-based therapeutic recommendations**

## πŸ“ Contents

```
STXBP1-RAG-Database/
β”œβ”€β”€ chroma.sqlite3                    # Main database
β”œβ”€β”€ metadata.json                     # Build info
└── [uuid]/                           # HNSW index files
    β”œβ”€β”€ data_level0.bin               # Vector index
    β”œβ”€β”€ header.bin                    
    β”œβ”€β”€ index_metadata.pickle         
    β”œβ”€β”€ length.bin                    
    └── link_lists.bin                
```

## πŸ”§ Usage

### Quick Start

```python
from huggingface_hub import snapshot_download
import chromadb
from chromadb.config import Settings
from sentence_transformers import SentenceTransformer

# Download database
db_path = snapshot_download(
    repo_id="SkyWhal3/STXBP1-RAG-Database",
    repo_type="dataset"
)

# Load embedding model (MUST match indexing model!)
embedder = SentenceTransformer("BAAI/bge-base-en-v1.5")

# Connect to ChromaDB
client = chromadb.PersistentClient(
    path=db_path,
    settings=Settings(anonymized_telemetry=False)
)

# Get collection
collection = client.get_collection("stxbp1_papers")
print(f"Loaded {collection.count():,} chunks")

# Search (BGE recommends query prefix for retrieval)
query = "STXBP1 dominant negative mechanism therapeutic approaches"
query_embedding = embedder.encode(query, normalize_embeddings=True).tolist()

results = collection.query(
    query_embeddings=[query_embedding],
    n_results=10,
    include=["documents", "metadatas", "distances"]
)

for doc, meta, dist in zip(
    results['documents'][0],
    results['metadatas'][0],
    results['distances'][0]
):
    pmcid = meta.get('pmcid', meta.get('pmc_id', 'Unknown'))
    print(f"[{pmcid}] (distance: {dist:.3f})")
    print(f"{doc[:200]}...\n")
```

### With ARIA Integration

See the full retriever implementation at: [STXBP1-Variant-Lookup Space](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup)

## πŸ“š Curated Corpus

Unlike v8's broad collection, v9 uses a **curated corpus** filtered for STXBP1 relevance:

### Primary Keywords (Auto-include)
- STXBP1, Munc18-1, Munc18, syntaxin binding protein
- UNC-18, N-Sec1

### Related Keywords (Relevance filtered)
- **Epilepsy**: epileptic encephalopathy, Ohtahara, West syndrome, Dravet, infantile spasms
- **Synaptic**: SNARE complex, syntaxin-1, synaptic vesicle, exocytosis, neurotransmitter release
- **Genetics**: haploinsufficiency, dominant negative, nonsense/missense/frameshift mutations
- **Therapeutics**: gene therapy, AAV, ASO, CRISPR, base editing, prime editing
- **Chaperones**: 4-PBA, phenylbutyrate, protein folding, proteostasis
- **Neurodevelopment**: intellectual disability, developmental delay, autism

### Curated Entries
Includes 24 hand-curated entries covering:
- Key primary research (Guiberson 2018, Kovacevic 2018, etc.)
- Therapeutic mechanism summaries
- Variant-specific knowledge
- Clinical trial information

## πŸ—οΈ How It Was Built

### 1. Corpus Curation
- Filtered 27,000 multimodal PMC papers by relevance keywords
- Kept ~17,000 papers with direct STXBP1 relevance
- Added 41 targeted high-value papers
- Included 24 curated expert entries

### 2. Text Processing  
- Chunked documents into ~1500 character segments
- 200 character overlap between chunks
- Preserved document metadata (PMC ID, title)

### 3. Embedding Generation
- Used `BAAI/bge-base-en-v1.5` (768 dimensions)
- Normalized embeddings for cosine similarity
- GPU-accelerated batch processing

### 4. Index Building
- ChromaDB with persistent storage
- HNSW index optimized for semantic search
- Built on RTX 3080 in ~55 minutes

## πŸ“‹ Metadata Schema

Each chunk includes:

```json
{
  "pmcid": "PMC1234567",
  "title": "Paper title",
  "chunk_idx": 0,
  "source": "multimodal_corpus"
}
```

Source types:
- `multimodal_corpus` - Papers from curated PMC collection
- `targeted_paper` - High-priority STXBP1 papers
- `curated` - Hand-written expert entries

## πŸ”¬ Use Cases

1. **Therapeutic Research** - Find evidence for treatment approaches
2. **Variant Analysis** - Locate papers discussing specific mutations
3. **Mechanism Understanding** - Search for molecular pathway details
4. **Clinical Context** - Find case reports and trial results
5. **Literature Review** - Rapid survey of research landscape

## ⚑ Performance Notes

- **Free Tier Compatible**: BGE-base runs on CPU or minimal GPU
- **Query Time**: <100ms typical retrieval
- **Memory**: ~1-2GB RAM for embedding model

## πŸ”— Related Resources

- **STXBP1-ARIA MAX** (Nemotron embeddings): Coming soon
- **STXBP1-Variant-Lookup**: [HuggingFace Space](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup)
- **STXBP1 Foundation**: [stxbp1disorders.org](https://www.stxbp1disorders.org/)
- **ClinVar STXBP1**: [NCBI ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/?term=STXBP1)

## πŸ“„ Citation

```bibtex
@dataset{stxbp1_rag_database_2026,
  author = {Freygang, Adam},
  title = {STXBP1-ARIA RAG Database v9: BGE-Embedded Biomedical Literature for Therapeutic Discovery},
  year = {2026},
  publisher = {HuggingFace},
  url = {https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Database}
}
```

## πŸ“§ Contact

**Adam Freygang**  
AI/ML Engineer & STXBP1 Parent Researcher  
[SkyWhal3 on HuggingFace](https://huggingface.co/SkyWhal3)

---

*Built with ❀️ for the STXBP1 community*

*Part of the NeuroSenpai + STXBP1-ARIA therapeutic discovery system*