rlama fully local RAG
Absolutely—here is the most complete, step-by-step, real-world “rlama on Windows + Anaconda + Ollama” install guide, blending your full troubleshooting journey (including the Python/conda, virtualenv, and PowerShell/curl/command prompt nuances). This captures all the pain points, real fixes, and copy-paste instructions you wish you had on day one.
How to Actually Install rlama and Ollama for Local RAG on Windows
(With Anaconda, Dedicated Virtual Environments, and Troubleshooting)
Intro
This is not a copy-paste from the docs—it’s a real, field-tested installation manual for Windows users running Anaconda, Ollama, and rlama for fully local RAG (Retrieval-Augmented Generation) setups.
You’ll learn both the "just make it work globally" method and the "fully project-isolated" workflow, so you never get stuck on rlama + Python dependency errors again.
1. Download rlama.exe for Windows
Go to the rlama releases page.
Copy the link for the latest rlama_windows_amd64.exe under Assets.
To Download:
PowerShell:
Invoke-WebRequest -Uri "PASTE-YOUR-LINK-HERE" -OutFile "$HOME\Downloads\rlama.exe"CMD/curl:
curl -L -o "%USERPROFILE%\Downloads\rlama.exe" "PASTE-YOUR-LINK-HERE"
2. Add rlama.exe to Your PATH (Optional but Recommended)
Move the binary to a folder in your PATH (or create one):
PowerShell:
Copy-Item "$HOME\Downloads\rlama.exe" "C:\tools\rlama.exe"CMD:
copy "%USERPROFILE%\Downloads\rlama.exe" C:\tools\rlama.exe
Add
C:\toolsto your PATH:Win+S → "environment variables" → Edit the system environment variables
Click Environment Variables...
Under System variables → Path → Edit... → New → C:\tools
OK out of all dialogs.
Open a new terminal:
rlama --version
3. Python + Dependency Setup: Two Approaches
A. Global (base) Anaconda Install (Quick and Works for Most)
If you just want rlama.exe to work from anywhere, do this:
Open Anaconda Prompt (base):
pip install -U FlagEmbedding torch transformers pdfminer.six docx2txt xlsx2csv sentencepiece
If you get errors with sentencepiece, see the troubleshooting section below for Python version/cmake tips!
B. Isolated Project Environment (Recommended for Projects and Clean Installs)
Use this if you want project isolation, the latest wheels, and avoid system pollution.
Step 1: Create Python 3.12 Environment
(Some packages break on 3.13+ as of mid-2025!)
conda create -n ragpy312 python=3.12
conda activate ragpy312
Step 2: Upgrade Essential Build Tools
pip install --upgrade pip setuptools wheel
If you see errors with CMake, you can also:
pip install cmake
# or (preferred, if you use conda-forge):
conda install -c conda-forge cmake
Step 3: Install All Python Dependencies
pip install FlagEmbedding torch transformers pdfminer.six docx2txt xlsx2csv sentencepiece
Step 4: Confirm Everything Works
python --version
python -c "import FlagEmbedding; import sentencepiece; print('All good!')"
You should see "All good!" with no errors.
4. Fixing “Python Was Not Found” and Dependency Errors
Check which Python is in your PATH:
where pythonThe first result must be your (base) or (ragpy312) python, not WindowsApps.
If rlama.exe can’t find Python or dependencies:
You probably installed them in a conda env, but the Go binary (rlama.exe) doesn’t see that env by default!
Solution 1 (Easiest):
Install all deps in (base), and always run rlama.exe from (base).
Solution 2 (Advanced):
Temporarily prepend your env to PATH before running rlama.exe:
set PATH=C:\Users\saad0\anaconda3\envs\ragpy312;C:\Users\saad0\anaconda3\envs\ragpy312\Scripts;%PATH% c:\tools\rlama.exe run myragThis lets rlama.exe “see” your env’s Python.
Solution 3 (For Python Package Only):
If you’re running as a module (for dev, not prod):
conda activate ragpy312 python -m rlama rag llama3 myrag "C:\Users\saad0\Documents\your_docs_folder" python -m rlama run myrag(Most users should use the .exe for CLI.)
5. Build Issues: sentencepiece/CMake
Problem:
error: subprocess-exited-with-error ... CMake Error ...
Solution:
Install cmake:
pip install cmake # or conda install -c conda-forge cmakeStill stuck? Use Python 3.12 (as above). Some wheels won’t build on 3.13+ as of 2025!
6. Pull Ollama Models
Works in CMD or PowerShell:
ollama pull llama3
ollama pull snowflake-arctic-embed2
7. Create and Run Your RAG Store
Assuming rlama.exe is in your PATH:
PowerShell:
rlama rag llama3 myrag "$HOME\Documents\your_docs_folder" rlama run myragCMD:
rlama rag llama3 myrag "%USERPROFILE%\Documents\your_docs_folder" rlama run myrag
8. Full Troubleshooting Timeline (Real-World Errors and Fixes)
Error 1:
No external extractor found. Text extraction will be limited.
⚠️ Warning: FlagEmbedding library is not installed. Run 'rlama install-dependencies' to install it
Fix: Ensure you installed all deps in the (base) env or your project env (see above).
Error 2:
Python was not found; run without arguments to install from the Microsoft Store...
Fix:
Check
where pythonand your PATH.Prepend your env as in Solution 2 above.
If running as
.exe, install in (base).
Error 3:
error: subprocess-exited-with-error ... CMake Error ...
Fix: Install cmake; downgrade to Python 3.12.
Error 4: “rlama run” gets stuck
Fix: Double-check your model is pulled (
ollama pull llama3).Ensure dependencies are present (see
pip listin your env).
9. Quick Summary Table
| Task | Anaconda (base) | Virtual Env (ragpy312) |
|---|---|---|
| Install deps for .exe | pip install ... (in base) | (rlama.exe ignores these) |
| Install deps for scripts | (doesn't isolate) | pip install ... (in env) |
| Run rlama.exe | rlama ... | rlama ... (needs hack for env) |
| Run as module | N/A | python -m rlama ... |
10. Pro Tips & Gotchas
Always check
where pythonand your PATH order before running rlama.exe.If you see "Python not found," you’re probably not in the right env, or PATH is wrong.
For most users, install everything in (base) and use rlama.exe.
For advanced scripting or isolation, use a conda env, but remember:
Go binaries ignore your activated venv unless you "hack" PATH.
Ultimate Copy-Paste for Clean, Isolated Setup
conda create -n ragpy312 python=3.12
conda activate ragpy312
pip install --upgrade pip setuptools wheel
pip install cmake
pip install FlagEmbedding torch transformers pdfminer.six docx2txt xlsx2csv sentencepiece
python -c "import FlagEmbedding; import sentencepiece; print('All good!')"
Now to use this Python for scripts:
python -m rlama rag llama3 myrag "C:\Users\saad0\Documents\your_docs_folder"
python -m rlama run myrag
Or for CLI rlama.exe, see above re: PATH hack!
Last Word
This is the battle-tested, bug-proof, hybrid setup for rlama + Ollama + Python on Windows, with real fixes for every error in the book. Bookmark, share, and save hours.
Great question! In rlama, if you update (change, add, or remove) documents in your RAG folder, you’ll want to re-synchronize your RAG database so it can chunk and re-embed the new/updated files.
Here’s exactly how to do it for each workflow:
A. If You Are Using rlama.exe (CLI Binary)
1. To Add/Sync New or Changed Documents
Use the
add-docscommand:rlama add-docs myrag "C:\Users\saad0\Documents\your_docs_folder"This adds or updates docs in the
myragRAG store, without wiping everything.
To remove docs that were deleted from the folder:
rlama does not auto-remove missing docs from the index—you must remove them manually with:rlama remove-doc myrag "name_of_file_to_remove"(Repeat for each deleted file if necessary.)
2. To Completely Rebuild the RAG Store
If you want a fresh start (e.g., massive document changes or cleanup):
Delete the RAG and recreate:
rlama delete myrag rlama rag llama3 myrag "C:\Users\saad0\Documents\your_docs_folder"This is a "hard reset"—all previous chunks and embeddings are erased, new ones are built from scratch.
B. If You Are Using the Python Module
In your active Python/conda env:
python -m rlama add-docs myrag "C:\Users\saad0\Documents\your_docs_folder"
# or
python -m rlama remove-doc myrag "name_of_file_to_remove"
Or recreate the RAG as above if you want a clean slate.
C. How to Confirm It Worked
List docs in the RAG:
rlama list-docs myrag(See what’s currently indexed.)
List all chunks:
rlama list-chunks myrag
Typical Update Flow for Most Users
Edit/add/remove docs in your RAG folder.
Run:
rlama add-docs myrag "C:\Users\saad0\Documents\your_docs_folder"Optionally clean up removed docs with
remove-docif you deleted files.Run your queries as usual:
rlama run myrag
Short version for your blog:
To resync after updating documents:
Runrlama add-docs myrag "your_docs_folder"to update the knowledge base with all new/changed docs. If you removed files, userlama remove-docfor each deleted doc, or delete/recreate the RAG for a full rebuild.
Added new text file to the todo folder, and ran:
(ragpy312) C:\Users\saad0\Documents\_RAG_DOCS>rlama add-docs todo ./todo
No external extractor found. Text extraction will be limited.
No external extractor found. Text extraction will be limited.
Found 3 supported files, 0 unsupported files, and 0 excluded files.
Checking Python text extraction tools...
Installing pdfminer.six...
Installing pdfminer.six...
Requirement already satisfied: pdfminer.six in c:\users\saad0\.rlama\venv\lib\site-packages (20250506)
Requirement already satisfied: charset-normalizer>=2.0.0 in c:\users\saad0\.rlama\venv\lib\site-packages (from pdfminer.six) (3.4.2)
Requirement already satisfied: cryptography>=36.0.0 in c:\users\saad0\.rlama\venv\lib\site-packages (from pdfminer.six) (45.0.5)
Requirement already satisfied: cffi>=1.14 in c:\users\saad0\.rlama\venv\lib\site-packages (from cryptography>=36.0.0->pdfminer.six) (1.17.1)
Requirement already satisfied: pycparser in c:\users\saad0\.rlama\venv\lib\site-packages (from cffi>=1.14->cryptography>=36.0.0->pdfminer.six) (2.22)
[notice] A new release of pip is available: 25.1.1 -> 25.2
[notice] To update, run: C:\Users\saad0\.rlama\venv\Scripts\python.exe -m pip install --upgrade pip
✅ pdfminer.six installed successfully!
Warning: no text extracted from C:\Users\saad0\Documents\_RAG_DOCS\todo\2025-07-29 Notes to self.txt
Document added: 2025-08-01 saad's todo - google doc.txt (3831 characters)
Document added: new 2.txt (90 characters)
Successfully loaded 2 new documents. Chunking documents...
Skipped 1 documents that were already in the RAG.
Generated 1 chunks from 1 new documents. Generating embeddings...
Generating embeddings: 1/1 chunks processed (100%)
Successfully generated embeddings for 1 chunks using 3 parallel workers
Successfully added 1 new documents (1 chunks) to RAG 'todo'.
Documents from './todo' added to RAG 'todo' successfully.
Next I ran:
(ragpy312) C:\Users\saad0\Documents\_RAG_DOCS>c:\tools\rlama.exe run todo
Still getting extractor problem, tried to run:
(base) C:\Users\saad0\Documents\_RAG_DOCS>conda install -c conda-forge sentencepiece
Success, next:
pip install --upgrade FlagEmbedding torch transformers pdfminer.six docx2txt xlsx2csv
Comments
Post a Comment