Bluebeam JS RAG — Step-by-step setup (Python, local)

This is a practical, minimal RAG you can use to ask questions about your Bluebeam Revu JavaScript snippets, office standards, and gotchas.
Goal: retrieve your best internal notes/snippets → then optionally feed them to an LLM (ChatGPT, local model, etc).

Table of contents

  1. What you’re building
  2. Prereqs
  3. Step 1 — Create the project folder
  4. Step 2 — Python venv + install packages
  5. Step 3 — Build your knowledge base (docs)
  6. Step 4 — Ingest + chunk + embed + index
  7. Step 5 — Ask questions (retrieve top matches)
  8. Step 6 — Optional web UI (Flask)
  9. Step 7 — Optional: connect to an LLM
  10. Bluebeam-specific RAG tips
  11. Maintenance checklist

1) What you’re building

RAGPythonLocalFAISS

You’ll create a folder of “truth” documents (your best Bluebeam JS snippets and notes). A Python ingest script will:

  1. Read all docs (Markdown/Text)
  2. Split them into chunks (small pieces)
  3. Create embeddings for each chunk (vector representations)
  4. Store them in a local FAISS index

Then, when you ask a question, Python will:

  1. Embed the question
  2. Search FAISS for the closest chunks
  3. Return the best matching snippets (and their source files)

✅ This alone is extremely useful: it stops “where did that snippet live?” and prevents mixing Acrobat JS that Bluebeam doesn’t support.

2) Prereqs

⚠️ If you want to use an LLM later, you can: (a) paste retrieved snippets into ChatGPT manually, or (b) call an API or local model. This guide keeps the core RAG LLM-agnostic (so it won’t break when APIs change).

3) Step 1 — Create the project folder

Create a new folder somewhere like:

bluebeam-rag/
  docs/
  index/
  app.py
  ingest.py
  rag.py
  requirements.txt

What these are:

4) Step 2 — Python venv + install packages

Windows (PowerShell)

cd path\to\bluebeam-rag
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip

macOS / Linux

cd /path/to/bluebeam-rag
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip

Create requirements.txt

faiss-cpu
sentence-transformers
numpy
flask

Install

pip install -r requirements.txt

Note: faiss-cpu installs a CPU version of FAISS (fast local vector search). Works great for a few thousand chunks.

5) Step 3 — Build your knowledge base (docs)

In docs/, create a small set of curated Markdown files. Start small (10–30 pages) and grow.

Recommended doc structure

docs/
  00_README_OFFICE_STANDARDS.md
  01_BLUEBEAM_GOTCHAS.md
  headers/
    header_fields_all_pages.md
    limit_characters_multiline.md
  page_numbering/
    page_x_of_y_willsave_willprint.md
  examples/
    full_script_header_plus_pagenum.md

Example content template (copy into each doc)

# Title (what this solves)

## Where it runs
- [ ] Console (Ctrl+J)
- [ ] Document-level JavaScript
- [ ] Field-level script (Calculate/Format/etc)

## Purpose
What this does, in plain English.

## Known limitations / gotchas
- Bluebeam quirk #1
- Acrobat-only API you must NOT use
- Page coordinates notes

## Snippet (tested)
```js
// paste working Bluebeam JS here