REGENT: A Retrieval-Augmented Generalist Agent That Can Act In-Context in New Environments