STXBP1-RAG-Nemotron / README.md
SkyWhal3's picture
Update README.md
fe7292a verified
|
Raw
History Blame
10.4 kB
---
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
- nvidia
- nemotron
- llama
- sentence-transformers
size_categories:
- 100K<n<1M
pretty_name: STXBP1 RAG Database v10 - NVIDIA Nemotron Embeddings (Premium)
---
# 🧬⚑ STXBP1-ARIA RAG Database v10 - NVIDIA Nemotron Embeddings
**The most advanced RAG database for STXBP1 therapeutic research.**
A pre-built ChromaDB vector database containing:
**571,465 indexed text chunks** from **~17,000 curated PubMed Central (PMC) biomedical papers**,
Embedded with NVIDIA's state-of-the-art **Llama-Nemotron-Embed-1B-v2** model featuring **2048-dimensional embeddings**.
> ⚑ **This is the premium GPU-accelerated version** β€” Nemotron embeddings deliver maximum semantic precision for therapeutic queries, but require a GPU with 2-4GB VRAM. For a lightweight CPU-friendly alternative, see: **[STXBP1-RAG-Database (BGE)](https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Database)**
## πŸ† Why Nemotron?
NVIDIA's Nemotron embedding model ranks **#2 on MTEB retrieval benchmarks** β€” distilled from their 8B flagship into an efficient 1B parameter model.
| Feature | BGE (v9) | **Nemotron (v10)** |
|---------|----------|---------------------|
| **Embedding Dims** | 768 | **2048** ⬆️ 2.7x |
| **Model Params** | 110M | **1B** ⬆️ 9x |
| **MTEB Retrieval** | ~63 | **~69** ⬆️ +6 pts |
| **Semantic Precision** | Good | **Excellent** |
| **Hardware** | CPU OK | **GPU recommended** |
| **Optional Reranker** | ❌ | **βœ… Available** |
### What 2048 Dimensions Means
```
Semantic Space Visualization:
768 dims (BGE) 2048 dims (Nemotron)
───────────────── ─────────────────────
● ●
/|\ / | \
/ | \ / | \
● ● ● ● ● ●
Good separation Rich semantic space!
Fine-grained distinctions
```
**Real-world impact:**
- "haploinsufficiency" vs "dominant negative" β†’ **better separated**
- "4-PBA chaperone" vs "AAV gene therapy" β†’ **distinct clusters**
- "K196X nonsense" vs "R406H missense" β†’ **clear differentiation**
## πŸ“Š Dataset Statistics
| Metric | Value |
|--------|-------|
| **Total Chunks** | 571,465 |
| **Source Papers** | ~17,000 PMC articles |
| **Curated Entries** | 24 expert-written |
| **Database Size** | ~11.5 GB |
| **Embedding Model** | `nvidia/llama-nemotron-embed-1b-v2` |
| **Embedding Dimensions** | 2048 |
| **Model Parameters** | 1B |
| **Chunk Size** | ~1500 chars with 200 char overlap |
| **Index Type** | ChromaDB with HNSW |
| **Build Hardware** | NVIDIA H100 80GB |
| **Build Date** | January 2026 |
## 🎯 Purpose
This database powers **STXBP1-ARIA MAX**, the premium therapeutic discovery system, enabling:
- **Maximum retrieval precision** for complex therapeutic queries
- **Fine-grained semantic distinctions** between mutation types and mechanisms
- **Optional reranking** with Nemotron cross-encoder for top-k refinement
- **Literature-grounded responses** with PMC citations
## πŸ“ Contents
```
STXBP1-RAG-Nemotron/
β”œβ”€β”€ chroma.sqlite3 # Main database (~7 GB)
β”œβ”€β”€ metadata.json # Build info & config
└── [uuid]/ # HNSW index files
β”œβ”€β”€ data_level0.bin # 2048-dim vectors (~4.6 GB)
β”œβ”€β”€ header.bin
β”œβ”€β”€ index_metadata.pickle
β”œβ”€β”€ length.bin
└── link_lists.bin
```
## πŸ”§ Usage
### Requirements
```bash
pip install transformers==4.47.1 sentence-transformers chromadb huggingface_hub torch
```
**Hardware:** GPU with 2-4GB VRAM recommended (runs on CPU but slower)
### 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-Nemotron",
repo_type="dataset"
)
# Load Nemotron embedding model (MUST match!)
embedder = SentenceTransformer(
"nvidia/llama-nemotron-embed-1b-v2",
trust_remote_code=True
)
# Move to GPU if available
import torch
if torch.cuda.is_available():
embedder = embedder.to('cuda')
# 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
query = "STXBP1 K196X nonsense mutation prime editing therapeutic approaches"
query_embedding = embedder.encode(query, convert_to_numpy=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:.4f})")
print(f"{doc[:200]}...\n")
```
### With Reranker (Maximum Precision)
```python
from sentence_transformers import CrossEncoder
# Load reranker
reranker = CrossEncoder(
"nvidia/llama-nemotron-rerank-1b-v2",
trust_remote_code=True
)
# Get more candidates, then rerank
results = collection.query(
query_embeddings=[query_embedding],
n_results=100, # Fetch more for reranking
include=["documents", "metadatas", "distances"]
)
# Rerank top candidates
docs = results['documents'][0]
pairs = [[query, doc] for doc in docs]
rerank_scores = reranker.predict(pairs)
# Sort by rerank score
ranked = sorted(
zip(rerank_scores, docs, results['metadatas'][0]),
key=lambda x: x[0],
reverse=True
)
# Top 10 after reranking
for score, doc, meta in ranked[:10]:
pmcid = meta.get('pmcid', 'Unknown')
print(f"[{pmcid}] rerank_score: {score:.4f}")
```
## πŸ“š Curated Corpus
The database indexes **~17,000 curated papers** filtered for STXBP1 relevance:
### Primary Keywords (Auto-include)
- STXBP1, Munc18-1, Munc18, syntaxin binding protein, UNC-18, N-Sec1
### Related Topics
- **Epilepsy & Encephalopathy**: DEE, Ohtahara, West syndrome, Dravet, infantile spasms
- **Synaptic Machinery**: SNARE complex, syntaxin-1, SNAP-25, synaptotagmin, exocytosis
- **Genetics**: haploinsufficiency, dominant negative, nonsense/missense mutations
- **Gene Therapy**: AAV, ASO, CRISPR, base editing, prime editing
- **Protein Therapeutics**: 4-PBA, chaperones, readthrough compounds
- **Neurodevelopment**: intellectual disability, autism, developmental delay
### Curated Expert Entries
24 hand-written entries covering:
- Guiberson 2018 (4-PBA mechanism)
- Kovacevic 2018 (functional characterization)
- Dominant negative vs haploinsufficiency mechanisms
- Variant-specific therapeutic summaries
- Clinical trial information (NCT04937062)
- Base/prime editing feasibility rules
## πŸ—οΈ How It Was Built
### Pipeline
1. **Corpus Curation** β€” Filtered 27K multimodal PMC papers β†’ 17K relevant
2. **Chunking** β€” 1500 char chunks with 200 char overlap
3. **Embedding** β€” NVIDIA Llama-Nemotron-Embed-1B-v2 (2048 dims)
4. **Indexing** β€” ChromaDB HNSW on H100 GPU
5. **Validation** β€” Core pack verification & curated injection
### Build Stats
| Stage | Details |
|-------|---------|
| Hardware | NVIDIA H100 80GB SXM5 |
| Batch Size | 128 |
| Build Time | ~4 hours |
| Total Chunks | 571,465 |
| Index Size | ~11.5 GB |
## ⚑ Performance
| Metric | Value |
|--------|-------|
| Query Embedding | ~50ms (GPU) |
| Retrieval (k=25) | ~20ms |
| + Reranking (k=100β†’25) | ~200ms |
| Total Latency | <300ms |
### GPU Memory Usage
| Mode | VRAM |
|------|------|
| Embedding only | ~2-3 GB |
| Embedding + Reranker | ~4-6 GB |
| T4 (16GB) | βœ… Compatible |
| RTX 3080 (10GB) | βœ… Compatible |
| Free Colab | ⚠️ Tight fit |
## πŸ“‹ Metadata Schema
```json
{
"pmcid": "PMC1234567",
"title": "Paper title (truncated to 500 chars)",
"chunk_idx": 0,
"source": "multimodal_corpus | targeted_paper | curated"
}
```
## πŸ”¬ Use Cases
1. **Precision Therapeutic Queries** β€” "What gene editing approaches work for STXBP1 nonsense mutations?"
2. **Variant-Specific Research** β€” "K196X dominant negative mechanism and rescue strategies"
3. **Mechanism Differentiation** β€” Distinguish haploinsufficiency from dominant negative
4. **Clinical Evidence** β€” Find trial data and case reports
5. **Comparative Analysis** β€” Compare therapeutic modalities with nuanced retrieval
## πŸ”— Related Resources
| Resource | Link |
|----------|------|
| **BGE Version (CPU-friendly)** | [STXBP1-RAG-Database](https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Database) |
| **STXBP1-ARIA MAX Space** | [HuggingFace Space](https://huggingface.co/spaces/SkyWhal3/STXBP1-ARIA-MAX) |
| **Variant Lookup** | [STXBP1-Variant-Lookup](https://huggingface.co/spaces/SkyWhal3/STXBP1-Variant-Lookup) |
| **STXBP1 Foundation** | [stxbp1disorders.org](https://www.stxbp1disorders.org/) |
| **Nemotron Model** | [nvidia/llama-nemotron-embed-1b-v2](https://huggingface.co/nvidia/llama-nemotron-embed-1b-v2) |
## πŸ“„ Citation
```bibtex
@dataset{stxbp1_rag_nemotron_2026,
author = {Freygang, Adam},
title = {STXBP1-ARIA RAG Nemotron: Premium Vector Database with NVIDIA Embeddings for Therapeutic Discovery},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/datasets/SkyWhal3/STXBP1-RAG-Nemotron}
}
```
## πŸ“§ Contact
**Adam Freygang**
AI/ML Engineer & STXBP1 Parent Researcher
[SkyWhal3 on HuggingFace](https://huggingface.co/SkyWhal3)
---
*Built with ❀️ and an H100 for the STXBP1 community*
*Part of the NeuroSenpai + STXBP1-ARIA therapeutic discovery system*
---
## πŸ™ Acknowledgments
- **NVIDIA** for the Nemotron embedding models
- **Lambda Labs** for H100 GPU access
- **STXBP1 Foundation** for supporting rare disease research
- **Anthropic Claude** for development assistance