Sets up local RAG dependencies and index for this repository on lxplus/CVMFS-safe Python environments. Use when the user asks to set up RAG, initialize embeddings, build/rebuild .cursor/rag_db, ingest curated notes, or run setup_rag.sh.
Prepare a working local RAG environment for this repo and build .cursor/rag_db.
From repository root, run:
python3 -m venv ~/mcp_env
source ~/mcp_env/bin/activate
python -m pip install --upgrade pip
bash .cursor/setup_rag.sh
Then, if requested:
./scripts/reliability_loop.sh
Use this when setup_rag.sh is unavailable or debugging setup:
python -m pip install -r requirements.txt
python -m pip install -r .cursor/requirements.txt
python .cursor/index_documents.py
After setup, verify:
python -m pip -V points to ~/mcp_env/... and not /cvmfs/.....cursor/rag_db/ exists and is populated.requirements.txt files.If pip resolves to /cvmfs/..., stop and fix environment:
source ~/mcp_env/bin/activate
which python
python -m pip -V
Only continue when pip is in the writable venv.
Index first, then start server:
python .cursor/index_documents.py
bash .cursor/run_mcp_server.sh
Optional curated note ingestion:
python .cursor/ingest.py --title "My note" --file note.md --tags notes,workflow
If interpreter mismatch appears, use:
MCP_PYTHON=~/mcp_env/bin/python bash .cursor/run_mcp_server.sh
When complete, report:
.cursor/rag_db was rebuilt