Slice · AI prompt
Framework-neutral semantic-search adapter contract. The host injects VectorSearchCtx for query/index/reindex and owns the actual vector backend, embeddings, credentials, persistence, authorization, and reindex policy; RR ships no renderer or Convex schema for this slice.
# Install `vector-search` — Vector Search — Adapter Contract
> Framework-neutral semantic-search adapter contract.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/vector-search
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=vector-search
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/vector-search
## 1. Install
```bash
npx rahman-resources add vector-search
# alias: npx rr add vector-search
```
The CLI copies `frontend/slices/vector-search/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 3. Wire it up
Run `npx rr add vector-search` (React/default) or `npx rr add vector-search --framework sveltekit`. Bind VectorSearchCtx.search/index/reindex to your own authorized vector backend. The slice intentionally does not invent a Convex schema, embedding provider, renderer, or credential requirement.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.