𝗧𝗵𝗲 𝗠𝗼𝗱𝗲𝗹 𝗗𝗼𝗲𝘀𝗻'𝘁 𝗥𝗲𝗺𝗲𝗺𝗯𝗲𝗿. 𝗬𝗼𝘂 𝗗𝗼.

LLMs do not have memory.

I used to think every chat stored its own context. I thought the model remembered our previous words automatically. I was wrong.

The Messages API is stateless. The model only knows what you send in the current request. If you want a conversation, you must send the entire history back to the model every single time.

Your memory is just an array of messages.

When you build a chat, you manage this array. It looks like this:

• User: Hello, Claude • Assistant: Hello! How can I help? • User: Can you describe LLMs?

Every time you ask a new question, you append the new message to that list and send the whole list to the API.

I learned this by avoiding SDKs. Most developers use tools like the Anthropic SDK. These tools hide the complexity. They handle retries and headers for you.

I chose to use raw fetch instead. This forced me to manage headers and the request body manually. It removed the abstraction. I saw exactly how the data moves.

This concept is the foundation for everything else. If you want to build advanced systems, you must understand this array. Strategies like RAG or sliding windows all start with how you manage this message list.

Once you master the history, you can move to tool use. This allows the model to execute tasks and choose the right functions to run.

Control your context. Control your model.

Source: https://dev.to/marcochavezco/the-model-doesnt-remember-you-do-3mmk

Optional learning community: https://t.me/GyaanSetuAi