Update README.md
Browse files
README.md
CHANGED
|
@@ -16,26 +16,48 @@ tags:
|
|
| 16 |
- chromadb
|
| 17 |
- vector-database
|
| 18 |
- sentence-transformers
|
|
|
|
| 19 |
size_categories:
|
| 20 |
-
-
|
| 21 |
-
pretty_name: STXBP1 RAG Database -
|
| 22 |
---
|
| 23 |
|
| 24 |
-
# 𧬠STXBP1-ARIA RAG Database -
|
| 25 |
|
| 26 |
-
A pre-built ChromaDB vector database containing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
## π Dataset Statistics
|
| 29 |
|
| 30 |
| Metric | Value |
|
| 31 |
|--------|-------|
|
| 32 |
-
| **Total Chunks** |
|
| 33 |
-
| **Source Papers** |
|
| 34 |
-
| **Database Size** | ~
|
| 35 |
-
| **Embedding Model** | `
|
| 36 |
-
| **Chunk Size** | ~
|
| 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
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
βββ
|
| 57 |
-
βββ
|
| 58 |
-
βββ
|
| 59 |
-
|
|
|
|
| 60 |
```
|
| 61 |
|
| 62 |
## π§ Usage
|
|
@@ -75,8 +98,8 @@ db_path = snapshot_download(
|
|
| 75 |
repo_type="dataset"
|
| 76 |
)
|
| 77 |
|
| 78 |
-
# Load embedding model (
|
| 79 |
-
embedder = SentenceTransformer("
|
| 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(
|
| 94 |
|
| 95 |
results = collection.query(
|
| 96 |
-
query_embeddings=query_embedding,
|
| 97 |
-
n_results=
|
| 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 |
-
|
| 107 |
-
print(f"[{
|
| 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 |
-
## π
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
-
|
| 120 |
-
-
|
| 121 |
-
-
|
| 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 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
base editing, prime editing, AAV gene therapy,
|
| 137 |
-
stop codon readthrough, ataluren, gentamicin
|
| 138 |
-
```
|
| 139 |
|
| 140 |
## ποΈ How It Was Built
|
| 141 |
|
| 142 |
-
### 1.
|
| 143 |
-
-
|
| 144 |
-
-
|
| 145 |
-
-
|
|
|
|
| 146 |
|
| 147 |
-
### 2. Text Processing
|
| 148 |
-
- Chunked documents into ~
|
| 149 |
-
-
|
| 150 |
-
-
|
| 151 |
-
- Retained metadata (PMC ID, title, section)
|
| 152 |
|
| 153 |
### 3. Embedding Generation
|
| 154 |
-
- Used `
|
| 155 |
-
-
|
| 156 |
-
-
|
| 157 |
|
| 158 |
### 4. Index Building
|
| 159 |
- ChromaDB with persistent storage
|
| 160 |
-
- HNSW
|
| 161 |
-
-
|
| 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
|
| 170 |
|
| 171 |
```json
|
| 172 |
{
|
| 173 |
-
"
|
| 174 |
"title": "Paper title",
|
| 175 |
-
"
|
| 176 |
-
"
|
| 177 |
-
"source_type": "text"
|
| 178 |
}
|
| 179 |
```
|
| 180 |
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
-
|
| 184 |
-
-
|
| 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 |
-
##
|
| 197 |
|
| 198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
```bibtex
|
| 201 |
-
@dataset{
|
| 202 |
author = {Freygang, Adam},
|
| 203 |
-
title = {STXBP1-ARIA RAG Database:
|
| 204 |
-
year = {
|
| 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
|
|
|
|
| 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*
|