# SDLC 05 — Deployment

## File-based learning (current)

1. Run `node learning/scripts/build-vectors.mjs` on deploy or after content changes  
2. Ensure `learning/data/vectors/` is writable (or bake vectors into release)  
3. Point future Next.js RAG loader at this path or copy into `data/rag/`

## Optional DB

1. Apply `learning/sql/009_rag_chunks.sql` to MariaDB  
2. Add sync script file → DB (Phase 2)  
3. Set `RAG_STORE=mysql` in env  

## Env

```
RAG_EMBEDDING_MODE=local          # or openai
OPENAI_API_KEY=                   # only if openai mode
RAG_TOP_K=5
```

Deploy notes: [docs/DEPLOY-CENTOS-APACHE.md](../../docs/DEPLOY-CENTOS-APACHE.md)
