<?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: Emmanuel Utibe Ernest</title>
    <description>The latest articles on DEV Community by Emmanuel Utibe Ernest (@emmanuel_ernest_7).</description>
    <link>https://dev.to/emmanuel_ernest_7</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%2F4017960%2F484f4449-5e3e-4567-bf5e-ef8d7df16a16.jpg</url>
      <title>DEV Community: Emmanuel Utibe Ernest</title>
      <link>https://dev.to/emmanuel_ernest_7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emmanuel_ernest_7"/>
    <language>en</language>
    <item>
      <title>How I Built a Multi-Agent AI Research Suite with Human-in-the-Loop Validation</title>
      <dc:creator>Emmanuel Utibe Ernest</dc:creator>
      <pubDate>Mon, 06 Jul 2026 15:21:39 +0000</pubDate>
      <link>https://dev.to/emmanuel_ernest_7/how-i-built-a-multi-agent-ai-research-suite-with-human-in-the-loop-validation-n49</link>
      <guid>https://dev.to/emmanuel_ernest_7/how-i-built-a-multi-agent-ai-research-suite-with-human-in-the-loop-validation-n49</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Everyone is talking about autonomous AI agents.&lt;/p&gt;

&lt;p&gt;Give an agent internet access, connect it to an LLM, and it can research topics, write reports, analyze businesses, and even execute tasks with little human intervention.&lt;/p&gt;

&lt;p&gt;It sounds impressive—until you let an autonomous agent run unattended.&lt;/p&gt;

&lt;p&gt;In practice, AI agents can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hallucinate facts&lt;/li&gt;
&lt;li&gt;collect irrelevant information&lt;/li&gt;
&lt;li&gt;collect irrelevant information&lt;/li&gt;
&lt;li&gt;misunderstand search intent&lt;/li&gt;
&lt;li&gt;waste expensive API tokens&lt;/li&gt;
&lt;li&gt;confidently produce inaccurate reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For prototypes, that might be acceptable.&lt;/p&gt;

&lt;p&gt;For production systems, it isn't.&lt;/p&gt;

&lt;p&gt;That question led me to build a project around a different philosophy:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AI should automate the work, but humans should validate the decisions that matter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of building another fully autonomous agent, I designed a multi-agent AI research system that deliberately pauses before analysis, allowing a human to review the collected research before the workflow continues.&lt;/p&gt;

&lt;p&gt;The result combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CrewAI&lt;/li&gt;
&lt;li&gt;OpenAI GPT models&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;Human-in-the-Loop validation
and follows software engineering practices inspired by real production systems rather than simple AI demos.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Not Use One Giant Prompt?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the earliest design decisions was refusing to build everything inside one prompt.&lt;/p&gt;

&lt;p&gt;Could GPT research, analyze, and write in one request?&lt;/p&gt;

&lt;p&gt;Absolutely.&lt;/p&gt;

&lt;p&gt;Should it?&lt;/p&gt;

&lt;p&gt;Probably not.&lt;/p&gt;

&lt;p&gt;Large prompts become difficult to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;debug&lt;/li&gt;
&lt;li&gt;improve&lt;/li&gt;
&lt;li&gt;test&lt;/li&gt;
&lt;li&gt;reuse&lt;/li&gt;
&lt;li&gt;scale
Instead, I separated responsibilities into independent agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Agent&lt;/strong&gt;               &lt;strong&gt;Responsibility&lt;/strong&gt;&lt;br&gt;
Researcher       Finds information from online sources&lt;br&gt;
Analyst              Evaluates findings using structured reasoning&lt;br&gt;
Writer               Produces a polished Markdown report&lt;/p&gt;

&lt;p&gt;This separation follows the Single Responsibility Principle, making each component easier to optimize independently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overall Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;User&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Research Agent&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Human Validation (HITL)&lt;br&gt;
   │&lt;br&gt;
Approve / Edit / Reject&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Analysis Agent&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Writer Agent&lt;br&gt;
   │&lt;br&gt;
   ▼&lt;br&gt;
Markdown Report&lt;/p&gt;

&lt;p&gt;Unlike many AI workflows, there is an intentional pause between research and analysis.&lt;/p&gt;

&lt;p&gt;That pause became the most important feature of the entire project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Human-in-the-Loop Gateway&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most autonomous AI demos assume the first agent always produces trustworthy output.&lt;/p&gt;

&lt;p&gt;I intentionally challenged that assumption.&lt;/p&gt;

&lt;p&gt;Instead of passing research directly into the Analyst, I configured CrewAI with:&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;human_input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When execution reaches that task:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the workflow pauses&lt;/li&gt;
&lt;li&gt;research findings appear in the terminal&lt;/li&gt;
&lt;li&gt;the user reviews them&lt;/li&gt;
&lt;li&gt;corrections can be made&lt;/li&gt;
&lt;li&gt;the pipeline resumes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That small change dramatically improves report quality.&lt;/p&gt;

&lt;p&gt;Rather than asking an LLM to fix another LLM's mistakes, the workflow allows a human reviewer to intercept problems before they propagate through downstream agents.&lt;/p&gt;

&lt;p&gt;This mirrors approval workflows commonly found in enterprise software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering Decisions That Matter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest lessons from this project was that building AI systems involves far more than prompt engineering.&lt;/p&gt;

&lt;p&gt;Several infrastructure decisions significantly improved reliability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Containerizing the application ensured the environment remained consistent across machines.&lt;/p&gt;

&lt;p&gt;One interesting challenge was supporting interactive user input inside a Docker container.&lt;/p&gt;

&lt;p&gt;Because the workflow pauses for human approval, standard container execution wasn't sufficient.&lt;/p&gt;

&lt;p&gt;The solution required enabling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stdin_open&lt;/li&gt;
&lt;li&gt;tty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;inside Docker Compose so terminal interaction remained available.&lt;/p&gt;

&lt;p&gt;Without those flags, the Human-in-the-Loop stage would fail inside the container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Actions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To keep the repository production-ready, every push automatically runs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dependency installation&lt;/li&gt;
&lt;li&gt;linting with flake8&lt;/li&gt;
&lt;li&gt;code validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although simple, continuous integration ensures basic quality checks happen before changes are merged.&lt;/p&gt;

&lt;p&gt;It also demonstrates an important engineering principle:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Automation should validate code long before deployment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Cost Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Running multiple agents means every task consumes API tokens.&lt;/p&gt;

&lt;p&gt;During development I experimented with different OpenAI models.&lt;/p&gt;

&lt;p&gt;For research workflows, switching to GPT-4o Mini reduced costs considerably while maintaining acceptable quality for most tasks.&lt;/p&gt;

&lt;p&gt;The experience reinforced an important lesson:&lt;/p&gt;

&lt;p&gt;Choosing the most expensive model isn't always the best engineering decision.&lt;/p&gt;

&lt;p&gt;Balancing quality, latency, and cost is often more valuable than maximizing raw intelligence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges I Encountered&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project wasn't without obstacles.&lt;/p&gt;

&lt;p&gt;Some of the most interesting engineering problems included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;maintaining structured outputs between agents&lt;/li&gt;
&lt;li&gt;preventing context drift&lt;/li&gt;
&lt;li&gt;handling interactive terminal sessions in Docker&lt;/li&gt;
&lt;li&gt;designing prompts that encourage reasoning instead of repetition&lt;/li&gt;
&lt;li&gt;deciding where human intervention should occur&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each challenge pushed the project beyond being a simple AI demo and closer to a realistic production workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I'd Improve Next&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I continue developing this project, I'd like to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieval-Augmented Generation (RAG) for higher-quality research&lt;/li&gt;
&lt;li&gt;persistent storage using PostgreSQL&lt;/li&gt;
&lt;li&gt;Redis task queues&lt;/li&gt;
&lt;li&gt;asynchronous agent execution&lt;/li&gt;
&lt;li&gt;observability with OpenTelemetry&lt;/li&gt;
&lt;li&gt;evaluation metrics for agent performance&lt;/li&gt;
&lt;li&gt;FastAPI endpoints for external integration&lt;/li&gt;
&lt;li&gt;Kubernetes deployment&lt;/li&gt;
&lt;li&gt;authentication and user roles&lt;/li&gt;
&lt;li&gt;report version history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These additions would move the project toward an enterprise-ready AI platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lessons Learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building this project changed how I think about AI systems.&lt;/p&gt;

&lt;p&gt;The most valuable lesson wasn't how to orchestrate multiple agents.&lt;/p&gt;

&lt;p&gt;It was learning that reliability comes from engineering, not just intelligence.&lt;/p&gt;

&lt;p&gt;Production AI systems require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;validation&lt;/li&gt;
&lt;li&gt;observability&lt;/li&gt;
&lt;li&gt;automation&lt;/li&gt;
&lt;li&gt;testing&lt;/li&gt;
&lt;li&gt;cost optimization&lt;/li&gt;
&lt;li&gt;human oversight&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Powerful language models are only one part of the solution.&lt;/p&gt;

&lt;p&gt;Good software architecture is what transforms them into dependable systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The excitement around autonomous AI agents is well deserved.&lt;/p&gt;

&lt;p&gt;But autonomy alone isn't enough.&lt;/p&gt;

&lt;p&gt;The systems that businesses trust will be those that balance automation with accountability.&lt;/p&gt;

&lt;p&gt;This project was my exploration of that idea combining specialized AI agents with Human-in-the-Loop validation to produce more reliable research while following production-inspired engineering practices.&lt;/p&gt;

&lt;p&gt;If you're interested in AI Engineering, MLOps, or multi-agent systems, I'd love to hear your thoughts.&lt;/p&gt;

&lt;p&gt;The complete source code is available on GitHub, and contributions or feedback are always welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>devops</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
