--- 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 ⚡ **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