# 📚 Nexus guide: response optimization

*Published 2025-12-05*

<h2><strong>What is response optimization?</strong></h2><p>Response optimization is the process of refining and restructuring tool outputs <em>before</em> they reach your Large Language Model (LLM). Many tools return large, verbose payloads—deep JSON objects, full HTML documents, extensive metadata—that the model doesn’t actually need.</p><p>Without optimization, this extra data can:</p><ul><li><strong>Increase token costs<br><br></strong></li><li><strong>Consume valuable context window space<br><br></strong></li><li><strong>Introduce noise that reduces model accuracy<br></strong></li></ul><p>Response optimization ensures the LLM receives only the most relevant, streamlined data so your workflows remain efficient and reliable.</p><p>‍</p><h2><strong>Why this matters</strong></h2><div data-rt-embed-type='true'><h3>1. Lower token usage</h3>
<p>
  By reducing the size of each response, you directly reduce LLM processing costs.
</p>

<table style="
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  color: #e8e8e8;
">
  <thead>
    <tr style="background-color: #1a1a1a;">
      <th style="border: 1px solid #333; padding: 12px; text-align: left;">Technique</th>
      <th style="border: 1px solid #333; padding: 12px; text-align: left;">What it does</th>
    </tr>
  </thead>
  <tbody>
    <tr style="background-color: #111;">
      <td style="border: 1px solid #333; padding: 12px;"><strong>Field filtering (whitelisting)</strong></td>
      <td style="border: 1px solid #333; padding: 12px;">Selects only the fields required for your workflow and removes everything else.</td>
    </tr>
    <tr style="background-color: #181818;">
      <td style="border: 1px solid #333; padding: 12px;"><strong>JSON-to-CSV conversion</strong></td>
      <td style="border: 1px solid #333; padding: 12px;">Converts repetitive JSON arrays into compact CSV, often reducing token volume by more than 90%.</td>
    </tr>
  </tbody>
</table>

<h3>2. Better use of the model’s context window</h3>
<p>
  Smaller, cleaner responses leave more room for multi-step reasoning and longer-running workflows.
</p>

<table style="
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  color: #e8e8e8;
">
  <thead>
    <tr style="background-color: #1a1a1a;">
      <th style="border: 1px solid #333; padding: 12px; text-align: left;">Technique</th>
      <th style="border: 1px solid #333; padding: 12px; text-align: left;">What it does</th>
    </tr>
  </thead>
  <tbody>
    <tr style="background-color: #111;">
      <td style="border: 1px solid #333; padding: 12px;"><strong>Content simplification</strong></td>
      <td style="border: 1px solid #333; padding: 12px;">Converts verbose HTML into clean Markdown that is easier for the model to parse.</td>
    </tr>
    <tr style="background-color: #181818;">
      <td style="border: 1px solid #333; padding: 12px;"><strong>Payload reduction</strong></td>
      <td style="border: 1px solid #333; padding: 12px;">Frees up additional context window capacity so the LLM can maintain more state and integrate more data.</td>
    </tr>
  </tbody>
</table></div><h2><strong>How Nexus optimizes responses</strong></h2><p>Nexus makes response optimization simple by applying these transformations automatically, without requiring custom scripts or manual cleanup.</p><p>With Nexus, you can:</p><ul><li><strong>Filter and reshape tool outputs</strong> before they reach the LLM<br><br></li><li><strong>Convert formats</strong> (e.g., JSON → CSV, HTML → Markdown) in a single step<br><br></li><li><strong>Remove unnecessary fields and metadata</strong> to minimize payload size<br><br></li><li><strong>Ensure consistent, predictable response structures</strong> across different tools<br><br></li></ul><p>The result is a clean, efficient data pipeline that reduces costs, improves accuracy, and enables more scalable workflows.</p>

Source: https://www.civic.com/news/response-optimization
