I'm not sure exactly how it's formatted (and may differ between GPT/LLAMA/others), but when an LLM "remembers" your chat history, it's actually getting all of the previous prompts and its responses as its input prepended to your next prompt.<p>Something like:<p><pre><code> System: You are a helpful assistant.
User: What is the country with the largest population?
Assistant: India.
User: Ok, what is the next largest?
Assistant: China.
User: How about the next largest?
Assistant: United States.
User: And the next?
Assistant:
</code></pre>
and the model outputs<p><pre><code> Indonesia.
</code></pre>
But you can't just put your history in a single prompt because it would be formatted differently. If you're using a model like ChatGPT, there may be a way to copy the conversation. Otherwise, you can definitely edit the conversation (including AI responses) in the API. See <a href="https://platform.openai.com/playground" rel="nofollow noreferrer">https://platform.openai.com/playground</a> for easy access, there's probably a command-line tool or alternative frontend which you can give your API key to make it easier.
The LLM has no memory. What you actually feed it is the entire conversation (truncated up to its input limit) every time you respond.<p>But you are bound to the interface, especially if you are not running a local LLM like Llama.<p>Different models have different prompting syntax.