In fact, ChatGPT only consists of a single model that does both the retrieval and generation. It manages that by "storing" or learning all the knowledge it is exposed to and then generating responses on the fly.