<?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: Ningxi Yang</title>
    <description>The latest articles on DEV Community by Ningxi Yang (@ningxi_yang_3095ccbc94644).</description>
    <link>https://dev.to/ningxi_yang_3095ccbc94644</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3891751%2F7123defc-62fe-43ad-b9da-9cfed9aec5c6.png</url>
      <title>DEV Community: Ningxi Yang</title>
      <link>https://dev.to/ningxi_yang_3095ccbc94644</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ningxi_yang_3095ccbc94644"/>
    <language>en</language>
    <item>
      <title>Building a Multi-Agent AI Dating Advisor with Claude, Next.js, and CI/CD</title>
      <dc:creator>Ningxi Yang</dc:creator>
      <pubDate>Wed, 22 Apr 2026 05:24:55 +0000</pubDate>
      <link>https://dev.to/ningxi_yang_3095ccbc94644/building-a-multi-agent-ai-dating-advisor-with-claude-nextjs-and-cicd-n05</link>
      <guid>https://dev.to/ningxi_yang_3095ccbc94644/building-a-multi-agent-ai-dating-advisor-with-claude-nextjs-and-cicd-n05</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this project, I built a production-style AI application that provides relationship advice using a multi-agent system. Instead of relying on a single LLM response, the system simulates three distinct “advisors” with different perspectives, then aggregates their opinions into a final recommendation.&lt;/p&gt;

&lt;p&gt;The goal was not just to build an AI app, but to explore a full modern development workflow including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agent orchestration&lt;/li&gt;
&lt;li&gt;Persistent memory&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;CI/CD pipelines&lt;/li&gt;
&lt;li&gt;Security considerations&lt;/li&gt;
&lt;li&gt;AI-assisted development using Claude Code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Live app: &lt;a href="https://cs-7180-project3.vercel.app/" rel="noopener noreferrer"&gt;https://cs-7180-project3.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Repo: &lt;a href="https://github.com/NingxiY/CS7180_project3.git" rel="noopener noreferrer"&gt;https://github.com/NingxiY/CS7180_project3.git&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  System Overview
&lt;/h2&gt;

&lt;p&gt;The application allows users to describe a personal situation. The system then generates advice from three different agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cosmic Reader&lt;/strong&gt; — symbolic / abstract interpretation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavior Analyst&lt;/strong&gt; — pattern-based reasoning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Experienced Advisor&lt;/strong&gt; — practical human advice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These outputs are then passed to a &lt;strong&gt;judge agent&lt;/strong&gt;, which synthesizes them into a final answer.&lt;/p&gt;

&lt;p&gt;This design improves reliability by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reducing single-model bias&lt;/li&gt;
&lt;li&gt;Encouraging diverse reasoning&lt;/li&gt;
&lt;li&gt;Producing more structured outputs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;The system is implemented using a modern full-stack architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend &amp;amp; API:&lt;/strong&gt; Next.js (App Router)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication:&lt;/strong&gt; Clerk&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; Neon (PostgreSQL)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deployment:&lt;/strong&gt; Vercel&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD:&lt;/strong&gt; GitHub Actions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key Components
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. Agent Orchestrator
&lt;/h3&gt;

&lt;p&gt;A central orchestrator coordinates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parallel agent execution&lt;/li&gt;
&lt;li&gt;Response normalization&lt;/li&gt;
&lt;li&gt;Final aggregation via judge agent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each agent returns structured output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ADVICE:
REASONING:
CONFIDENCE:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Persistent Memory
&lt;/h3&gt;

&lt;p&gt;User interactions are stored in a database and reused in future sessions.&lt;/p&gt;

&lt;p&gt;For each user:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Past sessions are saved&lt;/li&gt;
&lt;li&gt;Agent-specific memory is retrieved&lt;/li&gt;
&lt;li&gt;Context is injected into future prompts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows the system to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain continuity&lt;/li&gt;
&lt;li&gt;Improve personalization&lt;/li&gt;
&lt;li&gt;Avoid repeated generic responses&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Authentication
&lt;/h3&gt;

&lt;p&gt;Authentication is handled using Clerk.&lt;/p&gt;

&lt;p&gt;Key design decision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All API routes validate identity using &lt;code&gt;auth()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;User identity is derived from the session, not request payload&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This avoids:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identity spoofing&lt;/li&gt;
&lt;li&gt;Trusting client-side input&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  AI Development Workflow (Claude Code)
&lt;/h2&gt;

&lt;p&gt;A major part of this project was using &lt;strong&gt;Claude Code as a development partner&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Skills
&lt;/h3&gt;

&lt;p&gt;Custom skills were used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate structured prompts&lt;/li&gt;
&lt;li&gt;Improve agent consistency&lt;/li&gt;
&lt;li&gt;Maintain response schemas&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hooks
&lt;/h3&gt;

&lt;p&gt;Automated hooks were configured to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect code changes&lt;/li&gt;
&lt;li&gt;Suggest testing and build checks&lt;/li&gt;
&lt;li&gt;Trigger documentation reminders&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  AI PR Review
&lt;/h3&gt;

&lt;p&gt;Each pull request included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI-generated summaries&lt;/li&gt;
&lt;li&gt;Structured change descriptions&lt;/li&gt;
&lt;li&gt;Testing and risk analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This significantly improved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Development speed&lt;/li&gt;
&lt;li&gt;Code clarity&lt;/li&gt;
&lt;li&gt;Documentation quality&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  CI/CD Pipeline
&lt;/h2&gt;

&lt;p&gt;A GitHub Actions pipeline was implemented with the following stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install dependencies&lt;/li&gt;
&lt;li&gt;Unit and integration tests&lt;/li&gt;
&lt;li&gt;Coverage reporting&lt;/li&gt;
&lt;li&gt;Build verification&lt;/li&gt;
&lt;li&gt;Playwright E2E tests&lt;/li&gt;
&lt;li&gt;Security audit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every commit is validated&lt;/li&gt;
&lt;li&gt;The app builds correctly&lt;/li&gt;
&lt;li&gt;Core flows remain functional&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Security Considerations
&lt;/h2&gt;

&lt;p&gt;A lightweight security review was conducted using a custom agent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Findings
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Authentication is enforced in API routes&lt;/li&gt;
&lt;li&gt;SQL queries use parameterized queries (no injection risk)&lt;/li&gt;
&lt;li&gt;No server secrets exposed to frontend&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;However:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No rate limiting on API endpoints&lt;/li&gt;
&lt;li&gt;User ID originally trusted from request payload&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npm audit&lt;/code&gt; does not fail CI&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Improvements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Derive user identity from Clerk session&lt;/li&gt;
&lt;li&gt;Add per-user rate limiting&lt;/li&gt;
&lt;li&gt;Enforce middleware protection for API routes&lt;/li&gt;
&lt;li&gt;Strengthen CI security gates&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. CI/CD Issues
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lockfile mismatch caused install failures&lt;/li&gt;
&lt;li&gt;Environment variables missing in CI&lt;/li&gt;
&lt;li&gt;Next.js build failed due to missing Clerk keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These were resolved by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Synchronizing package-lock.json&lt;/li&gt;
&lt;li&gt;Adding GitHub secrets&lt;/li&gt;
&lt;li&gt;Adjusting dependency install strategy&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Async Execution Bugs
&lt;/h3&gt;

&lt;p&gt;A recurring issue was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RuntimeError: event loop is closed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fix:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensured safe async invocation&lt;/li&gt;
&lt;li&gt;Avoided reusing closed loops&lt;/li&gt;
&lt;li&gt;Added safeguards for repeated agent calls&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Multi-Agent Prompt Design
&lt;/h3&gt;

&lt;p&gt;Ensuring consistent output required:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strict formatting instructions&lt;/li&gt;
&lt;li&gt;Explicit labels (ADVICE, REASONING, etc.)&lt;/li&gt;
&lt;li&gt;Controlled variability between agents&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;This project changed how I think about software development.&lt;/p&gt;

&lt;p&gt;Instead of writing everything manually, I worked with AI as a collaborator:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generating code&lt;/li&gt;
&lt;li&gt;Debugging issues&lt;/li&gt;
&lt;li&gt;Structuring systems&lt;/li&gt;
&lt;li&gt;Writing documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, AI is not a replacement for understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most debugging still required reasoning&lt;/li&gt;
&lt;li&gt;System design decisions remained critical&lt;/li&gt;
&lt;li&gt;Misconfigurations (CI, env variables) required manual fixes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most important takeaway:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AI accelerates development, but engineering judgment still matters.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This project demonstrates that combining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-agent AI design&lt;/li&gt;
&lt;li&gt;Modern web frameworks&lt;/li&gt;
&lt;li&gt;CI/CD practices&lt;/li&gt;
&lt;li&gt;AI-assisted development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;can produce a robust, production-style application.&lt;/p&gt;

&lt;p&gt;It also highlights a new development paradigm:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Building software is no longer just coding — it is orchestrating systems, tools, and AI.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Live app: (your Vercel URL)&lt;/li&gt;
&lt;li&gt;Repository: (your GitHub link)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;If I had more time, I would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve memory retrieval strategies&lt;/li&gt;
&lt;li&gt;Add rate limiting and abuse protection&lt;/li&gt;
&lt;li&gt;Experiment with more specialized agents&lt;/li&gt;
&lt;li&gt;Explore real-world deployment constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But even in its current form, this system demonstrates a strong foundation for AI-powered applications.&lt;/p&gt;




</description>
      <category>agents</category>
      <category>ai</category>
      <category>nextjs</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
