---
title: "Discussion on \"Day 02: An LLM is a stateless function. Everything else is you\" | Hashnode"
description: "Discussion on \"Day 02: An LLM is a stateless function. Everything else is you\". I pointed the forty-line version of cartographer at a second file and asked the obvious follow-up: how does this one relate to the last one?\nIt asked me which file I meant.\nMy first instinct was that"
url: "https://hashnode.com/posts/llm-is-a-stateless-function/6acb943d0eef59e46a0800ba"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Day 02: An LLM is a stateless function. Everything else is you](https://harshakatkam.dev/llm-is-a-stateless-function?utm_source=hashnode&utm_medium=feed)

I pointed the forty-line version of cartographer at a second file and asked the obvious follow-up: how does this one relate to the last one? It asked me which file I meant. My first instinct was that

Oct 11 · 8 min read · harshakatkam.dev  
Read the article

-   [#ai-agent](https://hashnode.com/tag/ai-agent)
-   [#llm](https://hashnode.com/tag/llm)
-   [#ai](https://hashnode.com/tag/ai)
-   [#agentic-ai](https://hashnode.com/tag/agentic-ai)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Harshavardhan Katkam](https://hashnode.com/@harshakatkam)

@harshakatkam · Hyderabad, India

  
[View profile](https://hashnode.com/@harshakatkam)

Senior Backend Engineer | Java | Distributed Systems | GenAI & AI Agents

## Responses 4

Markdown supported · ⌘↵ to post

[BotSailor](https://hashnode.com/@botsailor)

[Oct 13](https://hashnode.com/posts/llm-is-a-stateless-function/6acb943d0eef59e46a0800ba/comment/6ace153d9f73162984842dbd)

Really enjoyed this perspective. The idea that an LLM is a stateless function changes the way we think about building AI systems. A lot of people focus on the model itself, but the real engineering challenge is around managing context, memory, and orchestration effectively.  
The point that “memory” is something we build around the model rather than something the model naturally owns is especially important for designing reliable agents. Great reminder that good AI products are not just about choosing a powerful model they are about building the right architecture around it.  
Looking forward to seeing more practical examples from this series.

[Vlad Zoff](https://hashnode.com/@vladzoff)

[Oct 12](https://hashnode.com/posts/llm-is-a-stateless-function/6acb943d0eef59e46a0800ba/comment/6accc03222410b0dd16260a5)

The transcript-as-state framing is useful. I'd add one failure case to the role-sequence test: a timeout after the request was sent but before the assistant reply was persisted. Without an explicit pending or failed state, retrying can duplicate the user turn or leave a successful response missing from local history. Persisting the request/response boundary makes replay useful for recovery as well as debugging.

[netproxy](https://hashnode.com/@argumentmoney8117)

[Oct 11](https://hashnode.com/posts/llm-is-a-stateless-function/6acb943d0eef59e46a0800ba/comment/6acc0b9ca400bf68f0dddb15)

The transcript dump has a use beyond debugging that is easy to miss: since the model is a pure function of that array, the JSON on disk is a deterministic input log. You can replay it byte-for-byte against a new model version or a tweaked system prompt and diff the outputs, which turns any run into a regression test for prompt edits. Another way of saying that the array being the whole state is a feature, not a limitation.

[Salman Parvez | ML Systems](https://hashnode.com/@ml-systems)

[Oct 11](https://hashnode.com/posts/llm-is-a-stateless-function/6acb943d0eef59e46a0800ba/comment/6acba34ab256b1550893f517)

"Somebody deciding what goes into an array before a POST" is the clearest way I've seen this put. Once I saw it that way, I stopped worrying about which model to use and started caring a lot more about what I put in front of it.
