Computed fields
Use the dependencies option instead of inline queries
A common pattern in legacy agents was to make database queries inside the get function. In the new agent, the dependencies option lets you declare which related fields you need, and the agent will fetch them automatically via JOIN, which is much faster.
Slow (inline query)
Fast (dependencies)
Best (import field)
Move async calls outside the hot loop
The new agent works in batch mode. If you have external service calls (APIs, etc.), fetch all records in a single request rather than one per record:
Slow (per-record)
Fast (batch)
Avoid duplicate queries across computed fields
If multiple computed fields depend on the same external data source, have one field fetch the data and let others depend on it:
Segments
Use condition trees when possible
If your segment logic maps to a Forest condition tree, use it instead of running a raw query and filtering by IDs. The agent can push the condition tree down to the database as a native query, which is much faster.
Filtering emulation
emulateFieldFiltering and emulateFieldSorting force the agent to retrieve all records to compute values. Use them only for collections with a low number of records (a few thousand at most). Prefer replaceFieldOperator for large collections.