Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: RAG Books MCP v2 (ESL + ISLP)
|
| 3 |
emoji: 📖
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
|
@@ -8,7 +8,7 @@ sdk_version: 5.50.0
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
-
short_description: MCP v2 RAG ESL+ISLP. ChromaDB desde dataset HF.
|
| 12 |
tags:
|
| 13 |
- mcp-server-track
|
| 14 |
- rag
|
|
@@ -16,14 +16,33 @@ tags:
|
|
| 16 |
- chromadb
|
| 17 |
---
|
| 18 |
|
| 19 |
-
# 📖 RAG Books MCP v2 — ESL + ISLP
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
[`gusdelact/rag-esl-islp-chromadb`](https://huggingface.co/datasets/gusdelact/rag-esl-islp-chromadb)
|
| 26 |
-
vía `snapshot_download`. La primera tool call descarga ~
|
| 27 |
siguientes son cache hit.
|
| 28 |
|
| 29 |
## Endpoint MCP
|
|
@@ -54,18 +73,18 @@ https://<usuario>-<space-name>.hf.space/gradio_api/mcp/
|
|
| 54 |
| Variable | Default | Descripción |
|
| 55 |
|---|---|---|
|
| 56 |
| `RAG_CHROMA_DATASET` | `gusdelact/rag-esl-islp-chromadb` | Repo del dataset con la base ChromaDB. |
|
| 57 |
-
| `RAG_CHROMA_REVISION` | `main` | Revision (branch/tag/commit) a descargar. |
|
| 58 |
| `RAG_CHROMA_CACHE_DIR` | `/data/chroma_db` (si existe `/data`) o `~/.cache/...` | Cache local de la descarga. |
|
| 59 |
-
| `RAG_CHROMA_DIR` | — | Si está set y la carpeta existe, omite el download. |
|
| 60 |
| `HF_TOKEN` | — | Solo si el dataset es privado. |
|
| 61 |
|
| 62 |
## Tools
|
| 63 |
|
| 64 |
| Tool | Descripción |
|
| 65 |
|------|-------------|
|
| 66 |
-
| `search_theory(query, book, top_k)` | Búsqueda semántica en
|
| 67 |
| `get_section(book, chapter, section, max_chunks)` | Sección específica por referencia. |
|
| 68 |
-
| `cite_foundation(topic, detail_level)` | Fundamentación
|
| 69 |
| `list_available_topics()` | Lista capítulos y secciones indexados. |
|
| 70 |
|
| 71 |
## Stack
|
|
@@ -73,3 +92,4 @@ https://<usuario>-<space-name>.hf.space/gradio_api/mcp/
|
|
| 73 |
- **Embeddings:** `sentence-transformers/all-MiniLM-L6-v2` (local, sin API key).
|
| 74 |
- **Vector store:** ChromaDB descargado de HF Hub.
|
| 75 |
- **UI / MCP:** Gradio con `mcp_server=True`.
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: RAG Books MCP v2 (ESL + ISLP + FES + PDSH)
|
| 3 |
emoji: 📖
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
+
short_description: MCP v2 RAG ESL+ISLP+FES+PDSH. ChromaDB desde dataset HF.
|
| 12 |
tags:
|
| 13 |
- mcp-server-track
|
| 14 |
- rag
|
|
|
|
| 16 |
- chromadb
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# 📖 RAG Books MCP v2 — ESL + ISLP + FES + PDSH
|
| 20 |
|
| 21 |
+
Servidor MCP que expone búsqueda semántica sobre cuatro libros de referencia
|
| 22 |
+
de Statistical Learning y Data Science, accesible por UI web y por clientes
|
| 23 |
+
MCP (Kiro, Claude Desktop, Cursor, etc.).
|
| 24 |
|
| 25 |
+
| Libro | Autores | Rol |
|
| 26 |
+
|---|---|---|
|
| 27 |
+
| **ESL** — *The Elements of Statistical Learning* | Hastie, Tibshirani, Friedman | Teoría rigurosa |
|
| 28 |
+
| **ISLP** — *An Introduction to Statistical Learning with Python* | James, Witten, Hastie, Tibshirani | Teoría intuitiva con Python |
|
| 29 |
+
| **FES** — *Feature Engineering and Selection* | Kuhn, Johnson | Heurísticas de FE |
|
| 30 |
+
| **PDSH** — *Python Data Science Handbook* | VanderPlas | Implementación Python |
|
| 31 |
+
|
| 32 |
+
> ℹ️ **Sobre R4DS** — *R for Data Science, 2nd Ed.* (Wickham, Çetinkaya-Rundel,
|
| 33 |
+
> Grolemund) está indexado en la **variante local** del server pero **NO en
|
| 34 |
+
> este Space**. La razón es su licencia CC BY-NC-ND 3.0 US (NoDerivatives),
|
| 35 |
+
> incompatible con redistribución pública en formato vectorial. Para usar R4DS,
|
| 36 |
+
> ejecuta el server localmente con `RAG_CHROMA_DIR` apuntando a tu propio
|
| 37 |
+
> `chroma_db/` con R4DS indexado. Detalles y procedimiento en el
|
| 38 |
+
> [DATA_CARD del dataset](https://huggingface.co/datasets/gusdelact/rag-esl-islp-chromadb).
|
| 39 |
+
|
| 40 |
+
## v1 vs v2
|
| 41 |
+
|
| 42 |
+
- **v1:** la base ChromaDB se empaqueta dentro del Space.
|
| 43 |
+
- **v2 (este Space):** la base ChromaDB se carga del dataset HF
|
| 44 |
[`gusdelact/rag-esl-islp-chromadb`](https://huggingface.co/datasets/gusdelact/rag-esl-islp-chromadb)
|
| 45 |
+
vía `snapshot_download`. La primera tool call descarga ~95 MB; las
|
| 46 |
siguientes son cache hit.
|
| 47 |
|
| 48 |
## Endpoint MCP
|
|
|
|
| 73 |
| Variable | Default | Descripción |
|
| 74 |
|---|---|---|
|
| 75 |
| `RAG_CHROMA_DATASET` | `gusdelact/rag-esl-islp-chromadb` | Repo del dataset con la base ChromaDB. |
|
| 76 |
+
| `RAG_CHROMA_REVISION` | `main` | Revision (branch/tag/commit) a descargar. Recomendado pinear a un tag (ej. `v2.1.0`). |
|
| 77 |
| `RAG_CHROMA_CACHE_DIR` | `/data/chroma_db` (si existe `/data`) o `~/.cache/...` | Cache local de la descarga. |
|
| 78 |
+
| `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`). |
|
| 79 |
| `HF_TOKEN` | — | Solo si el dataset es privado. |
|
| 80 |
|
| 81 |
## Tools
|
| 82 |
|
| 83 |
| Tool | Descripción |
|
| 84 |
|------|-------------|
|
| 85 |
+
| `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`. |
|
| 86 |
| `get_section(book, chapter, section, max_chunks)` | Sección específica por referencia. |
|
| 87 |
+
| `cite_foundation(topic, detail_level)` | Fundamentación teórica multi-libro. |
|
| 88 |
| `list_available_topics()` | Lista capítulos y secciones indexados. |
|
| 89 |
|
| 90 |
## Stack
|
|
|
|
| 92 |
- **Embeddings:** `sentence-transformers/all-MiniLM-L6-v2` (local, sin API key).
|
| 93 |
- **Vector store:** ChromaDB descargado de HF Hub.
|
| 94 |
- **UI / MCP:** Gradio con `mcp_server=True`.
|
| 95 |
+
- **Chunks publicados:** 3005 (1093 ESL + 884 ISLP + 465 FES + 563 PDSH).
|