# knowledge/additions/ — self-serve knowledge base updates

Drop new approved answers here. **No code changes needed.** Anyone with repo access can add
knowledge, and Claude Code (following `CLAUDE.md` at the repo root) turns it into a live KB update.

## Two ways to add knowledge

**A. You already have clean Q&A** — add entries to a `.json` file in this folder (any filename,
e.g. `2026-08-refunds.json`). See `example.json.template` for the shape. Format is a list of entries:

```json
[
  {
    "question": "Can I use QuitSure if I have a heart condition?",
    "answer": "Yes. QuitSure is safe to use... (the full approved answer, verbatim).",
    "programs": ["all"],
    "topic": "Eligibility"
  }
]
```

- `question` and `answer` are required. `answer` is sent to users **verbatim**, so it must be
  final, approved wording.
- `programs` is optional (defaults to `["all"]`). Use `["P3"]` for Original-only, `["P9"]` for
  Relaxed-only, `["all"]` if it applies to everyone.
- `topic` is optional (a short label).

**B. You have raw material** (a doc, notes, a paragraph, a screenshot of a coach answer) — drop the
file in this folder and tell Claude "update the knowledge base from the file I added." Claude will
read it, turn it into approved Q&A entries in a `.json` here, run the build, and validate it.

## What happens next (Claude does this automatically)
1. `python3 scripts/build_kb.py` — folds your entries into `data/kb.json`
2. `python3 scripts/build_index.py` — rebuilds the embeddings (`data/index.npz`)
3. `python3 eval/run_eval.py` — safety + regression check; must pass
4. Commits `data/kb.json` + `data/index.npz` (+ your file) to `development`
5. BE pulls `development` and restarts the service, and it's live

## Rules
- Only add **approved** content. The bot answers strictly from this KB, so a wrong answer here
  becomes a wrong answer to a real user.
- Do not put coach-only instructions ("send this only after...", placeholders like `%name%`) here.
- Entries added here are appended after existing ones, so existing entry IDs stay stable.
