Inspiration

We are living in the era of "Copilots," but most AI coding tools are just glorified autocomplete. They don't understand the system, they don't test their own code, and worst of all—they don't know you. They output generic, textbook code that clashes with your project's unique architecture.

We asked: "What if instead of a chatbot, you had a full software engineering team?" A team that remembers your preferred syntax, autonomously runs tests in a sandbox, and argues with each other until the code is perfect. That is why we built MirrorFlow.

What it does

MirrorFlow is not a text editor; it is an Autonomous Agentic Tribunal. It takes broken code and passes it through a "Council" of four specialized AI agents who work in a loop until the problem is solved:

  1. The Architect (Orchestrator): Analyzes the request and manages the workflow. It uses RAG (Vector Memory) to recall your specific coding style ("User prefers functional patterns over OOP"), ensuring the fix feels like you wrote it.
  2. The Surgeon (Developer): The only agent allowed to write code. It implements the fix based on the Architect's strategy.
  3. The Inquisitor (QA & Tester): The "Adversarial Agent." It spins up a Docker Container, executes the Surgeon's code, and throws malicious inputs at it. If the code breaks, it rejects the fix and forces the Surgeon to try again.
  4. The Optimizer: Once the code passes, this agent refactors it for Time/Space complexity ($O(n^2) \to O(n)$) and security vulnerabilities before delivering the final file.

How we built it

We prioritized a Free & Open Source tech stack to ensure accessibility:

  • Brains: We used Groq API (Llama 3) for near-instant inference speeds, allowing the agents to "converse" in real-time without lag.
  • Orchestration: Built on LangGraph to manage the stateful workflow and cyclic loops between agents.
  • Memory: ChromaDB serves as the Council's long-term memory, storing embeddings of the user's previous codebases to enable "Style Transfer."
  • Sandbox: A custom Docker implementation allows the Inquisitor to execute untrusted AI-generated code safely.
  • Frontend: A futuristic "Command Center" UI built with Next.js, Tailwind CSS, and Framer Motion to visualize the agents' debate live.

Challenges we ran into

  • The Infinite Loop of Death: Early on, the "Inquisitor" was too strict, rejecting every fix the "Surgeon" made, causing them to argue forever. We had to implement a "Retry Limit" and a "Hint System" where the Inquisitor explains why the test failed.
  • Hallucinated APIs: The AI kept inventing libraries that didn't exist. We solved this by grounding the Surgeon with a "Librarian" tool that checks PyPI/npm before importing.

Accomplishments that we're proud of

  • Achieving true "Style Transfer." Seeing the AI autonomously choose to write a list comprehension instead of a for loop just because it saw that in my previous projects was a magic moment.
  • Building a fully functional Code Execution Sandbox that protects the host machine from AI errors.

What's next for MirrorFlow

  • The "Jury" Feature: Allowing users to bring in their own custom agents (e.g., a "Security Specialist" or "UI Designer") to the Council.
  • IDE Extension: Porting the Tribunal directly into VS Code.

Built With

Share this project:

Updates