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

# State query

> Read structured Instance records.

Exact filters on structured records (not semantic Memory search). Requires a collection name — use [State collections](/graph/tools/state-collections) to discover names. Agents may also pass `where` on JSON data paths (AND).

<h2 id="input">
  Input
</h2>

Inspector **Settings**. Empty-field rules for the Graph: [Previous nodes](/graph/previous-nodes). This inspector has no **Insert value**.

On an Agent Tool, these can be **Agent decides** or **Fixed**.

| Field          | Required | Empty         | Notes                                              |
| -------------- | -------- | ------------- | -------------------------------------------------- |
| **Collection** | Yes      | Fail          |                                                    |
| **Key**        | No       | —             | Exact key. Empty returns a page of the collection. |
| **Limit**      | No       | Default: `20` | Max 100.                                           |

<h2 id="output">
  Output
</h2>

On the next node, **Previous nodes** lists **`State query`: Result** (`{{State query.text}}` while the name is unique).

| Output | In menu | Type      | Next node gets                                                                                                                                  |
| ------ | ------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Result | Yes     | JSON text | `{ "items": [ { collection, key, data, createdAt, updatedAt } ], "nextCursor": null }`. No matches: `No matching records in collection "name".` |
