> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Chatbotkit local sync: searchable entities, `.search()` filters, and operators.

The Chatbotkit plugin syncs data locally. Use `corsair.chatbotkit.db.<entity>.search({ data, limit?, offset? })` with the filters listed per entity.

<Info>
  **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy).
</Info>

## Blueprints

Path: `chatbotkit.db.blueprints.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.blueprints.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `string` | equals, contains, startsWith, endsWith, in |
| `alias`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `visibility`  | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `updatedAt`   | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Bots

Path: `chatbotkit.db.bots.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.bots.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type      | Operators                                  |
| ------------- | --------- | ------------------------------------------ |
| `entity_id`   | `string`  | equals, contains, startsWith, endsWith, in |
| `id`          | `string`  | equals, contains, startsWith, endsWith, in |
| `alias`       | `string`  | equals, contains, startsWith, endsWith, in |
| `name`        | `string`  | equals, contains, startsWith, endsWith, in |
| `description` | `string`  | equals, contains, startsWith, endsWith, in |
| `blueprintId` | `string`  | equals, contains, startsWith, endsWith, in |
| `datasetId`   | `string`  | equals, contains, startsWith, endsWith, in |
| `skillsetId`  | `string`  | equals, contains, startsWith, endsWith, in |
| `backstory`   | `string`  | equals, contains, startsWith, endsWith, in |
| `model`       | `string`  | equals, contains, startsWith, endsWith, in |
| `privacy`     | `boolean` | equals                                     |
| `moderation`  | `boolean` | equals                                     |
| `visibility`  | `string`  | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`    | equals, before, after, between             |
| `updatedAt`   | `date`    | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Conversations

Path: `chatbotkit.db.conversations.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.conversations.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `string` | equals, contains, startsWith, endsWith, in |
| `alias`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `botId`       | `string` | equals, contains, startsWith, endsWith, in |
| `backstory`   | `string` | equals, contains, startsWith, endsWith, in |
| `model`       | `string` | equals, contains, startsWith, endsWith, in |
| `datasetId`   | `string` | equals, contains, startsWith, endsWith, in |
| `skillsetId`  | `string` | equals, contains, startsWith, endsWith, in |
| `blueprintId` | `string` | equals, contains, startsWith, endsWith, in |
| `visibility`  | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `updatedAt`   | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Datasets

Path: `chatbotkit.db.datasets.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.datasets.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field                 | Type     | Operators                                  |
| --------------------- | -------- | ------------------------------------------ |
| `entity_id`           | `string` | equals, contains, startsWith, endsWith, in |
| `id`                  | `string` | equals, contains, startsWith, endsWith, in |
| `alias`               | `string` | equals, contains, startsWith, endsWith, in |
| `name`                | `string` | equals, contains, startsWith, endsWith, in |
| `description`         | `string` | equals, contains, startsWith, endsWith, in |
| `blueprintId`         | `string` | equals, contains, startsWith, endsWith, in |
| `reranker`            | `string` | equals, contains, startsWith, endsWith, in |
| `recordMaxTokens`     | `number` | equals, gt, gte, lt, lte, in               |
| `searchMinScore`      | `number` | equals, gt, gte, lt, lte, in               |
| `searchMaxRecords`    | `number` | equals, gt, gte, lt, lte, in               |
| `searchMaxTokens`     | `number` | equals, gt, gte, lt, lte, in               |
| `matchInstruction`    | `string` | equals, contains, startsWith, endsWith, in |
| `mismatchInstruction` | `string` | equals, contains, startsWith, endsWith, in |
| `visibility`          | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`           | `date`   | equals, before, after, between             |
| `updatedAt`           | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Files

Path: `chatbotkit.db.files.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.files.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `string` | equals, contains, startsWith, endsWith, in |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `mimeType`    | `string` | equals, contains, startsWith, endsWith, in |
| `size`        | `number` | equals, gt, gte, lt, lte, in               |
| `visibility`  | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `updatedAt`   | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Secrets

Path: `chatbotkit.db.secrets.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.secrets.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `string` | equals, contains, startsWith, endsWith, in |
| `alias`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `blueprintId` | `string` | equals, contains, startsWith, endsWith, in |
| `kind`        | `string` | equals, contains, startsWith, endsWith, in |
| `type`        | `string` | equals, contains, startsWith, endsWith, in |
| `visibility`  | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `updatedAt`   | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Skillsets

Path: `chatbotkit.db.skillsets.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.skillsets.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `string` | equals, contains, startsWith, endsWith, in |
| `alias`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `blueprintId` | `string` | equals, contains, startsWith, endsWith, in |
| `visibility`  | `string` | equals, contains, startsWith, endsWith, in |
| `state`       | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `updatedAt`   | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Tasks

Path: `chatbotkit.db.tasks.search`

```ts theme={null}
const rows = await corsair.chatbotkit.db.tasks.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `string` | equals, contains, startsWith, endsWith, in |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `botId`       | `string` | equals, contains, startsWith, endsWith, in |
| `schedule`    | `string` | equals, contains, startsWith, endsWith, in |
| `status`      | `string` | equals, contains, startsWith, endsWith, in |
| `visibility`  | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `updatedAt`   | `date`   | equals, before, after, between             |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***
