-
Notifications
You must be signed in to change notification settings - Fork 272
docs(examples): add rag-params-finder external project guide #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
neomatrix369
wants to merge
7
commits into
superlinked:main
Choose a base branch
from
neomatrix369:docs/upstream-rag-params-finder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5e373c2
docs(examples): add rag-params-finder external project guide
neomatrix369 4cb9cb8
docs(examples): define External project guide status in gallery
neomatrix369 57a2c26
docs(examples): address CodeRabbit review on rag-params-finder guide
neomatrix369 05290bd
docs(examples): preserve MONGODB_URI and bound encode wait
neomatrix369 2ae9b5f
docs(examples): apply tripwire gallery lessons to rag-params-finder
neomatrix369 af93dac
docs(examples): fix encode wait bound and HF_TOKEN wording
neomatrix369 bc1357b
docs(examples): mention both SIE paths and fix Docker endpoint URL
neomatrix369 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Find the best RAG config before you build | ||
|
|
||
| > Sweep embeddings × chunking × retrieval on **your** data — then ship the winning config first. | ||
|
|
||
| This is an **external project guide**. The runnable app lives in | ||
| [neomatrix369/rag-params-finder](https://github.com/neomatrix369/rag-params-finder) | ||
| (MIT). This folder is the SIE-facing onboarding surface: short pages here, full | ||
| detail in that repo. | ||
|
|
||
| **SIE primitives used:** `encode` (embeddings via BGE-M3 / Stella-v5 / SPLADE-v3); | ||
| optional `score` (SIE rerank). SIE is **opt-in** — the default stack runs without it. | ||
|
|
||
| ## Who this is for | ||
|
|
||
| | You are… | Start here | | ||
| |---|---| | ||
| | New to SIE, found this in the gallery | [Getting started](./getting-started.md) → [SIE integration](./sie-integration.md) | | ||
| | New to rag-params-finder, want SIE embeddings | Same path — then [What SIE does here](./what-sie-does.md) | | ||
|
|
||
| Both audiences share the same **local** starting path (MongoDB stack + | ||
| dashboard). SIE is optional afterward: configure a remote gateway or start | ||
| self-hosted SIE, then run one `example-sie.yaml` sweep. | ||
|
|
||
| ## Start here | ||
|
|
||
| 1. [Getting started](./getting-started.md) — clone, prereqs, local Mongo path, dashboard | ||
| 2. [SIE integration](./sie-integration.md) — env vars, health checks, first SIE sweep | ||
| 3. [What SIE does here](./what-sie-does.md) — models, encode/score, vs Voyage/local | ||
| 4. [Troubleshooting](./troubleshooting.md) — short FAQ + deep-links | ||
|
|
||
| **Canonical docs in the project:** | ||
| [QUICKSTART](https://github.com/neomatrix369/rag-params-finder/blob/main/QUICKSTART.md) · | ||
| [SIE setup](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md) · | ||
| [docs index](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/README.md) | ||
|
|
||
| ## Ports cheat sheet | ||
|
|
||
| | Service | Port | Notes | | ||
| |---|---|---| | ||
| | API | `8001` | rag-params-finder server | | ||
| | Dashboard | `5374` | Experiments UI | | ||
| | SIE (self-hosted only) | `8720` | Not started by `./start-services.sh` | | ||
|
|
||
| ## Attribution | ||
|
|
||
| Built and maintained in | ||
| [neomatrix369/rag-params-finder](https://github.com/neomatrix369/rag-params-finder) | ||
| under the [MIT License](https://github.com/neomatrix369/rag-params-finder/blob/main/LICENSE). | ||
| Screenshots and deeper guides live in that repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Getting started (without SIE yet) | ||
|
|
||
| Goal: clone the external repo, start the local MongoDB stack, and open the | ||
| dashboard. Enable SIE in [SIE integration](./sie-integration.md) after this works. | ||
|
|
||
| **Source of truth:** | ||
| [QUICKSTART.md](https://github.com/neomatrix369/rag-params-finder/blob/main/QUICKSTART.md) | ||
| in the project repo. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Git | ||
| - Docker Desktop (running) | ||
| - For host CLI later: Python 3.12+, [`uv`](https://docs.astral.sh/uv/) | ||
|
|
||
| No Atlas account, Voyage key, or SIE credentials are required for this path. | ||
|
|
||
| ## Clone and start (MongoDB local) | ||
|
|
||
| ```bash | ||
| git clone https://github.com/neomatrix369/rag-params-finder.git | ||
| cd rag-params-finder | ||
| cp .env.example .env | ||
| ./start-services.sh --mongodb-local | ||
| ``` | ||
|
|
||
| Open **http://localhost:5374**. The stack starts MongoDB Atlas Local, the API | ||
| server (`:8001`), and the dashboard. SIE is **not** started — that is intentional. | ||
|
|
||
| Verify the API: | ||
|
|
||
| ```bash | ||
| curl -s http://localhost:8001/health | ||
| ``` | ||
|
|
||
| You should see the server healthy. With default `.env`, SIE reports as | ||
| `"sie": "disabled"`. | ||
|
|
||
| ## Other storage paths | ||
|
|
||
| | Path | When | Doc | | ||
| |---|---|---| | ||
| | Atlas cloud | You already have `MONGODB_URI` | [QUICKSTART Path B](https://github.com/neomatrix369/rag-params-finder/blob/main/QUICKSTART.md) | | ||
| | Postgres / pgvector | Prefer Supabase or local Postgres | [Postgres setup](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/postgres-setup.md) | | ||
| | Manual two-terminal | No Docker for the app | [QUICKSTART Path C](https://github.com/neomatrix369/rag-params-finder/blob/main/QUICKSTART.md) | | ||
|
|
||
| Step-by-step install and first experiment: | ||
| [getting-started.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/getting-started.md). | ||
|
|
||
| ## Next | ||
|
|
||
| Before the host CLI / SIE handoff, export the URI the startup script printed | ||
| (leave `.env` placeholders unchanged for Atlas Local): | ||
|
|
||
| ```bash | ||
| # value also printed by ./start-services.sh --mongodb-local | ||
| export MONGODB_URI="mongodb://localhost:27017/rag_params_finder?directConnection=true" | ||
| ``` | ||
|
|
||
| Then wire SIE and run one sweep: [SIE integration](./sie-integration.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| # SIE integration | ||
|
|
||
| SIE is **opt-in**. `./start-services.sh` and default Compose start the server + | ||
| dashboard only — they never start SIE. | ||
|
|
||
| **Source of truth:** | ||
| [docs/user-guide/sie-setup.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md). | ||
|
|
||
| ## Happy path — remote gateway (recommended) | ||
|
|
||
| Finish [Getting started](./getting-started.md) first so `:8001` is up and | ||
| `MONGODB_URI` is exported for the host CLI. | ||
|
|
||
| In the project `.env`: | ||
|
|
||
| ```bash | ||
| SIE_ENABLED=true | ||
| SIE_ENDPOINT=https://your-sie-gateway.example.com | ||
| SIE_API_KEY=your_gateway_token | ||
| ``` | ||
|
|
||
| Reload the server so it picks up the new env (a plain restart is not enough for | ||
| Compose — env is baked in at container create time): | ||
|
|
||
| ```bash | ||
| # Compose (typical after ./start-services.sh) | ||
| docker compose up -d --force-recreate server | ||
|
|
||
| # Host-run server instead: reload or restart uvicorn | ||
| ``` | ||
|
|
||
| Load only SIE vars into the **current shell** before gateway curls (do not | ||
| `source .env` wholesale — that overwrites the host CLI `MONGODB_URI` export | ||
| from [Getting started](./getting-started.md) with the Atlas placeholder): | ||
|
|
||
| ```bash | ||
| export SIE_ENABLED=true | ||
| export SIE_ENDPOINT=https://your-sie-gateway.example.com | ||
| export SIE_API_KEY=your_gateway_token | ||
| # keep the earlier MONGODB_URI export for Atlas Local host CLI | ||
| ``` | ||
|
|
||
| ### Readiness checks | ||
|
|
||
| **1. Gateway process alive** (`/healthz` ≠ model ready): | ||
|
|
||
| ```bash | ||
| curl --connect-timeout 5 --max-time 15 \ | ||
| -H "Authorization: Bearer $SIE_API_KEY" "$SIE_ENDPOINT/healthz" | ||
| # → ok | ||
| ``` | ||
|
|
||
| **2. Model can encode** — accept only HTTP **200**; retry **503** (warm-up); | ||
| stop on terminal failures (e.g. **502**, **401**): | ||
|
|
||
| ```bash | ||
| attempts=0 | ||
| # 60 attempts × (up to 30s request + 10s sleep) ≈ 40 minutes worst case — | ||
| # first-run model download/load can exceed a short 10-minute budget. | ||
| max_attempts=60 | ||
| while true; do | ||
| attempts=$((attempts + 1)) | ||
| code=$(curl --connect-timeout 5 --max-time 30 -s -o /dev/null -w '%{http_code}' \ | ||
| -X POST "$SIE_ENDPOINT/v1/encode/BAAI/bge-m3" \ | ||
| -H "Authorization: Bearer $SIE_API_KEY" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"items":[{"text":"readiness probe"}]}' || true) | ||
| case "$code" in | ||
| 200) echo "SIE encode ready"; break ;; | ||
| 503) echo "SIE warm-up ($attempts/$max_attempts) — waiting 10s..." ;; | ||
| 000) echo "SIE unreachable ($attempts/$max_attempts) — waiting 10s..." ;; | ||
| *) echo "SIE encode failed with HTTP $code — abort"; exit 1 ;; | ||
| esac | ||
| if [ "$attempts" -ge "$max_attempts" ]; then | ||
| echo "SIE encode not ready after $max_attempts attempts — abort" | ||
| exit 1 | ||
| fi | ||
| sleep 10 | ||
| done | ||
| ``` | ||
|
|
||
| **3. App sees SIE:** | ||
|
|
||
| ```bash | ||
| curl -s http://localhost:8001/health | ||
| # → "sie":"reachable" | ||
| ``` | ||
|
|
||
| ### First success | ||
|
|
||
| Provide an input PDF (`input_data/` is gitignored). Either copy a file to the | ||
| path expected by the example config, or point `data_paths` at an existing PDF: | ||
|
|
||
| ```bash | ||
| mkdir -p input_data/pdfs | ||
| cp /path/to/your-document.pdf \ | ||
| input_data/pdfs/The_Federal_Pell_Grant_Program.pdf | ||
| # or edit data_paths in configs/mongodb/example-sie.yaml | ||
| ``` | ||
|
|
||
| Then run one sweep (CLI installed per project QUICKSTART): | ||
|
|
||
| ```bash | ||
| rag-params-finder run --config configs/mongodb/example-sie.yaml | ||
| ``` | ||
|
|
||
| Config file: | ||
| [configs/mongodb/example-sie.yaml](https://github.com/neomatrix369/rag-params-finder/blob/main/configs/mongodb/example-sie.yaml). | ||
| On Postgres/Supabase use | ||
| [configs/supabase/example-sie.yaml](https://github.com/neomatrix369/rag-params-finder/blob/main/configs/supabase/example-sie.yaml) | ||
| instead. | ||
|
|
||
| Compare results in the dashboard at **http://localhost:5374**. | ||
|
|
||
| ## Alternate — self-hosted Docker | ||
|
|
||
| Use when you have no remote gateway. Needs Docker, disk for model weights, and | ||
| **requires** `HF_TOKEN` on the **SIE container** for Hugging Face weight | ||
| downloads during warm-up (not used for app routing). | ||
|
|
||
| Typical host endpoint: | ||
|
|
||
| ```bash | ||
| SIE_ENABLED=true | ||
| SIE_ENDPOINT=http://localhost:8720 | ||
| # SIE_API_KEY usually unset for local unauthenticated server | ||
| ``` | ||
|
|
||
| Full `docker run` flags, warm-up (wait for encode **200**, not only `/healthz`), | ||
| Apple Silicon notes, and Aim UI: | ||
| [Self-hosted Docker in sie-setup.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md). | ||
|
|
||
| When the server runs in Docker and SIE on the host, use | ||
| `http://host.docker.internal:8720` as `SIE_ENDPOINT`. | ||
|
|
||
| ## Env vars (same for remote and local) | ||
|
|
||
| | Variable | Role | | ||
| |---|---| | ||
| | `SIE_ENABLED` | Master on/off (default `false`) | | ||
| | `SIE_ENDPOINT` | HTTP base URL of the SIE gateway or local server | | ||
| | `SIE_API_KEY` | Bearer token when the gateway requires auth | | ||
|
|
||
| Details and smoke tests (including `POST /api/v1/sweep`): | ||
| [sie-setup.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md). | ||
|
|
||
| ## Next | ||
|
|
||
| Understand models and primitives: [What SIE does here](./what-sie-does.md). | ||
| Stuck? [Troubleshooting](./troubleshooting.md). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Troubleshooting (SIE-focused) | ||
|
|
||
| Short FAQ for gallery readers. Full tables and recovery steps: | ||
| [project troubleshooting](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/troubleshooting.md) | ||
| (especially the SIE section) and | ||
| [sie-setup.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md). | ||
|
|
||
| ## `"sie": "disabled"` on `/health` | ||
|
|
||
| `SIE_ENABLED` is false or unset (default). Set `SIE_ENABLED=true`, set | ||
| `SIE_ENDPOINT`, reload the server. | ||
|
|
||
| ## `"sie": "unreachable"` (or preflight fails) | ||
|
|
||
| - Wrong `SIE_ENDPOINT` (typo, http vs https, missing port) | ||
| - Gateway auth: set `SIE_API_KEY` and use `Authorization: Bearer …` on `/healthz` | ||
| - Local Docker: SIE not running, still warming up, or server-in-Docker needs | ||
| `http://host.docker.internal:8720` | ||
| - Encode still returning **503** during model load — wait until encode returns **200** | ||
|
|
||
| ## Sweep with `provider: sie` fails immediately | ||
|
|
||
| SIE guard runs preflight. Fix health/`SIE_ENABLED` first, then re-run. Index | ||
| requirements come from the **selected config**, not from `provider: sie` alone. | ||
| For [`configs/mongodb/example-sie.yaml`](https://github.com/neomatrix369/rag-params-finder/blob/main/configs/mongodb/example-sie.yaml) | ||
| (dense BGE-M3 / Stella-v5), create both indexes on the `chunks` collection: | ||
| `vector_index_1024` for dense 1024-dim embeddings, and `text_search_index` for | ||
| the separately swept sparse/hybrid retrievers — see project MongoDB setup. | ||
| Sparse-only models can need different indexes; do not treat `vector_index_1024` | ||
| as universal. | ||
|
|
||
| ## `./start-services.sh` did not bring up SIE | ||
|
|
||
| Expected. Start a remote gateway or follow self-hosted Docker in | ||
| [sie-setup.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md). | ||
|
|
||
| ## Dashboard up but no SIE experiments | ||
|
|
||
| Use a SIE config such as | ||
| [`configs/mongodb/example-sie.yaml`](https://github.com/neomatrix369/rag-params-finder/blob/main/configs/mongodb/example-sie.yaml), | ||
| not a Voyage-only or local-only example. | ||
|
|
||
| ## Still stuck? | ||
|
|
||
| 1. [sie-setup.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/sie-setup.md) — known issues, warm-up, Aim UI | ||
| 2. [troubleshooting.md](https://github.com/neomatrix369/rag-params-finder/blob/main/docs/user-guide/troubleshooting.md) — indexes, Docker, storage | ||
| 3. Open an issue on | ||
| [neomatrix369/rag-params-finder](https://github.com/neomatrix369/rag-params-finder/issues) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.