Spaces:
Sleeping
Sleeping
metadata
title: RAG Books MCP v2 (ESL + ISLP + FES + PDSH)
emoji: 📖
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.50.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: MCP v2 RAG ESL+ISLP+FES+PDSH. ChromaDB desde dataset HF.
tags:
- mcp-server-track
- rag
- statistical-learning
- chromadb
📖 RAG Books MCP v2 — ESL + ISLP + FES + PDSH
Servidor MCP que expone búsqueda semántica sobre cuatro libros de referencia de Statistical Learning y Data Science, accesible por UI web y por clientes MCP (Kiro, Claude Desktop, Cursor, etc.).
| Libro | Autores | Rol |
|---|---|---|
| ESL — The Elements of Statistical Learning | Hastie, Tibshirani, Friedman | Teoría rigurosa |
| ISLP — An Introduction to Statistical Learning with Python | James, Witten, Hastie, Tibshirani | Teoría intuitiva con Python |
| FES — Feature Engineering and Selection | Kuhn, Johnson | Heurísticas de FE |
| PDSH — Python Data Science Handbook | VanderPlas | Implementación Python |
ℹ️ Sobre R4DS — R for Data Science, 2nd Ed. (Wickham, Çetinkaya-Rundel, Grolemund) está indexado en la variante local del server pero NO en este Space. La razón es su licencia CC BY-NC-ND 3.0 US (NoDerivatives), incompatible con redistribución pública en formato vectorial. Para usar R4DS, ejecuta el server localmente con
RAG_CHROMA_DIRapuntando a tu propiochroma_db/con R4DS indexado. Detalles y procedimiento en el DATA_CARD del dataset.
v1 vs v2
- v1: la base ChromaDB se empaqueta dentro del Space.
- v2 (este Space): la base ChromaDB se carga del dataset HF
gusdelact/rag-esl-islp-chromadbvíasnapshot_download. La primera tool call descarga ~95 MB; las siguientes son cache hit.
Endpoint MCP
https://<usuario>-<space-name>.hf.space/gradio_api/mcp/
Conexión desde un cliente MCP
{
"mcpServers": {
"rag-books-mcp-v2": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://<usuario>-<space-name>.hf.space/gradio_api/mcp/"
]
}
}
}
Variables de entorno reconocidas
| Variable | Default | Descripción |
|---|---|---|
RAG_CHROMA_DATASET |
gusdelact/rag-esl-islp-chromadb |
Repo del dataset con la base ChromaDB. |
RAG_CHROMA_REVISION |
main |
Revision (branch/tag/commit) a descargar. Recomendado pinear a un tag (ej. v2.1.0). |
RAG_CHROMA_CACHE_DIR |
/data/chroma_db (si existe /data) o ~/.cache/... |
Cache local de la descarga. |
RAG_CHROMA_DIR |
— | Si está set y la carpeta existe, omite el download. Único modo en el que R4DS está disponible (cuando indexas localmente con r4ds_chapters). |
HF_TOKEN |
— | Solo si el dataset es privado. |
Tools
| Tool | Descripción |
|---|---|
search_theory(query, book, top_k) |
Búsqueda semántica en los libros disponibles. book ∈ {esl, islp, fes, pdsh, both, all}. En modo local también r4ds. |
get_section(book, chapter, section, max_chunks) |
Sección específica por referencia. |
cite_foundation(topic, detail_level) |
Fundamentación teórica multi-libro. |
list_available_topics() |
Lista capítulos y secciones indexados. |
Stack
- Embeddings:
sentence-transformers/all-MiniLM-L6-v2(local, sin API key). - Vector store: ChromaDB descargado de HF Hub.
- UI / MCP: Gradio con
mcp_server=True. - Chunks publicados: 3005 (1093 ESL + 884 ISLP + 465 FES + 563 PDSH).