SkyWhal3 commited on
Commit
aa62385
Β·
verified Β·
1 Parent(s): c5306dc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +105 -86
README.md CHANGED
@@ -16,26 +16,48 @@ tags:
16
  - chromadb
17
  - vector-database
18
  - sentence-transformers
 
19
  size_categories:
20
- - 1M<n<10M
21
- pretty_name: STXBP1 RAG Database - ARIA
22
  ---
23
 
24
- # 🧬 STXBP1-ARIA RAG Database - (597 Million Tokens)
25
 
26
- A pre-built ChromaDB vector database containing **1,194,693 indexed text chunks** from **31,786 PubMed Central (PMC) biomedical papers** (5947 Million indexed Tokens <100ms) related to STXBP1, Munc18-1, synaptic transmission, epileptic encephalopathy, and related therapeutic research.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  ## πŸ“Š Dataset Statistics
29
 
30
  | Metric | Value |
31
  |--------|-------|
32
- | **Total Chunks** | 1,194,693 |
33
- | **Source Papers** | 31,786 PMC articles |
34
- | **Database Size** | ~17 GB |
35
- | **Embedding Model** | `all-MiniLM-L6-v2` (384 dimensions) |
36
- | **Chunk Size** | ~500 tokens with overlap |
37
- | **Token Count** | ~597,346,500 tokens |
38
  | **Index Type** | ChromaDB with HNSW |
 
39
 
40
  ## 🎯 Purpose
41
 
@@ -50,13 +72,14 @@ This database powers the **STXBP1-ARIA** therapeutic discovery system, enabling:
50
 
51
  ```
52
  STXBP1-RAG-Database/
53
- β”œβ”€β”€ chroma.sqlite3 # Main database (14.9 GB)
54
- └── d3ded7f6-11aa-4b46-836f-.../ # Index files
55
- β”œβ”€β”€ data_level0.bin # HNSW index data (2.0 GB)
56
- β”œβ”€β”€ header.bin # Index header
57
- β”œβ”€β”€ index_metadata.pickle # Index metadata
58
- β”œβ”€β”€ length.bin # Length data
59
- └── link_lists.bin # HNSW links
 
60
  ```
61
 
62
  ## πŸ”§ Usage
@@ -75,8 +98,8 @@ db_path = snapshot_download(
75
  repo_type="dataset"
76
  )
77
 
78
- # Load embedding model (must match indexing model!)
79
- embedder = SentenceTransformer("all-MiniLM-L6-v2")
80
 
81
  # Connect to ChromaDB
82
  client = chromadb.PersistentClient(
@@ -88,13 +111,13 @@ client = chromadb.PersistentClient(
88
  collection = client.get_collection("stxbp1_papers")
89
  print(f"Loaded {collection.count():,} chunks")
90
 
91
- # Search
92
  query = "STXBP1 dominant negative mechanism therapeutic approaches"
93
- query_embedding = embedder.encode([query]).tolist()
94
 
95
  results = collection.query(
96
- query_embeddings=query_embedding,
97
- n_results=5,
98
  include=["documents", "metadatas", "distances"]
99
  )
100
 
@@ -103,8 +126,8 @@ for doc, meta, dist in zip(
103
  results['metadatas'][0],
104
  results['distances'][0]
105
  ):
106
- score = 1 / (1 + dist) # Convert L2 distance to similarity
107
- print(f"[{meta['pmc_id']}] (score: {score:.3f})")
108
  print(f"{doc[:200]}...\n")
109
  ```
110
 
@@ -112,78 +135,69 @@ for doc, meta, dist in zip(
112
 
113
  See the full retriever implementation at: [STXBP1-Variant-Lookup Space](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup)
114
 
115
- ## πŸ“š Source Literature
116
 
117
- The database indexes PMC papers covering:
118
 
119
- - **STXBP1/Munc18-1** protein function and mutations
120
- - **Epileptic encephalopathy** and developmental disorders
121
- - **Synaptic transmission** mechanisms
122
- - **Gene therapy** approaches (AAV, base editing, prime editing)
123
- - **Chemical chaperones** (4-phenylbutyrate, etc.)
124
- - **Stop codon readthrough** compounds
125
- - **Protein folding** and aggregation
126
- - **Clinical trials** and case studies
127
 
128
- ### Search Terms Used for Corpus Collection
 
 
 
 
 
 
129
 
130
- ```
131
- STXBP1, Munc18-1, syntaxin binding protein,
132
- epileptic encephalopathy, developmental epilepsy,
133
- synaptic vesicle, neurotransmitter release,
134
- haploinsufficiency, dominant negative,
135
- chemical chaperone, 4-phenylbutyrate,
136
- base editing, prime editing, AAV gene therapy,
137
- stop codon readthrough, ataluren, gentamicin
138
- ```
139
 
140
  ## πŸ—οΈ How It Was Built
141
 
142
- ### 1. Paper Collection
143
- - Queried PubMed Central (PMC) Open Access subset
144
- - Downloaded full-text HTML/XML for 31,786 papers
145
- - Extracted text, figures, tables, and captions
 
146
 
147
- ### 2. Text Processing
148
- - Chunked documents into ~500 token segments
149
- - Preserved paragraph boundaries where possible
150
- - Added 50-token overlap between chunks
151
- - Retained metadata (PMC ID, title, section)
152
 
153
  ### 3. Embedding Generation
154
- - Used `sentence-transformers/all-MiniLM-L6-v2`
155
- - 384-dimensional embeddings
156
- - Batch processing with GPU acceleration
157
 
158
  ### 4. Index Building
159
  - ChromaDB with persistent storage
160
- - HNSW (Hierarchical Navigable Small World) index
161
- - Optimized for semantic similarity search
162
-
163
- ### Processing Time
164
- - Indexing: ~5 hours 42 minutes on AMD 5950X
165
- - Total chunks processed: 1,194,693 (~500 token chunk)
166
 
167
  ## πŸ“‹ Metadata Schema
168
 
169
- Each chunk includes metadata:
170
 
171
  ```json
172
  {
173
- "pmc_id": "PMC1234567",
174
  "title": "Paper title",
175
- "section": "Introduction",
176
- "chunk_index": 0,
177
- "source_type": "text"
178
  }
179
  ```
180
 
181
- ## ⚠️ Limitations
182
-
183
- - **English only** - Non-English papers excluded
184
- - **PMC Open Access** - Does not include paywalled literature
185
- - **Static snapshot** - Papers published after indexing date not included
186
- - **Chunk boundaries** - Some context may be split across chunks
187
 
188
  ## πŸ”¬ Use Cases
189
 
@@ -193,26 +207,31 @@ Each chunk includes metadata:
193
  4. **Clinical Context** - Find case reports and trial results
194
  5. **Literature Review** - Rapid survey of research landscape
195
 
196
- ## πŸ“„ Citation
197
 
198
- If you use this database in your research, please cite:
 
 
 
 
 
 
 
 
 
 
 
199
 
200
  ```bibtex
201
- @dataset{stxbp1_rag_database_2024,
202
  author = {Freygang, Adam},
203
- title = {STXBP1-ARIA RAG Database: A Vector Index of Biomedical Literature for Therapeutic Discovery},
204
- year = {2024},
205
  publisher = {HuggingFace},
206
  url = {https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Database}
207
  }
208
  ```
209
 
210
- ## πŸ”— Related Resources
211
-
212
- - **STXBP1-ARIA Space**: [huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup)
213
- - **STXBP1 Foundation**: [stxbp1disorders.org](https://www.stxbp1disorders.org/)
214
- - **ClinVar STXBP1**: [ncbi.nlm.nih.gov/clinvar/?term=STXBP1](https://www.ncbi.nlm.nih.gov/clinvar/?term=STXBP1)
215
-
216
  ## πŸ“§ Contact
217
 
218
  **Adam Freygang**
@@ -223,4 +242,4 @@ AI/ML Engineer & STXBP1 Parent Researcher
223
 
224
  *Built with ❀️ for the STXBP1 community*
225
 
226
- *Part of the NeuroSenpai v3 + STXBP1-ARIA therapeutic discovery system*
 
16
  - chromadb
17
  - vector-database
18
  - sentence-transformers
19
+ - bge
20
  size_categories:
21
+ - 100K<n<1M
22
+ pretty_name: STXBP1 RAG Database v9 - BGE Embeddings
23
  ---
24
 
25
+ # 🧬 STXBP1-ARIA RAG Database v9 - BGE Embeddings
26
 
27
+ 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.
28
+
29
+ > πŸ’‘ **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)**
30
+
31
+ ## πŸ†• What's New in v9
32
+
33
+ | Feature | v8 (Previous) | v9 (Current) |
34
+ |---------|---------------|--------------|
35
+ | **Embedding Model** | all-MiniLM-L6-v2 | **BGE-base-en-v1.5** |
36
+ | **Dimensions** | 384 | **768** |
37
+ | **Model Params** | 22M | **110M** |
38
+ | **MTEB Score** | ~56 | **~63** |
39
+ | **Corpus** | 31,786 papers (unfiltered) | **~17,000 papers (curated)** |
40
+ | **Chunks** | 1.19M (58% noise) | **~570K (high relevance)** |
41
+ | **Quality Focus** | Quantity | **Precision** |
42
+
43
+ ### Why BGE?
44
+
45
+ - **2x embedding dimensions** = finer semantic distinctions
46
+ - **5x larger model** = better understanding of biomedical terminology
47
+ - **Curated corpus** = removed irrelevant papers, kept STXBP1-focused content
48
+ - **MTEB benchmark leader** = proven retrieval performance
49
 
50
  ## πŸ“Š Dataset Statistics
51
 
52
  | Metric | Value |
53
  |--------|-------|
54
+ | **Total Chunks** | ~570,000 |
55
+ | **Source Papers** | ~17,000 PMC articles |
56
+ | **Database Size** | ~8-10 GB |
57
+ | **Embedding Model** | `BAAI/bge-base-en-v1.5` (768 dimensions) |
58
+ | **Chunk Size** | ~1500 chars with 200 char overlap |
 
59
  | **Index Type** | ChromaDB with HNSW |
60
+ | **Build Date** | January 2026 |
61
 
62
  ## 🎯 Purpose
63
 
 
72
 
73
  ```
74
  STXBP1-RAG-Database/
75
+ β”œβ”€β”€ chroma.sqlite3 # Main database
76
+ β”œβ”€β”€ metadata.json # Build info
77
+ └── [uuid]/ # HNSW index files
78
+ β”œβ”€β”€ data_level0.bin # Vector index
79
+ β”œβ”€β”€ header.bin
80
+ β”œβ”€β”€ index_metadata.pickle
81
+ β”œβ”€β”€ length.bin
82
+ └── link_lists.bin
83
  ```
84
 
85
  ## πŸ”§ Usage
 
98
  repo_type="dataset"
99
  )
100
 
101
+ # Load embedding model (MUST match indexing model!)
102
+ embedder = SentenceTransformer("BAAI/bge-base-en-v1.5")
103
 
104
  # Connect to ChromaDB
105
  client = chromadb.PersistentClient(
 
111
  collection = client.get_collection("stxbp1_papers")
112
  print(f"Loaded {collection.count():,} chunks")
113
 
114
+ # Search (BGE recommends query prefix for retrieval)
115
  query = "STXBP1 dominant negative mechanism therapeutic approaches"
116
+ query_embedding = embedder.encode(query, normalize_embeddings=True).tolist()
117
 
118
  results = collection.query(
119
+ query_embeddings=[query_embedding],
120
+ n_results=10,
121
  include=["documents", "metadatas", "distances"]
122
  )
123
 
 
126
  results['metadatas'][0],
127
  results['distances'][0]
128
  ):
129
+ pmcid = meta.get('pmcid', meta.get('pmc_id', 'Unknown'))
130
+ print(f"[{pmcid}] (distance: {dist:.3f})")
131
  print(f"{doc[:200]}...\n")
132
  ```
133
 
 
135
 
136
  See the full retriever implementation at: [STXBP1-Variant-Lookup Space](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup)
137
 
138
+ ## πŸ“š Curated Corpus
139
 
140
+ Unlike v8's broad collection, v9 uses a **curated corpus** filtered for STXBP1 relevance:
141
 
142
+ ### Primary Keywords (Auto-include)
143
+ - STXBP1, Munc18-1, Munc18, syntaxin binding protein
144
+ - UNC-18, N-Sec1
 
 
 
 
 
145
 
146
+ ### Related Keywords (Relevance filtered)
147
+ - **Epilepsy**: epileptic encephalopathy, Ohtahara, West syndrome, Dravet, infantile spasms
148
+ - **Synaptic**: SNARE complex, syntaxin-1, synaptic vesicle, exocytosis, neurotransmitter release
149
+ - **Genetics**: haploinsufficiency, dominant negative, nonsense/missense/frameshift mutations
150
+ - **Therapeutics**: gene therapy, AAV, ASO, CRISPR, base editing, prime editing
151
+ - **Chaperones**: 4-PBA, phenylbutyrate, protein folding, proteostasis
152
+ - **Neurodevelopment**: intellectual disability, developmental delay, autism
153
 
154
+ ### Curated Entries
155
+ Includes 24 hand-curated entries covering:
156
+ - Key primary research (Guiberson 2018, Kovacevic 2018, etc.)
157
+ - Therapeutic mechanism summaries
158
+ - Variant-specific knowledge
159
+ - Clinical trial information
 
 
 
160
 
161
  ## πŸ—οΈ How It Was Built
162
 
163
+ ### 1. Corpus Curation
164
+ - Filtered 27,000 multimodal PMC papers by relevance keywords
165
+ - Kept ~17,000 papers with direct STXBP1 relevance
166
+ - Added 41 targeted high-value papers
167
+ - Included 24 curated expert entries
168
 
169
+ ### 2. Text Processing
170
+ - Chunked documents into ~1500 character segments
171
+ - 200 character overlap between chunks
172
+ - Preserved document metadata (PMC ID, title)
 
173
 
174
  ### 3. Embedding Generation
175
+ - Used `BAAI/bge-base-en-v1.5` (768 dimensions)
176
+ - Normalized embeddings for cosine similarity
177
+ - GPU-accelerated batch processing
178
 
179
  ### 4. Index Building
180
  - ChromaDB with persistent storage
181
+ - HNSW index optimized for semantic search
182
+ - Built on RTX 3080 in ~55 minutes
 
 
 
 
183
 
184
  ## πŸ“‹ Metadata Schema
185
 
186
+ Each chunk includes:
187
 
188
  ```json
189
  {
190
+ "pmcid": "PMC1234567",
191
  "title": "Paper title",
192
+ "chunk_idx": 0,
193
+ "source": "multimodal_corpus"
 
194
  }
195
  ```
196
 
197
+ Source types:
198
+ - `multimodal_corpus` - Papers from curated PMC collection
199
+ - `targeted_paper` - High-priority STXBP1 papers
200
+ - `curated` - Hand-written expert entries
 
 
201
 
202
  ## πŸ”¬ Use Cases
203
 
 
207
  4. **Clinical Context** - Find case reports and trial results
208
  5. **Literature Review** - Rapid survey of research landscape
209
 
210
+ ## ⚑ Performance Notes
211
 
212
+ - **Free Tier Compatible**: BGE-base runs on CPU or minimal GPU
213
+ - **Query Time**: <100ms typical retrieval
214
+ - **Memory**: ~1-2GB RAM for embedding model
215
+
216
+ ## πŸ”— Related Resources
217
+
218
+ - **STXBP1-ARIA MAX** (Nemotron embeddings): Coming soon
219
+ - **STXBP1-Variant-Lookup**: [HuggingFace Space](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup)
220
+ - **STXBP1 Foundation**: [stxbp1disorders.org](https://www.stxbp1disorders.org/)
221
+ - **ClinVar STXBP1**: [NCBI ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/?term=STXBP1)
222
+
223
+ ## πŸ“„ Citation
224
 
225
  ```bibtex
226
+ @dataset{stxbp1_rag_database_2026,
227
  author = {Freygang, Adam},
228
+ title = {STXBP1-ARIA RAG Database v9: BGE-Embedded Biomedical Literature for Therapeutic Discovery},
229
+ year = {2026},
230
  publisher = {HuggingFace},
231
  url = {https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Database}
232
  }
233
  ```
234
 
 
 
 
 
 
 
235
  ## πŸ“§ Contact
236
 
237
  **Adam Freygang**
 
242
 
243
  *Built with ❀️ for the STXBP1 community*
244
 
245
+ *Part of the NeuroSenpai + STXBP1-ARIA therapeutic discovery system*