Projects / Your documents
Search your own documents privately
Ask questions across your PDFs and notes and get pointed to the right page, without uploading anything anywhere.
At a glance
- You'll get
- A simple search over a folder of your files that understands meaning, not just exact words.
- Time
- About 45 minutes
- Difficulty
- Moderate
- Computers
- Basic computer (8 GB), Regular computer (16 GB), PC with an NVIDIA graphics card (12 GB+), Mac with 32 GB or more
- Cost
- Free software. The easy way also needs an AI coding assistant, which may need a paid plan.
- Under the hood
- Local RAG with EmbeddingGemma + a local vector store. Models: EmbeddingGemma (or similar small embedding model)
Know the limits medium risk
- It can miss relevant passages or surface the wrong ones.
- If you pair it with a chat model, the written answer can misquote or misread your documents.
- Always click through to the source file and read the original before relying on it.
More in Using local AI safely.
Check the results before you rely on them.
The easy way: have an AI assistant do itRecommended if you're new to this
You'll need: an AI coding assistant installed on the computer you want to set up, such as Claude Code, Codex, or OpenCode. These are separate tools, and most need an account; some need a paid plan. The local AI you set up with it is free.
Open the assistant, paste the instructions below, and follow along. It will check your computer, install what's needed, and confirm everything works.
How do I open a terminal?
Windows: press the Windows key, type Terminal (or PowerShell), and press Enter. Mac: press Command+Space, type Terminal, and press Enter. Linux: press Ctrl+Alt+T on most systems. A terminal is a window where you type commands and press Enter to run them. Each assistant's site has its own install steps; you run them in the terminal.
What's an AI coding assistant?
It's a version of ChatGPT-style AI that can run commands on your computer for you, with your permission. You talk to it in plain English, and it does the typing.
Before you paste: this lets an AI assistant run commands on your computer. Read what it plans to do before you approve each step, and say no to anything you don't understand.
Set up private, fully local document search on this machine using a small embedding model (prefer EmbeddingGemma or another compact embedding model that fits in RAM).
Goals:
1. Ask me which folder(s) to index (default to a small sample folder if I have not said).
2. Detect available RAM/GPU and pick an embedding model that fits.
3. Install only local dependencies (no cloud embedding APIs).
4. Chunk, embed, and store vectors on disk.
5. Provide a simple CLI or script: `query "..."` that prints the top matching chunks with file paths.
6. Verify with a question whose answer appears in only one sample file.
Constraints:
- Do not upload document contents anywhere.
- Do not invent benchmark numbers.
- Keep the setup reproducible: write down exact model id, versions, and commands in a short README in the project folder.
When finished, tell me how to re-index and how to query.
Do it yourselfFor hands-on folks, or if you want to learn how it works
Before you start
Pick a folder of documents to try it on: manuals, notes, PDFs. Start small, a few dozen files is plenty. You'll need Python 3.10 or newer.
What does this mean?
This uses an embedding model: a small AI that turns each paragraph into a list of numbers describing its meaning. When you ask a question, it finds paragraphs with similar meaning. These models are tiny, so even an older 8 GB laptop can do it.
Do it yourself
Not yet tested on our computers. These steps use standard commands, but we haven't run this exact script end to end yet. This simple version reads plain-text files (.txt and .md). For PDFs, convert them to text first (step 3).
- Install Ollama from ollama.com and Python 3.10 or newer from python.org.
- Open a terminal and download a small embedding model:
ollama pull embeddinggemma - Put a few dozen text files in a folder called
docs. To turn PDFs into text, one free option ispdftotextfrom Poppler (Mac:brew install poppler; Ubuntu:sudo apt install poppler-utils):pdftotext manual.pdf docs/manual.txt - Save this as
search.pynext to thedocsfolder. It uses only Python's built-in libraries and talks to Ollama on your own computer:import json, math, pathlib, sys, urllib.request MODEL = "embeddinggemma" INDEX = pathlib.Path("index.json") def embed(texts): req = urllib.request.Request( "http://localhost:11434/api/embed", data=json.dumps({"model": MODEL, "input": texts}).encode(), headers={"Content-Type": "application/json"}) with urllib.request.urlopen(req) as r: return json.load(r)["embeddings"] def chunks(text, size=800): paras, buf = [p.strip() for p in text.split("\n\n") if p.strip()], "" for p in paras: if len(buf) + len(p) > size and buf: yield buf buf = "" buf += p + "\n\n" if buf: yield buf def build(): items = [] for f in sorted(pathlib.Path("docs").rglob("*")): if f.suffix.lower() in (".txt", ".md"): for c in chunks(f.read_text(errors="ignore")): items.append({"file": str(f), "text": c}) for i in range(0, len(items), 32): batch = items[i:i + 32] for item, vec in zip(batch, embed([x["text"] for x in batch])): item["vec"] = vec INDEX.write_text(json.dumps(items)) print(f"Indexed {len(items)} passages") def cosine(a, b): dot = sum(x * y for x, y in zip(a, b)) return dot / (math.sqrt(sum(x * x for x in a)) * math.sqrt(sum(y * y for y in b))) def ask(question): items = json.loads(INDEX.read_text()) q = embed([question])[0] for item in sorted(items, key=lambda x: cosine(q, x["vec"]), reverse=True)[:3]: print(f"--- {item['file']}\n{item['text'][:400]}\n") if sys.argv[1:] == ["index"]: build() else: ask(" ".join(sys.argv[1:])) - Build the index (run it again whenever you add files), then ask a question. Use
pythoninstead ofpython3on Windows:
It prints the three closest passages and the file each came from. Open that file and read the original.python3 search.py index python3 search.py "how do I reset the filter"
What is a "vector database"?
A file that stores those lists of numbers and can quickly find the closest matches. Chroma and sqlite-vec are free ones that live on your computer.
How to tell it worked
- Ask about something mentioned in only one file. That file comes up first.
- Nothing needs the internet after the first download.
Test results
Results pending. We'll publish speed and quality on each of our test computers once we've run it. Until then, no numbers.