<spanid="arch-agent-guide"></span><h1>Agentic Workflow<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#agentic-workflow"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h1>
<p>Arch helps you easily personalize your applications by calling application-specific (API) functions
via user prompts. This involves any predefined functions or APIs you want to expose to users to perform tasks,
gather information, or manipulate data. This capability is generally referred to as <strong>function calling</strong>, where
you have the flexibility to support “agentic” apps tailored to specific use cases - from updating insurance
claims to creating ad campaigns - via prompts.</p>
<p>Arch analyzes prompts, extracts critical information from prompts, engages in lightweight conversation with
the user to gather any missing parameters and makes API calls so that you can focus on writing business logic.
Arch does this via its purpose-built <aclass="reference internal"href="../guides/function_calling.html#function-calling"><spanclass="std std-ref">Arch-FC LLM</span></a> - the fastest (200ms p90 - 10x faser than GPT-4o)
and cheapest (100x than GPT-40) function-calling LLM that matches performance with frontier models.</p>
<h2>Single Function Call<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#single-function-call"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#single-function-call'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>In the most common scenario, users will request a single action via prompts, and Arch efficiently processes the
request by extracting relevant parameters, validating the input, and calling the designated function or API. Here
is how you would go about enabling this scenario with Arch:</p>
<divclass="code-block-caption"><spanclass="caption-text">Define prompt targets that can enable users to engage with API and backened functions of an app</span><a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#id1"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></div>
</span><spanid="line-4"><spanclass="linenos"> 4</span><spanclass="w"></span><spanclass="nt">port_value</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">8080</span><spanclass="w"></span><spanclass="c1">#If you configure port 443, you'll need to update the listener with tls_certificates</span>
</span><spanid="line-7"><spanclass="linenos"> 7</span><spanclass="w"></span><spanclass="no">You are a network assistant that just offers facts; not advice on manufacturers or purchasing decisions.</span>
</mark></span><spanid="line-19"><mark><spanclass="linenos">19</span><spanclass="w"></span><spanclass="no">This prompt target handles user requests to reboot devices.</span>
</mark></span><spanid="line-20"><mark><spanclass="linenos">20</span><spanclass="w"></span><spanclass="no">It ensures that when users request to reboot specific devices or device groups, the system processes the reboot commands accurately.</span>
</mark></span><spanid="line-25"><mark><spanclass="linenos">25</span><spanclass="w"></span><spanclass="no">- "Restart all devices in tenant group tenant-XYZ</span>
</mark></span><spanid="line-26"><mark><spanclass="linenos">26</span><spanclass="w"></span><spanclass="no">- "I need to reboot devices A, B, and C."</span>
</span><spanid="line-39"><spanclass="linenos">39</span><spanclass="c1"># Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem.</span>
</span><spanid="line-42"><spanclass="linenos">42</span><spanclass="w"></span><spanclass="c1"># value could be ip address or a hostname with port</span>
</span><spanid="line-43"><spanclass="linenos">43</span><spanclass="w"></span><spanclass="c1"># this could also be a list of endpoints for load balancing</span>
</span><spanid="line-44"><spanclass="linenos">44</span><spanclass="w"></span><spanclass="c1"># for example endpoint: [ ip1:port, ip2:port ]</span>
</span><spanid="line-46"><spanclass="linenos">46</span><spanclass="w"></span><spanclass="c1"># max time to wait for a connection to be established</span>
<h3>Step 2: Process request parameters in Flask<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#step-2-process-request-parameters-in-flask"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#step-2-process-request-parameters-in-flask'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>Once the prompt targets are configured as above, handling those parameters is</p>
<divclass="code-block-caption"><spanclass="caption-text">Parameter handling with Flask</span><a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#id2"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></div>
</span><spanid="line-8"><spanclass="linenos"> 8</span><spanclass="sd"> Endpoint to retrieve device statistics based on device IDs and an optional time range.</span>
</span><spanid="line-15"><spanclass="linenos">15</span><spanclass="k">return</span><spanclass="n">jsonify</span><spanclass="p">({</span><spanclass="s1">'error'</span><spanclass="p">:</span><spanclass="s2">"'device_ids' parameter is required and must be a list"</span><spanclass="p">}),</span><spanclass="mi">400</span>
</span><spanid="line-20"><spanclass="linenos">20</span><spanclass="k">return</span><spanclass="n">jsonify</span><spanclass="p">({</span><spanclass="s1">'error'</span><spanclass="p">:</span><spanclass="s2">"'time_range' must be an integer"</span><spanclass="p">}),</span><spanclass="mi">400</span>
</span><spanid="line-22"><spanclass="linenos">22</span><spanclass="c1"># Simulate retrieving statistics for the given device IDs and time range</span>
</span><spanid="line-23"><spanclass="linenos">23</span><spanclass="c1"># In a real application, you would query your database or external service here</span>
</span><spanid="line-30"><spanclass="linenos">30</span><spanclass="s1">'data'</span><spanclass="p">:</span><spanclass="sa">f</span><spanclass="s1">'Statistics data for device </span><spanclass="si">{</span><spanclass="n">device_id</span><spanclass="si">}</span><spanclass="s1"> over the last </span><spanclass="si">{</span><spanclass="n">time_range</span><spanclass="si">}</span><spanclass="s1"> days.'</span>
<h2>Parallel/ Multiple Function Calling<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#parallel-multiple-function-calling"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#parallel-multiple-function-calling'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h2>
<p>In more complex use cases, users may request multiple actions or need multiple APIs/functions to be called
simultaneously or sequentially. With Arch, you can handle these scenarios efficiently using parallel or multiple
function calling. This allows your application to engage in a broader range of interactions, such as updating
different datasets, triggering events across systems, or collecting results from multiple services in one prompt.</p>
<p>Arch-FC1B is built to manage these parallel tasks efficiently, ensuring low latency and high throughput, even
when multiple functions are invoked. It provides two mechanisms to handle these cases:</p>
<h3>Step 1: Define Multiple Function Targets<a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#step-1-define-multiple-function-targets"x-intersect.margin.0%.0%.-70%.0%="activeSection ='#step-1-define-multiple-function-targets'"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></h3>
<p>When enabling multiple function calling, define the prompt targets in a way that supports multiple functions or
API calls based on the user’s prompt. These targets can be triggered in parallel or sequentially, depending on
the user’s intent.</p>
<p>Example of Multiple Prompt Targets in YAML:</p>
<divclass="code-block-caption"><spanclass="caption-text">Define prompt targets that can enable users to engage with API and backened functions of an app</span><a@click.prevent="window.navigator.clipboard.writeText($el.href); $el.setAttribute('data-tooltip', 'Copied!'); setTimeout(() => $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)"aria-label="Copy link to this element"class="headerlink"data-tooltip="Copy link to this element"href="#id3"><svgheight="1em"viewbox="0 0 24 24"width="1em"xmlns="http://www.w3.org/2000/svg"><pathd="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a></div>
</span><spanid="line-4"><spanclass="linenos"> 4</span><spanclass="w"></span><spanclass="nt">port_value</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">8080</span><spanclass="w"></span><spanclass="c1">#If you configure port 443, you'll need to update the listener with tls_certificates</span>
</span><spanid="line-7"><spanclass="linenos"> 7</span><spanclass="w"></span><spanclass="no">You are a network assistant that just offers facts; not advice on manufacturers or purchasing decisions.</span>
</mark></span><spanid="line-19"><mark><spanclass="linenos">19</span><spanclass="w"></span><spanclass="no">This prompt target handles user requests to reboot devices.</span>
</mark></span><spanid="line-20"><mark><spanclass="linenos">20</span><spanclass="w"></span><spanclass="no">It ensures that when users request to reboot specific devices or device groups, the system processes the reboot commands accurately.</span>
</mark></span><spanid="line-25"><mark><spanclass="linenos">25</span><spanclass="w"></span><spanclass="no">- "Restart all devices in tenant group tenant-XYZ</span>
</mark></span><spanid="line-26"><mark><spanclass="linenos">26</span><spanclass="w"></span><spanclass="no">- "I need to reboot devices A, B, and C."</span>
</span><spanid="line-39"><spanclass="linenos">39</span><spanclass="c1"># Arch creates a round-robin load balancing between different endpoints, managed via the cluster subsystem.</span>
</span><spanid="line-42"><spanclass="linenos">42</span><spanclass="w"></span><spanclass="c1"># value could be ip address or a hostname with port</span>
</span><spanid="line-43"><spanclass="linenos">43</span><spanclass="w"></span><spanclass="c1"># this could also be a list of endpoints for load balancing</span>
</span><spanid="line-44"><spanclass="linenos">44</span><spanclass="w"></span><spanclass="c1"># for example endpoint: [ ip1:port, ip2:port ]</span>
</span><spanid="line-46"><spanclass="linenos">46</span><spanclass="w"></span><spanclass="c1"># max time to wait for a connection to be established</span>
<divclass="sticky top-16 -mt-10 max-h-[calc(100vh-5rem)] overflow-y-auto pt-6 space-y-2"><pclass="font-medium">On this page</p>
<ul>
<li><a:data-current="activeSection === '#single-function-call'"class="reference internal"href="#single-function-call">Single Function Call</a><ul>
<li><a:data-current="activeSection === '#step-1-define-prompt-targets-with-functions'"class="reference internal"href="#step-1-define-prompt-targets-with-functions">Step 1: Define prompt targets with functions</a></li>
<li><a:data-current="activeSection === '#step-2-process-request-parameters-in-flask'"class="reference internal"href="#step-2-process-request-parameters-in-flask">Step 2: Process request parameters in Flask</a></li>
</ul>
</li>
<li><a:data-current="activeSection === '#parallel-multiple-function-calling'"class="reference internal"href="#parallel-multiple-function-calling">Parallel/ Multiple Function Calling</a><ul>
<li><a:data-current="activeSection === '#step-1-define-multiple-function-targets'"class="reference internal"href="#step-1-define-multiple-function-targets">Step 1: Define Multiple Function Targets</a></li>