> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/filter.md).

# Typesafe Filter

Filter a bounded list using item-by-item Jev scores and an explicit threshold.

## Jev Filter

### What it is

Filter items with sequential Jev scores, one call per item. Each call receives JSON context and item and emits its own transparency outputs. Levels define the scale: describe concrete evidence for each tier so a very good case does not reach the top. For hiring, distinguish terrible, bad, okay, excellent, brilliant, and one-in-a-thousand by what qualifies.

### How it works

The block scores items sequentially, making one API call per item with an item-first state containing `item` and `context`. Ordered `levels` define the scale, and a returned score at or above `min_score` places the original item in `passed`; lower scores place it in `rejected`. The final `scores` list stays aligned with the input order. Each attempted item emits its zero-based `item_index` followed by its transparency outputs.

`max_items` defaults to 100 and accepts 1–1,000; larger input lists are rejected before any call. The threshold must fit the configured scale, and level descriptions should define concrete evidence for each tier. Empty input yields three empty lists without calling the API. A failed item stops processing and retains prior transcripts without emitting partial result lists.

### Inputs

| Input      | Description                                                                                                                                                                                                                                                         | Type       | Required |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------- |
| state      | Text or JSON context shared by every question in this stateless call. JSON is compactly serialized; oversized context is truncated with a note.                                                                                                                     | State      | No       |
| items      | Items to score, one sequential API call per item; oversized lists are rejected.                                                                                                                                                                                     | List\[Any] | Yes      |
| question   | Plain-language question to score for each item, using state as context.                                                                                                                                                                                             | str        | Yes      |
| levels     | Ordered level descriptions, lowest first. Levels define the scale: describe concrete evidence for each tier so a very good case does not reach the top. For hiring, distinguish terrible, bad, okay, excellent, brilliant, and one-in-a-thousand by what qualifies. | List\[str] | Yes      |
| min\_score | Keep items with returned score at or above this value.                                                                                                                                                                                                              | float      | Yes      |
| max\_items | Maximum number of items allowed in this execution.                                                                                                                                                                                                                  | int        | No       |

### Outputs

| Output           | Description                                                                                                                                    | Type         |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| error            | API failure details; emitted only when a call fails.                                                                                           | str          |
| request          | Verbatim JSON request body sent to Jev.                                                                                                        | str          |
| response         | Verbatim UTF-8 response body from Jev, or null if no response arrived. Invalid UTF-8 is preserved as a lossless Base64 data URL with an error. | str          |
| latency\_ms      | Wall-clock API call duration in ms.                                                                                                            | float        |
| input\_tokens    | Input tokens reported by the API, or null if unavailable on failure.                                                                           | int          |
| output\_tokens   | Output tokens reported by the API, or null if unavailable on failure.                                                                          | int          |
| request\_id      | TypeSafe request ID response header.                                                                                                           | str          |
| truncated        | Whether any input text was truncated.                                                                                                          | bool         |
| truncation\_note | Truncation details, or an empty string.                                                                                                        | str          |
| item\_index      | Zero-based item index emitted before that item's transparency outputs.                                                                         | int          |
| passed           | Items meeting min\_score, in original order.                                                                                                   | List\[Any]   |
| rejected         | Items below min\_score, in original order.                                                                                                     | List\[Any]   |
| scores           | Returned scores aligned with the complete input items list.                                                                                    | List\[float] |

### Possible use case

**Evidence Screening**: Keep extracted passages that meet a defined relevance threshold for a research question.

**Ticket Prioritization**: Separate reports that meet a concrete impact rubric from lower-impact reports.

**Catalog Review**: Select product records with sufficiently complete specifications for a downstream workflow.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://agpt.co/docs/integrations/block-integrations/filter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
