STXBP1-RAG-Database / README.md
SkyWhal3's picture
Update README.md
aa62385 verified
---
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*