> ## 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

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

The AgentQL plugin syncs data locally. Use `corsair.agentql.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>

## Account Usage

Path: `agentql.db.accountUsage.search`

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

### Searchable filters

| Field       | Type     | Operators                                  |
| ----------- | -------- | ------------------------------------------ |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `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).*

***

## Browser Sessions

Path: `agentql.db.browserSessions.search`

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

### Searchable filters

| Field                      | Type      | Operators                                  |
| -------------------------- | --------- | ------------------------------------------ |
| `entity_id`                | `string`  | equals, contains, startsWith, endsWith, in |
| `sessionId`                | `string`  | equals, contains, startsWith, endsWith, in |
| `cdpUrl`                   | `string`  | equals, contains, startsWith, endsWith, in |
| `baseUrl`                  | `string`  | equals, contains, startsWith, endsWith, in |
| `browserUaPreset`          | `string`  | equals, contains, startsWith, endsWith, in |
| `browserProfile`           | `string`  | equals, contains, startsWith, endsWith, in |
| `inactivityTimeoutSeconds` | `number`  | equals, gt, gte, lt, lte, in               |
| `shutdownMode`             | `string`  | equals, contains, startsWith, endsWith, in |
| `subUserId`                | `string`  | equals, contains, startsWith, endsWith, in |
| `branding`                 | `boolean` | equals                                     |
| `browserStartupUrl`        | `string`  | equals, contains, startsWith, endsWith, in |
| `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).*

***

## Document Query Results

Path: `agentql.db.documentQueryResults.search`

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

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `fileName`       | `string` | equals, contains, startsWith, endsWith, in |
| `query`          | `string` | equals, contains, startsWith, endsWith, in |
| `prompt`         | `string` | equals, contains, startsWith, endsWith, in |
| `generatedQuery` | `string` | equals, contains, startsWith, endsWith, in |
| `requestId`      | `string` | equals, contains, startsWith, endsWith, in |
| `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).*

***

## Query Results

Path: `agentql.db.queryResults.search`

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

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `query`          | `string` | equals, contains, startsWith, endsWith, in |
| `prompt`         | `string` | equals, contains, startsWith, endsWith, in |
| `url`            | `string` | equals, contains, startsWith, endsWith, in |
| `generatedQuery` | `string` | equals, contains, startsWith, endsWith, in |
| `requestId`      | `string` | equals, contains, startsWith, endsWith, in |
| `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).*

***
