Filter based on id, not on metadata

After we make a query, we want to avoid showing the same results in the next query response, so we want to filter the results based on the previously fetched ids.

Is there a way to filter based on id rather than the metadata?

We can put the id in the metadata, but it will be maximum cardinality so probably high cost