{"slug": "aie-1-0-introduction-to-ai-engineering", "title": "aie_1.0: introduction to ai engineering", "summary": "A developer published an introductory guide to AI engineering explaining that traditional deterministic software fails on tasks like detecting customer frustration, while large language models work as prediction machines trained on examples rather than explicit rules. The guide defines an LLM as a system that generates coherent language by predicting likely continuations of input, and notes that such models lack persistent memory across interactions.", "body_md": "Before anything is introduced, I need you to think about something for a moment. *When you write a function, what are you doing?* You are writing rules. Deterministic rules. You are telling your code that if an input arrives, I want you to do this. Or if that condition is true, I need you to return that. Your computer does what you wrote, no more, no less and all things being equal, never something different.\n\nThis works pretty well for a large range of problems. Sorting through a list, calculating a price, processing a payment and so on. But these problems have a common thread, you can think through every case that matters and you can write an instruction for each one. But it breaks with a problem that says *given a customer support message, decide whether or not the customer is frustrated.* Think about how you would go about writing the rules for this problem. You could write a conditional that says *if the message has the word ‘angry’, flag as frustrated* but what happens if the word isn’t *‘angry’* but something else, like *‘ridiculous’* or maybe it is not even a word, it is something like *‘I have been waiting three weeks?’* or *‘fine, whatever’*. You can try to cover all the cases that could possibly exist and fall short of ten more. There simply is no placing human intent or language in a box of finite conditions.\n\n### The Large Language Model: A Prediction Tool\n\nThink about how we learned about the world as children. Yes, it is true we were taught many things in school and by our guardians, we learned from friends and members of society. But most of what we’ve learned at our core has come through pattern recognition. Seeing the same things over and over, in different shapes, colours, contexts. A pattern forms in our brains that allows us to recognise a dog when we see one even if it is a different breed, size, colour from the ones we’ve seen before. Your brain knows what a dog should look like and so it fills that gap for you.\n\nLikewise, with machine learning, a system is shown examples, millions and billions of examples. The system, like our brains, finds the pattern in those examples. Not rules, like traditional software (*we’ve established those are finite)*, examples. When the system receives an input, it compares it to what it has learned from those examples and makes a ***prediction***.\n\nSo with our earlier problem, where we need to determine whether or not our customer is angry, we’d show the system millions of messages labelled as frustrated, neutral or satisfied. And the system, will look for the pattern, it’ll find what frustrated messages have in common. When a new message comes in, it will predict the most probable label. This system, that learns and predicts things is called a **Prediction Machine.**\n\nThe keyword here is **predict****.** The system does not know anything for a fact. It guesses. This is important because when it tells you something and sounds confident about it, it is not retrieving facts that it knows. It is producing the most probable next sequence of words based on all that it was trained on.\n\nAnd if you have heard the term LLM, this is what it is, a prediction machine. Think Claude, think ChatGPT. They are prediction machines, taking your input and responding with their next best guess. I’ll define it properly here:\n\n*A **Large Language Model (LLM)** is a prediction machine that is trained on a large amount of text and is capable of generating coherent, contextually appropriate language by predicting likely continuations of any input given.*\n\n### Large Language Models Have Amnesia\n\nLarge Language Models are really cool. They take a bunch of information, learn from it and use it to make predictions. But they have a problem, they don’t remember.\n\nIn your day-to-day interactions, when you speak to someone, they remember what you said minutes, days, months ago. Your conversation builds on itself, carries context. When you interact with the prediction machine, it receives your message, produces a response and nothing… It doesn’t know who you are or what you last discussed. Every new message you send arrives as if it is meeting you for the first time. There is a term for this, it is **stateless.**\n\n*A system is **Stateless** when it does not retain any information between individual requests (messages). Each request (message) is processed in isolation with no awareness of what came before it.*\n\nLLMs are stateless. And you are probably thinking about your conversations with ChatGPT or Claude, and how they seem to remember what you said earlier in the conversation. *It is an illusion.* They don’t have memory in the sense that you image, what is happening is that the application is sending back the entire conversation history to the model (LLM) on every call (request, message). So when you send a message, under the hood, the entire message history i.e. your messages to Claude, its response to you, as well as some additional fields we’ll see in a bit, are being sent back as context so it *‘remembers’* what you were talking about.\n\nThis is important because as an AI Engineer, you curate that context. You decide what history to include, you engineer every aspect of it within whatever constraint you are given. You are responsible for what the model can and cannot see. You give it context.\n\n### The Context Window\n\nWe learned about context earlier, and we understand it as everything the model sees on every call (request, message) that helps it ‘*remember’.* For the rest of this section to make some more sense, I want to broaden the definition a bit:\n\n**Context** is everything the model can see at the moment it generates a response. In an LLM call, it is everything you pass in the current request. These things are: the system prompt, the conversation history (back and forth between the model and user), any relevant document, and the user’s current message). If it is not in the context, the model does not know it exists.\n\nDon’t think too hard about the components that make up the context i.e. *the system prompt, the conversation history (back and forth between the model and user), any relevant document, and the user’s current message,* just yet. We’ll revisit them in the next article. For now, understand that they are pivotal in helping the model communicate effectively within any set constraint.\n\nNow, the amount of context you provide a model has its limit. The context itself lives within a ***window.*** It is called the **context window.** And it governs how much of what you need to provide can actually be passed on to the model.\n\n**Context window** is the maximum amount of text that an LLM can process in one call. It is measured in **tokens**. Every aspect of the context’s components, what the model sees (system prompt, conversation history, retrieved documents, user message) must fit within this window. Anything outside of it cannot be seen by the model.\n\nAs an AI Engineer, this constraint, making sure the context window is used optimally, shapes every design decision you’ll be making.\n\nNow that we understand what an LLM is and the constraints it operates under, the next question is: how do you actually talk to one? In the next article, we go inside an LLM API call. And, I'll walk you through building one from scratch, your first contact with an LLM in code.", "url": "https://wpnews.pro/news/aie-1-0-introduction-to-ai-engineering", "canonical_source": "https://heymeraki.substack.com/p/aie_10-introduction-to-ai-engineering", "published_at": "2026-09-14 15:01:29+00:00", "updated_at": "2026-09-15 15:49:45.472926+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "large-language-models", "natural-language-processing"], "entities": ["Claude", "ChatGPT"], "alternates": {"html": "https://wpnews.pro/news/aie-1-0-introduction-to-ai-engineering", "markdown": "https://wpnews.pro/news/aie-1-0-introduction-to-ai-engineering.md", "text": "https://wpnews.pro/news/aie-1-0-introduction-to-ai-engineering.txt", "jsonld": "https://wpnews.pro/news/aie-1-0-introduction-to-ai-engineering.jsonld"}}