PHP Classes

File: docs_site/docs/.vuepress/dist/assets/advanced-concepts-C85AF0vT.js

Recommend this page to a friend!
  Packages of Muhammad Umer Farooq   HyperFlow PHP   docs_site/docs/.vuepress/dist/assets/advanced-concepts-C85AF0vT.js   Download  
File: docs_site/docs/.vuepress/dist/assets/advanced-concepts-C85AF0vT.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: HyperFlow PHP
Framework to develop AI agents
Author: By
Last change:
Date: 6 days ago
Size: 4,159 bytes
 

Contents

Class file image Download
import{A as e,d as t,m as n,t as r}from"./plugin-vue_export-helper-DazhzKqf.js";var i=JSON.parse(`{"path":"/guide/advanced-concepts.html","title":"Advanced Concepts & Architectures","lang":"en-US","frontmatter":{},"git":{},"filePathRelative":"guide/advanced-concepts.md"}`),a={name:`advanced-concepts.md`};function o(r,i,a,o,s,c){return e(),t(`div`,null,[...i[0]||=[n(`<h1 id="advanced-concepts-architectures" tabindex="-1"><a class="header-anchor" href="#advanced-concepts-architectures"><span>Advanced Concepts &amp; Architectures</span></a></h1><h2 id="parent-selection-strategies" tabindex="-1"><a class="header-anchor" href="#parent-selection-strategies"><span>Parent Selection Strategies</span></a></h2><p><code>select_parent</code> drives which generation is passed into the MetaAgent. Choosing the absolute best generation every time is actually flawed due to local maximums. HyperFlow provides five algorithms via <code>select_parent.py</code>:</p><ul><li><strong>random</strong>: Pick any valid generation with equal probability. Max exploration.</li><li><strong>latest</strong>: Always pick the most recently created valid generation. Linear progression.</li><li><strong>best</strong>: Always pick the highest-scoring generation. Max exploitation.</li><li><strong>score_prop</strong>: Weighted random: higher scores get higher probability.</li><li><strong>score_child_prop (default)</strong>: Score-weighted + child penalty. Encourages under-visited branches and exploring the global maximum.</li></ul><h2 id="domains-and-evaluation" tabindex="-1"><a class="header-anchor" href="#domains-and-evaluation"><span>Domains and Evaluation</span></a></h2><p>A <strong>Domain</strong> defines what tasks the agent is evaluated on.</p><ul><li><strong>Evaluators</strong>: The grading strategy (<code>evaluators.py</code>). You can use <code>static_evaluator</code> (exact string match), <code>llm_judge_evaluator</code> (using LLMs for subjective questions), or <code>human_feedback_evaluator</code>.</li><li><strong>Harness</strong>: The generic evaluation runner (<code>harness.py</code>). It formats the domain input, requests a forward pass on the <code>TaskAgent</code>, and evaluates it against the task context.</li></ul><h2 id="architectures" tabindex="-1"><a class="header-anchor" href="#architectures"><span>Architectures</span></a></h2><h3 id="execution-modes" tabindex="-1"><a class="header-anchor" href="#execution-modes"><span>Execution Modes</span></a></h3><p>The environment is managed by <code>Executor</code> abstractions (<code>executor.py</code>):</p><ol><li><strong>LocalExecutor</strong>: Copies the repository to a localized temp directory. Faster, but has no sandboxing.</li><li><strong>DockerExecutor</strong>: Creates a temporary Docker volume and sandboxes the process via Dockerode API (<code>docker.py</code>). Excellent for preventing arbitrary code execution escapes since the MetaAgent patches source code itself.</li></ol><h3 id="self-referential-improvement" tabindex="-1"><a class="header-anchor" href="#self-referential-improvement"><span>Self-Referential Improvement</span></a></h3><p>A core concept from the HyperAgents paper is <strong>self-referential self-improvement</strong> ? the MetaAgent can modify its own instructions to become a better improver.</p><p>We achieve this with editable prompt files (using <code>prompts_dir</code>):</p><ul><li><code>meta_agent.txt</code></li><li><code>task_agent.txt</code></li></ul><p>If configured, the MetaAgent edits the very <code>.txt</code> files containing its internal constraints. Thus, the improver improves itself.</p><h3 id="early-termination" tabindex="-1"><a class="header-anchor" href="#early-termination"><span>Early Termination</span></a></h3><p>The loop contains intelligent optimizations:</p><ul><li><strong>Perfect Score Stop</strong>: Reaching 1.0 (100%) gracefully terminates further evaluation routines.</li><li><strong>Score-Aware MetaAgent</strong>: The MetaAgent adjusts its strictness or focuses solely on edge-cases if the parent agent passes over 90% logic cleanly.</li></ul>`,19)]])}var s=r(a,[[`render`,o]]);export{i as _pageData,s as default};