Opik Query Language (OQL)
Opik Query Language (OQL)
Opik Query Language (OQL)
OQL provides a powerful, SQL-like syntax for filtering data in Opik. It’s used with various SDK methods like searchPrompts(), searchTraces(), and searchThreads() to find exactly the data you need using expressive filter conditions.
Used for fields with a fixed set of values, such as environment:
Use AND to combine multiple filter conditions. All conditions must be true for a result to match:
Currently, only AND logic is supported. OR logic is not available in OQL.
The same OQL syntax works across all search methods (searchPrompts(), searchTraces(), searchThreads()).
Specific resource types may support additional fields - see their respective documentation for available columns.
Always wrap string values in double quotes:
"production", "staging", "team-alpha" for effective filtering"prod-" prefix) to enable powerful filtering