<?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>DEV Community: Agensphere</title>
    <description>The latest articles on DEV Community by Agensphere (@agensphere).</description>
    <link>https://dev.to/agensphere</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4207086%2F1d22228e-c40c-470c-906f-2064cf93dd73.png</url>
      <title>DEV Community: Agensphere</title>
      <link>https://dev.to/agensphere</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/agensphere"/>
    <language>en</language>
    <item>
      <title>Context engineering: the job prompt engineering grew into</title>
      <dc:creator>Agensphere</dc:creator>
      <pubDate>Sun, 25 Oct 2026 18:23:35 +0000</pubDate>
      <link>https://dev.to/agensphere/context-engineering-the-job-prompt-engineering-grew-into-19ge</link>
      <guid>https://dev.to/agensphere/context-engineering-the-job-prompt-engineering-grew-into-19ge</guid>
      <description>&lt;p&gt;Context engineering is deciding, for every request, exactly what the model gets to see: the instructions, the knowledge retrieved for this question, what the system remembers about the user, the tools it can call, the results of tools it already called, and the conversation so far. Prompt engineering is the part of that about wording the instructions. In production, it is rarely the part that breaks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is context engineering?
&lt;/h2&gt;

&lt;p&gt;A model knows two things when it answers: what it learned in training, and what is in its context window for this request. You cannot change the first at request time. Context engineering is the discipline of controlling the second: choosing the sources, selecting from them, fitting the result into a budget, and putting it in an order and format the model uses well.&lt;/p&gt;

&lt;p&gt;The term caught on as teams moved from single prompts to agents and retrieval systems, where most of the context is no longer written by a person. It is assembled by code, on every request, from data that changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How is context engineering different from prompt engineering?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Prompt engineering&lt;/th&gt;
&lt;th&gt;Context engineering&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unit of work&lt;/td&gt;
&lt;td&gt;The instructions&lt;/td&gt;
&lt;td&gt;Everything the model sees for a request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Written by&lt;/td&gt;
&lt;td&gt;A person, once&lt;/td&gt;
&lt;td&gt;Code, on every request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main question&lt;/td&gt;
&lt;td&gt;How do I phrase this?&lt;/td&gt;
&lt;td&gt;What does the model need to know right now, and what should it not see?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical failure&lt;/td&gt;
&lt;td&gt;Ambiguous instructions&lt;/td&gt;
&lt;td&gt;Missing, stale, excessive or forbidden information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where it lives&lt;/td&gt;
&lt;td&gt;A prompt file&lt;/td&gt;
&lt;td&gt;Retrieval, memory, tool and state layers, plus the prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Good instructions still matter. They are simply one input among six or seven, and usually the most stable one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What goes into a model's context?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instructions&lt;/strong&gt;: the system prompt, rules and output format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The request&lt;/strong&gt;: what the user asked or the event that triggered the run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieved knowledge&lt;/strong&gt;: passages from your documents and data (see &lt;a href="https://agensphere.com/journal/how-rag-works-step-by-step?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;how RAG works&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory&lt;/strong&gt;: facts kept about the user or task from earlier sessions (see &lt;a href="https://agensphere.com/journal/agent-memory-planning-and-stopping?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;agent memory, planning and stopping&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool definitions&lt;/strong&gt;: the functions the model may call, with their schemas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool results and history&lt;/strong&gt;: what earlier steps returned, and the conversation so far.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task state&lt;/strong&gt;: where a multi-step process stands, such as which approvals are done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each source has its own owner, freshness and permission rules. Context engineering is where they meet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does more context make answers worse?
&lt;/h2&gt;

&lt;p&gt;Because a model does not read its context the way a database runs a query. Everything in the window competes for attention. Long contexts dilute the passages that matter, and models are measurably worse at using information buried in the middle of a long input than at the start or end. Every extra token also adds cost and latency, and every stale or irrelevant passage is one more thing the model can confidently repeat.&lt;/p&gt;

&lt;p&gt;A large context window is a ceiling, not a target (see &lt;a href="https://agensphere.com/journal/a-context-window-is-not-memory?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;a context window is not memory&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you assemble context for each request?
&lt;/h2&gt;

&lt;p&gt;Treat it as a build step with a budget, not as string concatenation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;context/assemble.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;BUDGET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;                       &lt;span class="c1"&gt;# tokens per section; the total stays well under the window
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;instructions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1_500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task_state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;history&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1_500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;assemble&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;load_prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prompt_version&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task_state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state_store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run_id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BUDGET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task_state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;relevant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BUDGET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;passages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;retrieve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# filtered before ranking
&lt;/span&gt;    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;dedupe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;passages&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BUDGET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cite&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;history&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;recent_turns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;conversation&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BUDGET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;history&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;record_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;                 &lt;span class="c1"&gt;# what went in, from where, how many tokens
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four habits carry most of the value:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Budget per section&lt;/strong&gt;, so one source cannot crowd out the others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission filtering before selection&lt;/strong&gt;, so nothing reaches the model that the user could not see (see &lt;a href="https://agensphere.com/journal/filter-by-permission-before-you-rank?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;filter by permission before you rank&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provenance on every passage&lt;/strong&gt;, so the model can cite it and you can trace a bad answer to its source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A manifest in the trace&lt;/strong&gt;, so you can see what the model actually saw when an answer goes wrong (see &lt;a href="https://agensphere.com/journal/trace-and-cost-every-model-call?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;trace and cost every model call&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How do agents change the problem?
&lt;/h2&gt;

&lt;p&gt;An agent calls the model in a loop, and the naive design appends every tool result and every thought to the context. By step ten the window is full of old search results, half of them irrelevant, and the model starts losing the thread.&lt;/p&gt;

&lt;p&gt;Three changes fix most of it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep task state outside the model.&lt;/strong&gt; A small, structured record of what is done and what is next is more reliable than a long transcript the model has to re-read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Summarise tool results as they arrive.&lt;/strong&gt; Keep the facts the task needs; drop the raw payload, or store it and keep a reference.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rebuild the context each step&lt;/strong&gt; from state, memory and fresh retrieval, instead of growing one transcript forever. This is sometimes called compaction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Decision record DR-37 (layer L3)&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;A support agent handled long cases with many tool calls. After a dozen steps it repeated searches, missed earlier findings and cost several times more per case than short ones.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Options&lt;/td&gt;
&lt;td&gt;Move to a model with a larger context window; Truncate the oldest turns when the window fills; Keep case state outside the model and rebuild the context at each step&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chosen&lt;/td&gt;
&lt;td&gt;A structured case record (facts found, actions taken, open questions) updated after every step, with the context rebuilt from that record, the last two turns and fresh retrieval.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rejected&lt;/td&gt;
&lt;td&gt;A larger window delayed the problem and raised cost per step. Truncation dropped exactly the early findings the agent kept repeating searches for.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;The model can only be as good as what you put in front of it. Context engineering is choosing that, on purpose, every time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How do you know the context is right?
&lt;/h2&gt;

&lt;p&gt;Measure it the same way as everything else, with an evaluation set (see &lt;a href="https://agensphere.com/journal/ship-a-prompt-change-with-an-eval?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;ship a prompt change with an eval&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Was the needed information in the context?&lt;/strong&gt; Check this separately from whether the answer was right. If it was missing, the fix is retrieval or memory, not the prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove one section at a time&lt;/strong&gt; and re-run the eval. Sections that do not change the score are cost without benefit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch tokens per request&lt;/strong&gt; in your traces. A slow upward drift is usually context nobody decided to add.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;p&gt;The vocabulary used here, from tokens to memory, is defined in the &lt;a href="https://agensphere.com/glossary?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;glossary&lt;/a&gt;. For the pieces of the context in depth, read &lt;a href="https://agensphere.com/journal/how-rag-works-step-by-step?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;how RAG works&lt;/a&gt;, &lt;a href="https://agensphere.com/journal/a-context-window-is-not-memory?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;a context window is not memory&lt;/a&gt; and &lt;a href="https://agensphere.com/journal/agent-memory-planning-and-stopping?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;agent memory, planning and stopping&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;First published on the &lt;a href="https://agensphere.com/journal/context-engineering?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;Agensphere Journal&lt;/a&gt;. Agensphere builds production AI systems: &lt;a href="https://agensphere.com/?utm_source=devto&amp;amp;utm_medium=syndication&amp;amp;utm_campaign=journal-J-037" rel="noopener noreferrer"&gt;agensphere.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>rag</category>
      <category>promptengineering</category>
    </item>
  </channel>
</rss>
