Skip to content

Commit 57a2c26

Browse files
docs(examples): address CodeRabbit review on rag-params-finder guide
Export MONGODB_URI before the SIE handoff, recreate Compose for env reload, require encode readiness before sweeps, and document the gitignored input PDF prerequisite for example-sie.yaml. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4cb9cb8 commit 57a2c26

2 files changed

Lines changed: 61 additions & 6 deletions

File tree

examples/rag-params-finder/getting-started.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,12 @@ Step-by-step install and first experiment:
4949

5050
## Next
5151

52-
Wire SIE and run one sweep: [SIE integration](./sie-integration.md).
52+
Before the host CLI / SIE handoff, export the URI the startup script printed
53+
(leave `.env` placeholders unchanged for Atlas Local):
54+
55+
```bash
56+
# value also printed by ./start-services.sh --mongodb-local
57+
export MONGODB_URI="mongodb://localhost:27017/rag_params_finder?directConnection=true"
58+
```
59+
60+
Then wire SIE and run one sweep: [SIE integration](./sie-integration.md).

examples/rag-params-finder/sie-integration.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ dashboard only — they never start SIE.
88

99
## Happy path — remote gateway (recommended)
1010

11-
Finish [Getting started](./getting-started.md) first so `:8001` is up.
11+
Finish [Getting started](./getting-started.md) first so `:8001` is up and
12+
`MONGODB_URI` is exported for the host CLI.
1213

1314
In the project `.env`:
1415

@@ -18,20 +19,66 @@ SIE_ENDPOINT=https://your-sie-gateway.example.com
1819
SIE_API_KEY=your_gateway_token
1920
```
2021

21-
Restart or reload the rag-params-finder server after changing `.env`.
22+
Reload the server so it picks up the new env (a plain restart is not enough for
23+
Compose — env is baked in at container create time):
2224

23-
Check the gateway, then the app health:
25+
```bash
26+
# Compose (typical after ./start-services.sh)
27+
docker compose up -d --force-recreate server
28+
29+
# Host-run server instead: reload or restart uvicorn
30+
```
31+
32+
Source `.env` into the **current shell** before gateway curls (editing the file
33+
does not update existing variables):
34+
35+
```bash
36+
set -a && source .env && set +a
37+
```
38+
39+
### Readiness checks
40+
41+
**1. Gateway process alive** (`/healthz` ≠ model ready):
2442

2543
```bash
2644
curl -H "Authorization: Bearer $SIE_API_KEY" "$SIE_ENDPOINT/healthz"
45+
# → ok
46+
```
47+
48+
**2. Model can encode** — wait for HTTP **200** (503 during warm-up is expected):
49+
50+
```bash
51+
until curl -sf -o /dev/null -X POST "$SIE_ENDPOINT/v1/encode/BAAI/bge-m3" \
52+
-H "Authorization: Bearer $SIE_API_KEY" \
53+
-H "Content-Type: application/json" \
54+
-d '{"items":[{"text":"readiness probe"}]}'; do
55+
echo "SIE encode not ready yet — waiting 10s..."
56+
sleep 10
57+
done
58+
```
59+
60+
**3. App sees SIE:**
61+
62+
```bash
2763
curl -s http://localhost:8001/health
2864
# → "sie":"reachable"
2965
```
3066

31-
**First success:** `"sie":"reachable"`, then one sweep:
67+
### First success
68+
69+
Provide an input PDF (`input_data/` is gitignored). Either copy a file to the
70+
path expected by the example config, or point `data_paths` at an existing PDF:
71+
72+
```bash
73+
mkdir -p input_data/pdfs
74+
cp /path/to/your-document.pdf \
75+
input_data/pdfs/The_Federal_Pell_Grant_Program.pdf
76+
# or edit data_paths in configs/mongodb/example-sie.yaml
77+
```
78+
79+
Then run one sweep (CLI installed per project QUICKSTART):
3280

3381
```bash
34-
# from the rag-params-finder repo root, with CLI installed (see project QUICKSTART)
3582
rag-params-finder run --config configs/mongodb/example-sie.yaml
3683
```
3784

0 commit comments

Comments
 (0)