<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en_US"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://reego.ai/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://reego.ai/" rel="alternate" type="text/html" hreflang="en_US" /><updated>2026-11-19T10:51:20+03:00</updated><id>https://reego.ai/blog/feed.xml</id><title type="html">Reego</title><subtitle>Reego builds AI agents, automations, ML systems and MVPs — and helps teams with AI engineering, context engineering and agent development consulting.</subtitle><entry><title type="html">Context engineering: what your agent sees is what it does</title><link href="https://reego.ai/blog/2026/context-engineering-for-reliable-agents/" rel="alternate" type="text/html" title="Context engineering: what your agent sees is what it does" /><published>2026-10-30T00:00:00+03:00</published><updated>2026-10-30T00:00:00+03:00</updated><id>https://reego.ai/blog/2026/context-engineering-for-reliable-agents</id><content type="html" xml:base="https://reego.ai/blog/2026/context-engineering-for-reliable-agents/"><![CDATA[<p>Most agent failures we get called in to fix are not model failures. The model
did exactly what its context told it to do — the context was just wrong:
a stale document, an ambiguous tool description, 40k tokens of chat history
burying the one instruction that mattered.</p>

<p>That’s why we think of <strong>context engineering</strong> as the core skill of building
with LLMs. Prompt engineering asks <em>“how do I phrase this?”</em>. Context
engineering asks <em>“what exactly should the model see at this step, and what
should it not?”</em></p>

<h2 id="the-context-window-is-a-budget">The context window is a budget</h2>

<p>Every call to a model assembles a context from roughly five sources:</p>

<table>
  <thead>
    <tr>
      <th>Source</th>
      <th>Example</th>
      <th>Typical failure</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>System instructions</td>
      <td>role, rules, output format</td>
      <td>contradictory or buried rules</td>
    </tr>
    <tr>
      <td>Tool definitions</td>
      <td>names, descriptions, JSON schemas</td>
      <td>overlapping tools, vague params</td>
    </tr>
    <tr>
      <td>Retrieved knowledge</td>
      <td>docs, rows, search results</td>
      <td>irrelevant or stale chunks</td>
    </tr>
    <tr>
      <td>Memory &amp; history</td>
      <td>prior turns, scratchpad, summaries</td>
      <td>unbounded growth, lost goals</td>
    </tr>
    <tr>
      <td>The task itself</td>
      <td>user message, current state</td>
      <td>missing constraints</td>
    </tr>
  </tbody>
</table>

<p>Treat these as line items in a budget. If you can’t say how many tokens each
one gets — and why — you’re not engineering the context, you’re accumulating it.</p>

<h2 id="1-tools-are-part-of-the-prompt">1. Tools are part of the prompt</h2>

<p>Tool schemas are read by the model on every turn. A tool named <code class="language-plaintext highlighter-rouge">get_data</code>
with a description of “Gets data” forces the model to guess. Compare:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"search_customer_orders"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Find a customer's orders by email or order ID. Use this before answering any question about order status, shipping or refunds. Returns at most 20 orders, newest first."</span><span class="p">,</span><span class="w">
  </span><span class="nl">"input_schema"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"object"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"properties"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="nl">"email"</span><span class="p">:</span><span class="w">    </span><span class="p">{</span><span class="w"> </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w"> </span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Customer email, exact match"</span><span class="w"> </span><span class="p">},</span><span class="w">
      </span><span class="nl">"order_id"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w"> </span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"e.g. ORD-10293"</span><span class="w"> </span><span class="p">},</span><span class="w">
      </span><span class="nl">"status"</span><span class="p">:</span><span class="w">   </span><span class="p">{</span><span class="w"> </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w"> </span><span class="nl">"enum"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"open"</span><span class="p">,</span><span class="w"> </span><span class="s2">"shipped"</span><span class="p">,</span><span class="w"> </span><span class="s2">"refunded"</span><span class="p">]</span><span class="w"> </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="nl">"anyOf"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w"> </span><span class="nl">"required"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"email"</span><span class="p">]</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"required"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"order_id"</span><span class="p">]</span><span class="w"> </span><span class="p">}]</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>The second version tells the model <em>when</em> to call the tool, <em>what it returns</em>
and <em>how to fill each argument</em>. Enums remove a whole class of hallucinated
values. We built <a href="https://toolcalling.ai">ToolCalling.ai</a> precisely to iterate
on schemas like this against several models side by side.</p>

<p>Rules of thumb we use:</p>

<ul>
  <li><strong>Fewer, sharper tools.</strong> Ten overlapping tools perform worse than four
well-separated ones. If two tools are often confused, merge them or rename them.</li>
  <li><strong>Describe outputs, not just inputs.</strong> The model plans better when it knows
what it’ll get back.</li>
  <li><strong>Return compact results.</strong> A tool that returns 300 rows of JSON just spent
your context budget for you. Summarise, paginate, or return IDs plus a count.</li>
</ul>

<h2 id="2-retrieval-is-a-ranking-problem-not-a-storage-problem">2. Retrieval is a ranking problem, not a storage problem</h2>

<p>Dumping the top-10 vector hits into the prompt is the default — and the
default is usually wrong. What helps:</p>

<ol>
  <li><strong>Hybrid search</strong> (keyword + vector) for anything with IDs, names or codes.</li>
  <li><strong>Rerank, then cut.</strong> Three highly relevant chunks beat ten mediocre ones.</li>
  <li><strong>Attach provenance.</strong> Include source and date with each chunk so the model
can prefer fresh data and cite it.</li>
  <li><strong>Let the agent retrieve.</strong> For multi-step tasks, expose retrieval as a tool
instead of pre-stuffing the context. The agent asks for what it needs, when
it needs it.</li>
</ol>

<h2 id="3-memory-needs-compaction">3. Memory needs compaction</h2>

<p>Long-running agents degrade as their history grows: early instructions get
diluted and the model starts to forget the goal. A simple pattern that works:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">build_context</span><span class="p">(</span><span class="n">task</span><span class="p">,</span> <span class="n">history</span><span class="p">,</span> <span class="n">budget_tokens</span><span class="o">=</span><span class="mi">24_000</span><span class="p">):</span>
    <span class="n">recent</span> <span class="o">=</span> <span class="n">history</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">:]</span>                       <span class="c1"># keep last turns verbatim
</span>    <span class="n">older</span> <span class="o">=</span> <span class="n">history</span><span class="p">[:</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span>
    <span class="n">summary</span> <span class="o">=</span> <span class="nf">summarize</span><span class="p">(</span><span class="n">older</span><span class="p">)</span> <span class="k">if</span> <span class="n">older</span> <span class="k">else</span> <span class="sh">""</span> <span class="c1"># compact the rest
</span>    <span class="k">return</span> <span class="p">[</span>
        <span class="nf">system_prompt</span><span class="p">(),</span>                        <span class="c1"># stable, cacheable prefix
</span>        <span class="o">*</span><span class="nf">tool_definitions</span><span class="p">(),</span>
        <span class="p">{</span><span class="sh">"</span><span class="s">role</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">user</span><span class="sh">"</span><span class="p">,</span> <span class="sh">"</span><span class="s">content</span><span class="sh">"</span><span class="p">:</span> <span class="sa">f</span><span class="sh">"</span><span class="s">Progress so far:</span><span class="se">\n</span><span class="si">{</span><span class="n">summary</span><span class="si">}</span><span class="sh">"</span><span class="p">},</span>
        <span class="o">*</span><span class="n">recent</span><span class="p">,</span>
        <span class="p">{</span><span class="sh">"</span><span class="s">role</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">user</span><span class="sh">"</span><span class="p">,</span> <span class="sh">"</span><span class="s">content</span><span class="sh">"</span><span class="p">:</span> <span class="n">task</span><span class="p">},</span>
    <span class="p">]</span>
</code></pre></div></div>

<p>Keep the stable parts (system prompt, tools) at the front so provider-side
prompt caching kicks in — it’s often the single biggest cost and latency win.</p>

<h2 id="4-measure-it">4. Measure it</h2>

<p>Context changes are code changes. Every time you edit a tool description or
retrieval setting, run the same eval set and compare:</p>

<ul>
  <li><strong>Task success rate</strong> on 30–100 realistic cases</li>
  <li><strong>Tool-call accuracy</strong>: right tool, valid arguments, no unnecessary calls</li>
  <li><strong>Tokens and latency per task</strong></li>
</ul>

<p>Without this loop, you’re tuning by vibes — and the next model upgrade will
quietly undo half of it.</p>

<h2 id="the-takeaway">The takeaway</h2>

<p>Better models raise the ceiling, but context sets the floor. Most of the
reliability we add to client agents comes from deliberately deciding what goes
into each call: sharper tools, ranked retrieval, compacted memory and an eval
suite that keeps everyone honest.</p>

<p>If your agent works in the demo but not in production, the context is the
first place we’d look — <a href="/#contact">we’re happy to take a look with you</a>.</p>]]></content><author><name>Hasan Yılmaz</name></author><category term="Context engineering" /><category term="Agents" /><category term="Tool calling" /><summary type="html"><![CDATA[Prompt tweaks stop paying off fast. Reliable agents come from engineering the whole context window — instructions, tools, retrieved data and memory — as a budgeted, testable system.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://reego.ai/assets/img/og.png" /><media:content medium="image" url="https://reego.ai/assets/img/og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">AI Slack agents, self-service data and pipelines at Aircall</title><link href="https://reego.ai/blog/2026/ai-slack-agents-self-service-data-at-aircall/" rel="alternate" type="text/html" title="AI Slack agents, self-service data and pipelines at Aircall" /><published>2026-10-19T00:00:00+03:00</published><updated>2026-10-19T00:00:00+03:00</updated><id>https://reego.ai/blog/2026/ai-slack-agents-self-service-data-at-aircall</id><content type="html" xml:base="https://reego.ai/blog/2026/ai-slack-agents-self-service-data-at-aircall/"><![CDATA[]]></content><author><name>Hasan Yılmaz</name></author><category term="Agents" /><category term="Slack" /><category term="Text-to-SQL" /><category term="Case study" /><summary type="html"><![CDATA[A look back at AI-powered Slack apps (one saved $80K/year on tooling), a text-to-SQL self-service agent and the data pipelines behind them.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://reego.ai/assets/img/og.png" /><media:content medium="image" url="https://reego.ai/assets/img/og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Three fake interviews, three malware repos</title><link href="https://reego.ai/blog/2026/three-fake-interviews-three-malware-repos/" rel="alternate" type="text/html" title="Three fake interviews, three malware repos" /><published>2026-10-17T00:00:00+03:00</published><updated>2026-10-17T00:00:00+03:00</updated><id>https://reego.ai/blog/2026/three-fake-interviews-three-malware-repos</id><content type="html" xml:base="https://reego.ai/blog/2026/three-fake-interviews-three-malware-repos/"><![CDATA[]]></content><author><name>Hasan Yılmaz</name></author><category term="Security" /><category term="Malware" /><category term="DevGuard" /><summary type="html"><![CDATA[Every "take-home task" we scanned this year tried to run malware the moment the folder was opened. What they had in common, how to protect yourself, and how to scan before you open.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://reego.ai/assets/img/og.png" /><media:content medium="image" url="https://reego.ai/assets/img/og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Is VS Code safe for a repo you never run?</title><link href="https://reego.ai/blog/2026/is-vs-code-safe-for-a-repo-you-never-run/" rel="alternate" type="text/html" title="Is VS Code safe for a repo you never run?" /><published>2026-10-15T00:00:00+03:00</published><updated>2026-10-15T00:00:00+03:00</updated><id>https://reego.ai/blog/2026/is-vs-code-safe-for-a-repo-you-never-run</id><content type="html" xml:base="https://reego.ai/blog/2026/is-vs-code-safe-for-a-repo-you-never-run/"><![CDATA[]]></content><author><name>Hasan Yılmaz</name></author><category term="Security" /><category term="Malware" /><category term="VS Code" /><summary type="html"><![CDATA[Most of us follow one simple rule with code we don't trust — read it, don't run it. A fake interview repo shows why opening the folder is already running it.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://reego.ai/assets/img/og.png" /><media:content medium="image" url="https://reego.ai/assets/img/og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>