DEV Community

PSP
PSP

Posted on

MergeMind: Turning Engineering Requests into Reviewable AI Workflows with Switch

Building a five-agent engineering workflow for the Flip the Switch Hackathon 2026.

The problem with a single coding agent

AI coding agents are becoming increasingly capable. They can investigate repositories, write code, suggest fixes and review changes.

But engineering work is not simply about generating code.

A real engineering request needs planning, research, implementation, independent review and a decision from someone accountable for the result.

When one agent performs every step, it can end up reviewing its own assumptions. Context gets copied between tools, handoffs become difficult to track, and generated code can look more reliable than it actually is.

I wanted to explore a different approach: what if engineering work could be handled by a team of specialist agents, with people able to follow and review every stage?

That became MergeMind.

Introducing MergeMind

MergeMind is a multi-agent engineering workflow built around Switch.

It transforms an engineering change request into a reviewable work package using five specialist roles.

The objective is not to replace engineers or automatically merge generated code. It is to make delegation, evidence gathering and review more structured.

The five-agent architecture

  1. Coordinator

The Coordinator receives the engineering request and owns the workflow. It delegates the task rather than attempting to complete every stage itself.

  1. Planner

The Planner translates the request into implementation steps, assumptions, risks and acceptance criteria.

This establishes what the implementation should achieve before code is proposed.

  1. Researcher

The Researcher investigates the supplied public GitHub repository.

It retrieves relevant source files and repository metadata using read-only access, providing evidence for the subsequent implementation.

  1. Implementer

The Implementer uses the plan and repository evidence to generate a unified diff.

It does not modify the actual target repository.

The proposed change is checked in a disposable workspace for patch applicability and safety.

  1. Reviewer

The Reviewer independently examines the proposed change.

It looks for correctness issues, security concerns, scope deviations and missing tests.

The workflow then presents the result to a human for approval or rejection.

Why Switch is central

The interesting part of MergeMind is not simply having five AI roles.

It is how those roles coordinate.

Switch provides the collaboration infrastructure. Each role is designed to have its own agent identity and participate in a shared room.

The implementation uses Switch's authenticated agent protocol:

WebSocket connections for receiving room events.

HTTP operations for agent actions and targeted messages.

Addressed handoffs between specialist roles.

Persistent connection identity and event cursors for reconnection.

This separates agent execution from collaboration.

The dashboard provides task intake and review, while Switch provides the shared communication layer.

The live five-agent integration still requires its final end-to-end demonstration; the implementation and protocol client should not be confused with a verified live run.

Architecture and technology

MergeMind uses:

Python and FastAPI for the backend.

SQLite for local workflow persistence.

Switch's WebSocket and HTTP agent protocol.

GitHub REST API for public repository research.

OpenAI-compatible model endpoints, with local Ollama support.

HTML, CSS and JavaScript for the dashboard.

Docker-based patch validation.

The architecture is intentionally conservative about repository access and automated changes.

Safety and human approval

A major design decision was to avoid silently changing someone's repository.

MergeMind currently:

Reads public GitHub repositories without writing to them.

Validates proposed patch paths.

Checks patch applicability in a disposable clone.

Does not execute the target repository's complete test suite.

Does not automatically commit, push, merge or deploy changes.

Requires human review and records the approval decision.

This makes the proposed change an inspectable artifact rather than an automatic production modification.

Reproducing the project

The public repository is:

https://github.com/PSP-YN/MergeMind

Clone it and run:

git clone https://github.com/PSP-YN/MergeMind.git
cd MergeMind
bash scripts/setup.sh

Configure an OpenAI-compatible model endpoint or start a local Ollama model, then run:

bash scripts/run.sh

Open the dashboard at:

http://127.0.0.1:8000

To connect Switch, configure the agent bridge URL, registration key and room ID in the dashboard, register the five roles, and invite them into the same room.

What I learned

Building MergeMind reinforced an important distinction: an AI workflow is not reliable simply because several agents can generate outputs.

The coordination layer, clear role boundaries, persisted state, evidence and human decision process matter just as much.

Switch provides an interesting foundation for building these systems because agents can participate in a shared collaboration environment rather than remaining isolated inside individual terminals.

What's next

The next milestone is completing and recording the live five-agent workflow, validating the connection and handoff sequence against a real Switch room, and making the application accessible through a public deployment.

The longer-term direction is to make MergeMind useful for engineering teams that want structured AI-assisted development without giving autonomous agents unrestricted control over their repositories.

Project: MergeMind
Repository: https://github.com/PSP-YN/MergeMind
Hackathon: Flip the Switch 2026
Track: Best Business Workflow

Built with Switch, Python, FastAPI and local AI tooling.

Top comments (0)