Skip to content

Support LIKE/contains filtering for string attributes #31

@dfalbel

Description

@dfalbel

Summary

The attribute filter layer currently supports eq, ne, gt, gte, lt, lte, in, and nin operators. There's no way to do substring/pattern matching on string attributes.

Motivation

When attributes store comma-separated values (e.g. labels = "bug, enhancement"), exact equality filters like labels = 'bug' won't match. A LIKE operator would allow patterns like labels LIKE '%bug%' to find partial matches.

This came up in the GitHub issues RAG example, where issue labels are stored as a comma-separated string and users want to filter by a single label.

Backend support

  • DuckDB: Native LIKE support
  • ChromaDB: Has $contains operator (equivalent)
  • OpenAI: Unsupported (raise an error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions