When would be the right time to engage a literary agent?
While a writer may engage a literary agent, the timing is almost entirely not up to the writer. Let me illustrate with another question:
When do you turn on the stove to cook a turkey? It depends on several factors: when you intend to serve the holiday feast, how large the bird is, what kind of oven you have. All those are factors you have control over and will lead to the correct answer.
When to engage a literary agent is like asking when to turn on the stove before you've bought the stove, or the bird, or invited the guests. In other words, it's a question that requires much more groundwork before it can be answered.
It's like asking how full you can load the cart before you've hired the horse. Or tamed the horse. Or bought the farm.
And as you can see, it's not always bippiteyboppityboo, here have a horse.
I think what you really mean is "when is the correct time to start querying" and the answer to that is NO SOONER than before you have revised your novel several times.