added support for AgentId and InternalId in Evaluated queries