# Vector search

> search_<table>(query, k) for each table in vectorSearch: the k nearest rows the caller can read, with pgvector iterative index scans so RLS filters still return k rows.

- Category: AI
- Module: `vector-search`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/vector-search
- Page: https://bettersupabase.com/blocks/vector-search

## Install

```bash
npx better-supabase add vector-search
```

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Modes: "managed". The default is "managed".
    "vector-search": { mode: "managed" },
  },
});
```

## Client

The block is SQL only: call its functions from your policies, RPCs and the other modules.
