Filtering and searching records

Use exact filters, semantic search, or both to find Records and provide context to Flows and Agents.

Filter records

Use exact or partial matches on metadata fields and top-level record fields.

In the dashboard

In the dashboard, follow these steps:

  1. Go to Records.
  2. Select a Record type.
  3. Use the filter builder to add metadata conditions and select an operator.

Filter syntax in Flows

Use a record filter with List Records to return multiple matches. Use Get Record to return the most recently updated matching Record. The filter requires a type field and can include a where clause with conditions or groups:

1{
2 "type": "customers",
3 "where": {
4 "op": "and",
5 "conditions": [
6 { "field": "tier", "op": "eq", "value": "premium" },
7 { "field": "orderCount", "op": "gt", "value": 10 }
8 ]
9 }
10}

The where clause supports these operators:

  • eq, neq: test equality.
  • gt, gte, lt, lte: compare numeric values.
  • contains, startsWith, endsWith: match strings.
  • in, notIn: match values in or outside a set.
  • isSet, isNotSet: check whether a field exists.
  • isTrue, isFalse: match Boolean values.
  • between: match a numeric range.
  • withinLastDays, olderThanDays: match values relative to the current date.

Use "op": "and" or "op": "or" in a group to combine conditions.

Null and missing values

Value operators such as eq, gt, and contains do not match Records where the field is missing or set to JSON null. The neq and notIn operators also match those Records, which matches SQL null behavior. For example, a neq filter on a field that most Records do not have also returns those Records.

To filter only by field existence, use isSet or isNotSet.

The date-relative filters withinLastDays and olderThanDays match ISO 8601 date and date-time strings. For example, 2026-01-15T00:00:00.000Z is a valid value. These filters also support the top-level timestamp fields createdAt and updatedAt. Comparison and range operators match JSON numbers and numeric strings such as 42 or 3.14. The filter does not match values in other formats.

Use natural-language queries to find Records by meaning.

How it works

Runtype converts your query into a vector embedding and finds Records with similar embeddings. The search uses conceptual similarity instead of exact keyword matching.

Example queries

Use queries such as these for semantic search:

  • "How do I reset my password?" finds password reset documentation.
  • "Affordable laptops for students" finds budget laptop records.
  • "Shipping delays" finds policies and updates about shipping.

In Flows

Set the Query field in a Vector Search step to a template such as:

{{userQuestion}}

The template reads the userQuestion flow variable. The step returns Records ranked by similarity score.

Embed text-heavy fields such as descriptions, content, and article bodies for semantic search. Use exact filters for structured values such as IDs and numbers.

The Vector Search step accepts a semantic query and optional metadata filters. For the built-in Record store, set recordType to scope results. Weaviate applies metadataFilters as equality constraints. The built-in Record store and Cloudflare Vectorize do not use metadataFilters to filter results.

Combine these settings to search within a Record type:

  1. Query: "Technical issues with Widget Pro".
  2. Record type: support.

This combination finds semantically relevant support articles in the support Record type.

Result ranking

Search results use these ranking rules:

  • Filter search: returns all matching Records without relevance ranking.
  • Semantic search: uses the similarity score, with the most similar Records first.

Set the limit field to cap the number of semantic search results. For example:

1{
2 "limit": 5
3}

Record type filtering

To search within a specific Record type in the built-in Record store, set recordType in a Vector Search step:

1{
2 "recordType": "documentation",
3 "query": "API authentication"
4}

Omit recordType to search across all Record types in the built-in Record store. A broader search can take longer.

Field selection

Choose the data that each search uses:

  • Embedded fields: configure the Generate Embedding step with the text to embed for semantic search.
  • Filterable fields: use metadata fields in record filters for exact matching.

Performance considerations

Use these options to narrow searches and limit the number of returned Records:

  • Set recordType when your vector store supports type filtering.
  • Add metadataFilters when the selected vector store supports them.
  • Set limit to cap the number of semantic search results.

Search examples

Customer lookup

Use a record filter to find a customer by email:

1{
2 "type": "customers",
3 "where": {
4 "op": "and",
5 "conditions": [{ "field": "email", "op": "eq", "value": "dana@example.com" }]
6 }
7}

High-value customers

Use a record filter to find customers with a high lifetime value:

1{
2 "type": "customers",
3 "where": {
4 "op": "and",
5 "conditions": [
6 { "field": "lifetime_value", "op": "gt", "value": 10000 },
7 { "field": "tier", "op": "eq", "value": "premium" }
8 ]
9 }
10}

Use a Vector Search step to search a knowledge base:

1{
2 "recordType": "docs",
3 "query": "{{userQuestion}}",
4 "limit": 3
5}

The userQuestion flow variable supplies the query text.

Product recommendations

Combine a Vector Search step with a Record type filter:

1{
2 "recordType": "products",
3 "query": "{{userPreferences}}",
4 "limit": 5
5}

The userPreferences flow variable supplies the query text.

Next steps

Continue with these guides: