<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Knitli</title>
    <description>The latest articles on Forem by Knitli (@knitli).</description>
    <link>https://forem.com/knitli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F11638%2F17be09da-9c27-4359-aba9-e9fa88a0e3ca.png</url>
      <title>Forem: Knitli</title>
      <link>https://forem.com/knitli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/knitli"/>
    <language>en</language>
    <item>
      <title>Context Engineering: How We Work Around the Goldfish Problem</title>
      <dc:creator>Adam Poulemanos</dc:creator>
      <pubDate>Tue, 06 Jan 2026 15:50:43 +0000</pubDate>
      <link>https://forem.com/knitli/context-engineering-how-we-work-around-the-goldfish-problem-252i</link>
      <guid>https://forem.com/knitli/context-engineering-how-we-work-around-the-goldfish-problem-252i</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://blog.knitli.com/context-engineering-how-we-work-around-the-golfish-problem" rel="noopener noreferrer"&gt;blog.knitli.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Context engineering is the practice of deciding what information goes into a large language model's (LLM's) context window and when&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The dominant approach today is summarization&lt;/strong&gt;: using an LLM to compress context when the window fills up&lt;/li&gt;
&lt;li&gt;Summarization works well for some tasks but loses critical details in others, forcing agents to re-retrieve the same information repeatedly&lt;/li&gt;
&lt;li&gt;Other approaches like RAG and fine-tuning exist, each with real tradeoffs&lt;/li&gt;
&lt;li&gt;Understanding these tradeoffs helps you choose the right tools and know when to trust them&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If Context is King, Context Engineering is Kingmaking
&lt;/h2&gt;

&lt;p&gt;In my last post, I explained that LLMs are goldfish. They can only see what fits in their context window, and they forget everything else. I also showed how context poisoning happens when you dump too much irrelevant information into that window, making it harder for the model to find what matters.&lt;/p&gt;

&lt;p&gt;So how do engineers actually deal with this? That's where context engineering comes in.&lt;/p&gt;

&lt;p&gt;Context engineering is the practice of deciding what information an LLM sees, when it sees it, and how much of it gets included. It's the difference between an AI that gives you useful answers and one that hallucinates or misses obvious details.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Summarization Approach (What Most Tools Do Today)
&lt;/h2&gt;

&lt;p&gt;Here's how most AI coding tools handle context limits:&lt;/p&gt;

&lt;p&gt;The agent starts working on your task. It reads files, makes changes, runs commands, and accumulates history. All of this fills the context window.&lt;/p&gt;

&lt;p&gt;When the window approaches its limit—usually around 95% full—the system needs to make room for more.&lt;/p&gt;

&lt;p&gt;The standard solution: call another LLM to summarize everything that's happened so far. The summarization LLM gets the entire conversation history and a prompt like "compress this to save tokens." It produces a shortened version, the system discards the original details, and the agent continues with this compressed summary as its only record of what came before.&lt;/p&gt;

&lt;p&gt;This is called "auto-compact" or "context compression" or "hierarchical summarization," but it's all the same basic idea. Claude Code does it. Cursor does it. Most agent frameworks do it.&lt;/p&gt;

&lt;p&gt;Why is this approach so common? Because it's a reasonable response to a hard constraint. Context windows are finite. Work sessions aren't. Something has to give, and summarization is cheap to implement and works surprisingly well for many tasks.&lt;/p&gt;

&lt;p&gt;But it has real limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Summarization Works and Where It Doesn't
&lt;/h2&gt;

&lt;p&gt;Summarization works well when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The task is mostly linear (do step A, then B, then C)&lt;/li&gt;
&lt;li&gt;Earlier details genuinely don't matter once completed&lt;/li&gt;
&lt;li&gt;The agent won't need to revisit specific information from early in the session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Summarization struggles when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The task involves debugging or iterative refinement&lt;/li&gt;
&lt;li&gt;The agent needs to compare current state to earlier state&lt;/li&gt;
&lt;li&gt;Specific details (exact error messages, variable names, code snippets) matter more than general narrative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a concrete example of the second case:&lt;/p&gt;

&lt;p&gt;An agent is debugging a function. It reads the function definition, identifies a bug, makes a fix, tests it, sees a new error, and reads the function again to understand the new error.&lt;/p&gt;

&lt;p&gt;Then the context window fills up. The system summarizes.&lt;/p&gt;

&lt;p&gt;The summary might say: "Fixed bug in calculate_total function, encountered new error."&lt;/p&gt;

&lt;p&gt;But it doesn't include the actual function code, the specific error message, or the change that was made. That detail is gone.&lt;/p&gt;

&lt;p&gt;Two turns later, the agent needs to understand why the new error is happening. It doesn't have the function code anymore—that got summarized away. So it re-reads the file, re-retrieving context it already had.&lt;/p&gt;

&lt;p&gt;This happens often in debugging workflows. Agents spend time and tokens re-reading information they've already seen because summarization discarded the details they need.&lt;/p&gt;

&lt;p&gt;It's like taking notes during a meeting by writing "discussed the budget" and then, when someone asks you what the actual numbers were, having to go back and re-watch the recording.&lt;/p&gt;

&lt;p&gt;The deeper problem: summarization is lossy in unpredictable ways. The LLM doing the compression has to guess what's important. Sometimes it guesses wrong. When that happens, the agent either fails or has to backtrack and reconstruct context from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Approaches and Their Tradeoffs
&lt;/h2&gt;

&lt;p&gt;Summarization dominates because it is easy and often 'good enough.' There are other approaches, each with their own pros and cons:&lt;/p&gt;

&lt;h3&gt;
  
  
  RAG: Retrieval Augmented Generation
&lt;/h3&gt;

&lt;p&gt;RAG treats your codebase (or other data) like a searchable database. It breaks everything into chunks, converts them into numerical representations called embeddings (essentially coordinates in a high-dimensional space where similar content clusters together), and stores them. When the agent needs information, it searches for relevant chunks and adds them to the context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The appeal:&lt;/strong&gt; RAG lets you work with massive codebases without loading everything at once. You retrieve only what's relevant for each query.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The tradeoff:&lt;/strong&gt; The quality of RAG depends entirely on how you implement it. Naive implementations use simple similarity matching—essentially asking "which chunks of text sound most like this query?" This works okay for documentation but breaks down for code. A function definition might have low textual similarity to a query about debugging an error that function causes. Dependencies three files away don't "sound like" the immediate problem, even when they're critical to understanding it.&lt;/p&gt;

&lt;p&gt;More sophisticated RAG systems understand code structure: they know about function calls, imports, type definitions, and can traverse these relationships. This makes retrieval much more accurate but is significantly harder to build.&lt;/p&gt;

&lt;p&gt;The practical result: RAG quality varies enormously between tools. When evaluating a tool that uses RAG, the question isn't "does it use RAG" but "how smart is its retrieval?"&lt;/p&gt;

&lt;h3&gt;
  
  
  Caching: Remember What You've Already Seen
&lt;/h3&gt;

&lt;p&gt;Some systems cache frequently-accessed context so they don't have to re-retrieve or re-process it. If an agent reads the same file five times during a session, caching means you only pay the retrieval cost once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The appeal:&lt;/strong&gt; Caching directly addresses the re-retrieval problem that summarization creates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The tradeoff:&lt;/strong&gt; Caches take memory. They can become stale if files change. And deciding what to cache (and when to invalidate it) adds complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Agents: Let the Model Search for Itself
&lt;/h3&gt;

&lt;p&gt;Agent systems give the LLM tools to retrieve its own context. Instead of pre-selecting information, you let the model search files, run commands, or call APIs to find what it needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The appeal:&lt;/strong&gt; Agents can adapt. They search for what they need in the moment and course-correct based on what they find.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The tradeoff:&lt;/strong&gt; Agents are slower and more expensive. Every search is another API call (called an "inference call"), which means more tokens—the basic units that AI providers charge you for—and more compute. Agents also make mistakes: they search for the wrong things, miss obvious information, or get stuck in loops. And because the model has to reason about what to retrieve at each step, the whole process uses tokens fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fine-tuning: Bake It Into the Model
&lt;/h3&gt;

&lt;p&gt;Fine-tuning means retraining the model on your specific codebase or domain so it "learns" your patterns and doesn't need them in the context window.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The appeal:&lt;/strong&gt; Once fine-tuned, the model already "knows" your code. No retrieval needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The tradeoff:&lt;/strong&gt; Fine-tuning is expensive and inflexible. You need GPU time, training data, and constant retraining as your codebase changes. Fine-tuned models also aren't great at specific details—they learn general patterns but still hallucinate function names or recent changes. For fast-moving projects, fine-tuning can't keep up.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Challenge: Context Engineering is a Hard Problem
&lt;/h2&gt;

&lt;p&gt;Good context engineering for coding tasks requires several things that are genuinely difficult:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding code structure:&lt;/strong&gt; What depends on what? Which files matter for which tasks? How does information flow through the system? This requires parsing and analyzing code, not just treating it as text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dynamic decision-making:&lt;/strong&gt; Different questions need different context. Understanding what a function does requires different information than debugging why it crashes, which requires different information than refactoring it for performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Precision:&lt;/strong&gt; Pulling the right information without including noise. Every irrelevant token makes it harder for the model to find what matters.&lt;/p&gt;

&lt;p&gt;Most tools make pragmatic tradeoffs here. They use approaches that are cheap to implement and work well enough for common cases, even if they break down on complex tasks. That's not incompetence—it's engineering under constraints.&lt;/p&gt;

&lt;p&gt;But it does mean that for complex, real-world work, context engineering is often the limiting factor. Not model capability. Not prompt quality. Whether the model has the right information to work with.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hidden Costs of Poor Context Engineering
&lt;/h2&gt;

&lt;p&gt;When context engineering breaks down, the costs show up in three places:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Money:&lt;/strong&gt; Every token you process costs money. When you re-retrieve the same information repeatedly, you're paying to process those tokens over and over. When you include irrelevant context "just in case," you're paying for all of it. For teams using AI at scale, this can significantly increase infrastructure costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt; Processing large contexts takes time. The more tokens you feed the model, the longer it takes to respond. When agents have to search repeatedly for information they've already seen, tasks stretch out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reliability:&lt;/strong&gt; When the model has to work with lossy summaries or sift through irrelevant information, it makes mistakes. It latches onto the wrong details, misses important nuance, or hallucinates. This is why AI coding tools sometimes confidently suggest fixes that break your code or miss bugs that are obvious if you have the right context.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Can Do About It
&lt;/h2&gt;

&lt;p&gt;If you're using AI coding tools, here are some practical things to keep in mind:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch for re-retrieval patterns.&lt;/strong&gt; If you notice an agent reading the same file multiple times in a session, that's a sign that context is being lost. Some tools handle this better than others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Match tools to tasks.&lt;/strong&gt; Summarization-based tools work fine for straightforward, linear tasks. For debugging or iterative work, look for tools with smarter context management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ask about context strategy.&lt;/strong&gt; When evaluating AI coding tools, ask: How do they handle long sessions? What happens when the context window fills up? Do they use RAG, and if so, how sophisticated is the retrieval?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep sessions focused.&lt;/strong&gt; Shorter, focused sessions are less likely to hit context limits than sprawling multi-hour sessions. If you're doing complex work, sometimes starting fresh with targeted context is more effective than continuing a bloated session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Provide explicit context.&lt;/strong&gt; Don't assume the tool will find what it needs. If you know a specific file or function is relevant, mention it directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I'm Trying to Fix It
&lt;/h2&gt;

&lt;p&gt;With Knitli, I'm working on context engineering that understands code structure—tracking dependencies, call graphs, repository patterns, and type relationships so retrieval is precise and adaptive rather than approximate and sweeping. My goal: assemble exactly the context each task needs, avoiding both the re-retrieval problem and context pollution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My first attempt at that is &lt;a href="https://github.com/knitli/codeweaver" rel="noopener noreferrer"&gt;CodeWeaver&lt;/a&gt;, which you can try today.&lt;/strong&gt; It's rough around the edges and doesn't achieve that goal yet, but it's much more capable at attacking the problem than existing tools. It's also fully open source and free.&lt;/p&gt;

&lt;p&gt;I'm not claiming I've solved context engineering. It's a genuinely hard problem. But I think current approaches leave a lot of room for improvement, and I'm focused on closing that gap.&lt;/p&gt;

&lt;p&gt;If you're interested in following along, you can learn more at &lt;a href="https://knitli.com" rel="noopener noreferrer"&gt;knitli.com&lt;/a&gt;, or try &lt;a href="https://github.com/knitli/codeweaver" rel="noopener noreferrer"&gt;CodeWeaver&lt;/a&gt; and get involved in making something better.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What context engineering challenges have you run into with AI coding tools? I'd love to hear your experiences in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>contextengineering</category>
      <category>mcp</category>
      <category>ai</category>
      <category>development</category>
    </item>
    <item>
      <title>Tree-Sitter Grammars Explained: Leveraging Data for Clarity</title>
      <dc:creator>Adam Poulemanos</dc:creator>
      <pubDate>Mon, 06 Oct 2025 14:22:20 +0000</pubDate>
      <link>https://forem.com/knitli/tree-sitter-grammars-explained-leveraging-data-for-clarity-3hgf</link>
      <guid>https://forem.com/knitli/tree-sitter-grammars-explained-leveraging-data-for-clarity-3hgf</guid>
      <description>&lt;h2&gt;
  
  
  How a Week of Jargon and 25 Languages Resulted in Creating the Parser I Needed
&lt;/h2&gt;




&lt;h4&gt;
  
  
  Clarity Engineering
&lt;/h4&gt;




&lt;h2&gt;
  
  
  TL;DR: If You're Here Because Tree-sitter's &lt;code&gt;node-types.json&lt;/code&gt; Makes No Sense
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;You're not alone.&lt;/strong&gt; Tree-sitter's terminology is confusing because it evolved from internal implementation details, not developer clarity.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Core Problems
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"Named" doesn't mean "has a name"&lt;/strong&gt; (everything has a name). It means "corresponds to a named grammar rule" an internal detail that's noise for most use cases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Fields" and "children" are both parent-child relationships&lt;/strong&gt; but the distinction is unclear. Fields are semantic ("this node's &lt;em&gt;condition&lt;/em&gt;"), children are positional ("this node's first child").&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything is a "type"&lt;/strong&gt; : Nodes, edges, and abstract categories all use the same terminology, obscuring the differences that matter.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;This post uses formatting unsupported by dev.to, please view the rest at &lt;a href="https://blog.knitli.com/tree-sitter-grammars-explained-leveraging-data-for-clarity" rel="noopener noreferrer"&gt;our website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>clarityengineering</category>
      <category>codeweaver</category>
      <category>astgrep</category>
      <category>contextengineering</category>
    </item>
    <item>
      <title>Context and Context Windows: What You Need to Know</title>
      <dc:creator>Adam Poulemanos</dc:creator>
      <pubDate>Fri, 26 Sep 2025 18:17:18 +0000</pubDate>
      <link>https://forem.com/knitli/context-and-context-windows-what-you-need-to-know-h4k</link>
      <guid>https://forem.com/knitli/context-and-context-windows-what-you-need-to-know-h4k</guid>
      <description>&lt;h2&gt;
  
  
  Why Your AI is a Goldfish
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Part 2 of Knitli's 101 introductions to AI and the economics of AI&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Large language models (LLMs) use a fixed-size context window to process input and generate responses, but they don't have memory like humans.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The context window contains all the information the model can consider at once, and when it overflows, older information is lost.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LLMs are trained on outdated data, leading to a preference for older information and potential hallucinations when asked about unknown topics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Context management is crucial, as including too much or irrelevant information can hinder response accuracy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Engineers use techniques like prioritizing recent information and filtering out irrelevant details to manage context effectively.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  LLMs and Their 'Memories'
&lt;/h2&gt;

&lt;p&gt;When people talk about 'AI' today, they usually mean ChatGPT, Claude, or Gemini. These tools all use &lt;strong&gt;large language models (LLMs)&lt;/strong&gt;. LLMs consist of billions of &lt;em&gt;parameters_think of each parameter as a number in a massive mathematical equation. The model combines these parameters with your input to generate responses. Its a huge statistical machine: predicting the most _likely&lt;/em&gt; output based on its training parameters and the context you gave it (intentionally or otherwise).&lt;/p&gt;

&lt;h3&gt;
  
  
  The Context Window 'Container'
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;LLMs don't remember like humans do (or at all).&lt;/strong&gt; Instead, they work with a fixed-size container called a &lt;strong&gt;context window&lt;/strong&gt;. Everything you send the model every word, file, or bit of data_and_ all of the model's previous responses fill this container. When the container overflows, the oldest information disappears. The model can no longer see it, even if you can still see it on your screen.&lt;/p&gt;

&lt;p&gt;Think of it this way: &lt;strong&gt;the context window contains &lt;em&gt;all&lt;/em&gt; the information the LLM can consider at once.&lt;/strong&gt; Any information not in the window, or that doesn't fit in it, doesn't exist to the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Time Bias: Why LLMs Live in the Past
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The context window is the only way to provide LLMs with recent or specific information.&lt;/strong&gt; Companies train these models on huge datasets, but collecting and processing this data takes years. Most of the training data is 2-3 years old or even older. A model might say it was trained up to a month or two ago, but recent information is only a tiny part of its overall training data. Most of what it knows is outdated.&lt;/p&gt;

&lt;p&gt;For instance, if you ask an LLM about a programming framework released last month, it won't know about it unless you include the documentation in your context window. The model's training data just doesn't have that recent information. This leads to a strong preference for older information, even when newer details might be more important.&lt;/p&gt;

&lt;p&gt;It's also important to note that if you ask LLMs to provide information on something they haven't been trained on and have no context for, they will likely produce &lt;em&gt;hallucinations&lt;/em&gt;. A &lt;em&gt;hallucination&lt;/em&gt; occurs when the LLM generates false or made-up information that can sometimes sound real or nearly true. This happens because you asked it to provide information about something it &lt;em&gt;can't&lt;/em&gt;, so it creates something &lt;em&gt;similar&lt;/em&gt; based on its training.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model &lt;em&gt;training&lt;/em&gt; is permanent. &lt;em&gt;Context&lt;/em&gt; is &lt;em&gt;temporary&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Your AI Friend is a Goldfish: It Has No Memory
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Models can't save their context between messages.&lt;/strong&gt; The system that feeds data to the LLM rebuilds and reprocesses the entire context history every single turn. This process of generating output from input combined with the models training is called &lt;em&gt;inference&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Here's what actually happens: You send "hey there" to ChatGPT. Your buddy ChatGPT replies with a friendly response. When you send your second message, the model doesn't just process that new message &lt;strong&gt;it processes your first message, its first response, AND your second message all at once&lt;/strong&gt;. This context grows with each exchange.&lt;/p&gt;

&lt;p&gt;The model treats this entire conversation thread as one giant input until the window reaches its limit and forces older turns to drop. Thats why responses can change tone or forget earlier details as conversations grow longer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Context Window Paradox
&lt;/h2&gt;

&lt;p&gt;Context window sizes have grown dramatically. A few years ago, models handled only a few thousand words (8,192 or 16,384 &lt;a href="https://blog.knitli.com/understanding-tokens-what-they-are-and-why-theyre-important" rel="noopener noreferrer"&gt;tokens&lt;/a&gt;). Today's top models can process 128,000 to 2 million tokens worth of information.&lt;/p&gt;

&lt;p&gt;Bigger windows allow more context, but they create new problems. Fill a window with irrelevant information, and you're giving the model junk data that makes accurate responses harder. Processing large contexts also takes more time and costs more money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This creates a paradox: any information you exclude might be crucial, but including too much information can poison the model's ability to respond accurately.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Context Poisoning Problem
&lt;/h3&gt;

&lt;p&gt;Most current tools don't handle context well. For coding tasks, many systems add everything that might be relevant into the model's context without careful selection. They might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Entire codebases when only a few functions are needed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Outdated documentation along with current specs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Error logs mixed with successful runs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple conflicting examples&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This adds more confusion than clarity, making it difficult for the model to find useful information among irrelevant details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters for You
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Understanding context windows helps explain common AI frustrations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Why an AI assistant "forgets" something you mentioned earlier in a long conversation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why providing too much background information sometimes makes responses worse&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why the same prompt can give different results depending on what else is in the context (since models are probabilistic, meaning they create output based on statistical likelihood, even the exact same context can lead to different results).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why AI coding tools sometimes suggest outdated approaches despite having access to current documentation&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Working Around the Limitations
&lt;/h2&gt;

&lt;p&gt;Engineers use several techniques to manage context effectively, like prioritizing recent information, summarizing older exchanges, and filtering out irrelevant details. But these approaches have their own trade-offs and limitations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The bottom line: "context is king" for LLMs.&lt;/strong&gt; Feeding the right amount of the right information in the right order matters more than raw context window size. &lt;strong&gt;This makes context management the central engineering challenge for anyone building with LLMs.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Our next post in this series will explore current solutions to these context problems including their strengths, weaknesses, and why even the best approaches today aren't quite "good enough" for complex, long-running tasks.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;visit us at &lt;a href="https://knitli.com" rel="noopener noreferrer"&gt;knitli.com&lt;/a&gt; to learn how we're fixing the context problem, and sign up for our waitlist!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>deeplearning</category>
      <category>learning</category>
    </item>
    <item>
      <title>Understanding Tokens: What They Are and Why They're Important</title>
      <dc:creator>Adam Poulemanos</dc:creator>
      <pubDate>Fri, 26 Sep 2025 02:08:14 +0000</pubDate>
      <link>https://forem.com/knitli/understanding-tokens-what-they-are-and-why-theyre-important-876</link>
      <guid>https://forem.com/knitli/understanding-tokens-what-they-are-and-why-theyre-important-876</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv5ruwrttr6nayzzcy3f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv5ruwrttr6nayzzcy3f.png" alt="a graphic showing how tokens are processed" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 1 of &lt;a href="https://knitli.com" rel="noopener noreferrer"&gt;Knitli's&lt;/a&gt; 101 introductions to AI and the economics of AI&lt;/p&gt;




&lt;h2&gt;
  
  
  Tokens are &lt;em&gt;Parts&lt;/em&gt; of Words
&lt;/h2&gt;

&lt;p&gt;Most people think AI, like ChatGPT, reads words. It doesn't.&lt;/p&gt;

&lt;p&gt;It reads &lt;strong&gt;tokens&lt;/strong&gt; invisible chunks of text that power every interaction.&lt;/p&gt;

&lt;p&gt;When you type something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model doesn't see two words. It sees four tokens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hello 1 token&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;, 1 token&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;world (note the space) 1 token&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;! 1 token&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That simple greeting is &lt;strong&gt;4 tokens&lt;/strong&gt; , not &lt;strong&gt;2 words&lt;/strong&gt;. Code fragments break into even more tokens because punctuation, brackets, and symbols all get split up. (What is and isn't a token and what becomes one actually depends on the model, so our example isn't exact.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Tokens Aren't Expensive. Processing them is.
&lt;/h2&gt;

&lt;p&gt;When you send your tokens to get processed, &lt;em&gt;each one&lt;/em&gt; must be run through &lt;strong&gt;billions of math operations on very expensive GPUs&lt;/strong&gt; every single time. Thats where the cost comes from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Power-hungry hardware&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data center space&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cooling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Staff to maintain and secure it&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More tokens more GPU time higher costs.&lt;/p&gt;

&lt;p&gt;Fewer tokens less GPU time lower costs.&lt;/p&gt;

&lt;p&gt;Right now, you probably don't see the meter running. You pay a flat subscription; someone else covers the token bill.&lt;/p&gt;

&lt;p&gt;Under the hood, &lt;strong&gt;tokens are the biggest driver of compute costs at every AI company&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tokens are the Foundation for Everything Else
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Context windows&lt;/strong&gt; , or how much a model can see at one time, are measured in tokens.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API pricing&lt;/strong&gt; is per million tokens (API access is when companies or developers access an AI model to provide their own service, like a chatbot on a website, or just for internal use).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Memory&lt;/strong&gt; , efficiency, and much of prompt engineering are all about how tokens are used.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;If you want to understand AI, and how it really works, or why it sometimes &lt;em&gt;costs so much&lt;/em&gt;. You have to start with tokens.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Learn more about how &lt;strong&gt;Knitli&lt;/strong&gt; is tackling the hidden economics of AI at the source, visit us at &lt;a href="http://knitli.com" rel="noopener noreferrer"&gt;&lt;strong&gt;knitli.com&lt;/strong&gt;&lt;/a&gt; and subscribe to our waitlist for updates!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>openai</category>
    </item>
  </channel>
</rss>
