Open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Then follow the on-screen "add to PATH" instructions it prints (copy/paste the echo line it gives you), or do:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"brew install python gitbrew install --cask ollamaLaunch the Ollama app (from Applications or Spotlight). That starts a local server.
mkdir -p ~/local-rag && cd ~/local-rag
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pippip install chromadb fastembed pypdf python-docx gradio requestsollama pull llama3.1:8b-instruct-q4_K_M
# or
ollama pull llama3.2:3b-instruct-q4_K_MQuick check that Ollama is running:
curl http://localhost:11434/api/tagsIf it prints JSON with your model tag, you're good.
Make sure your data is here (PDF/DOCX/TXT/MD):
/Users/nassar/Documents/local_rag/data (change this to your path)
Create build_index.py file:
Run it (first run downloads the small embedding model once):
python build_index.pyYou should see something like:
Found X files; prepared Y non-empty chunks.
Computed Y embeddings.
Indexed Y chunks.
Create app.py file:
Run it:
python app.pyOpen the local URL it prints (usually http://127.0.0.1:7860)
Any time you add/edit files in /Users/nassar/Documents/local_rag/, rebuild:
python build_index.py(You can keep the chat running; restart if you like.)