Skip to content

Repository files navigation

AgentMesh

Self-hosted visual multi-agent AI pipelines — MCP-native, bring your own keys, monitor everything in real-time.

PythonNext.jsFastAPILicense: MIT


Build multi-agent AI pipelines visually, run them against any MCP server, and watch every decision, tool call, and handoff happen in real-time — on infrastructure you own.


What makes it different

CapabilityAgentMeshLangSmithGumloopn8n
Visual pipeline builder
Real-time agent monitoring
MCP-native (any MCP server)
Self-hosted / open-source
Per-user encrypted key storage
Free to use⚠️

Quick start

Prerequisites

  • Python 3.11+, Node.js 20+
  • PostgreSQL (Neon free tier works)
  • uv: pip install uv

1. Clone and configure

git clone https://github.com/yourusername/agentmesh.git
cd agentmesh

There are two separate env files — one for each process:

Backend — create .env at the repo root:

cp .env.example .env
# Fill in the backend block

Frontend — create frontend/.env.local:

# Copy just the frontend block from .env.example

See .env.example — it's annotated with every variable, what it does, and how to generate it. Minimum required:

VariableFileHow to get it
GEMINI_API_KEY.envaistudio.google.com
DATABASE_CONN.envYour PostgreSQL connection string
ENCRYPTION_KEY.envpython -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
AUTH_SECRETfrontend/.env.localopenssl rand -base64 32
GOOGLE_CLIENT_ID/SECRETfrontend/.env.localGoogle Cloud Console → OAuth 2.0
NEXTAUTH_URLfrontend/.env.localhttp://localhost:3000 for local dev
FASTAPI_URLfrontend/.env.localhttp://localhost:8000 for local dev

2. Install dependencies and migrate

uv sync
uv run alembic upgrade head
cd frontend && npm install

3. Start everything

# Activate the virtual environment firstsource .venv/Scripts/activate # Windows (bash)source .venv/bin/activate # macOS / Linux
make dev
URLWhat you get
http://localhost:3000Landing page
http://localhost:3000/dashboardPipeline builder + Mission Control
http://localhost:3000/settingsAPI keys + MCP server config
http://localhost:8000/docsFastAPI interactive docs

Building your first pipeline

  1. Open /dashboard — make sure you're in Build mode
  2. Drag nodes from the left palette onto the canvas
  3. Connect them by drawing edges between node handles
  4. Configure each node in the right inspector (model, system prompt, temperature)
  5. Click Validate to check for DAG errors
  6. Click Run pipeline, enter a task, and watch Mission Control

Node types

NodePurpose
InputPipeline entry point
LLM AgentAI reasoning agent — model, system prompt, temperature
ToolCalls a registered MCP server tool
RouterConditional branch based on agent output
MemoryContext / vector store pass-through
TransformJSON parse, extract, format
ParallelFan-out to multiple agents simultaneously
OutputCollects final result

Pre-built templates

Click Templates in the pipeline header to load:

  • Research Synthesis — search → extract → analyze → write
  • GitHub Code Review — fetch branch → review → security scan → summary (requires GITHUB_TOKEN)

Architecture

agentmesh/
├── backend/
│ ├── agents/ # Agent base class, registry
│ ├── api/
│ │ ├── routes.py # All FastAPI endpoints + app factory
│ │ ├── websocket.py # WebSocket event handler
│ │ └── keys.py # API key CRUD
│ ├── crypto.py # Fernet AES-256 per-user key encryption
│ ├── db/ # SQLAlchemy async + Alembic migrations
│ ├── events/ # EventBus: 100-event circular buffer, WS broadcast
│ ├── llm/ # Direct and OpenAI-compatible providers + model router
│ ├── mcp/ # FastMCP client wrapper + MCPRegistry
│ ├── orchestrator/ # WorkflowOrchestrator: sequential + parallel execution
│ └── pipelines/ # DAG validator, pipeline→workflow converter, templates
├── frontend/
│ ├── app/ # Next.js App Router: landing, dashboard, settings, auth
│ ├── components/
│ │ ├── dashboard/ # DashboardLayout, AgentSidebar, MessageStream, ToolCallInspector
│ │ ├── pipeline/ # PipelineCanvas (React Flow), NodePalette, NodeConfigInspector
│ │ └── ui/ # Primitive components
│ ├── hooks/ # useAgentMeshEvents, useWebSocket (auto-reconnect)
│ ├── stores/ # Zustand: pipelineStore, eventStore
│ └── types/ # TypeScript: nodes, edges, events
└── tests/ # pytest: orchestrator, routing, validator, MCP registry

Request flow

Browser → Next.js BFF proxy → FastAPI → WorkflowOrchestrator
│
┌───────────────┼───────────────┐
Agent 1 Agent 2 Agent N
└───────────────┴───────────────┘
│
EventBus (WebSocket)
│
useAgentMeshEvents
│
┌─────────────────────┼─────────────────────┐
AgentSidebar MessageStream ToolCallInspector

Deployment

Render + Neon + Vercel (free tier)

Backend on Render

  • Build command: uv sync && uv run alembic upgrade head
  • Start command: .venv/bin/uvicorn backend.api.routes:app --host 0.0.0.0 --port $PORT
  • Add all backend env vars in the Render dashboard

Frontend on Vercel

  • Root directory: frontend
  • Add frontend env vars; set FASTAPI_URL to your Render service URL

Database:Neon free PostgreSQL — paste the connection string into DATABASE_CONN.

Render's free tier spins down after 15 min of inactivity. Use UptimeRobot to keep it warm for demos.

Railway

npm i -g @railway/cli
railway login && railway init
railway up

Add a PostgreSQL plugin from the Railway dashboard and set env vars via railway variables set KEY=value.

Self-hosted (Docker Compose)

cp .env.example .env # fill in values
docker-compose up -d

Minimum spec: 1 vCPU / 1 GB RAM. Add Nginx + Let's Encrypt for HTTPS.


Tech stack

LayerTechnology
BackendFastAPI + uvicorn
OrchestrationCustom WorkflowOrchestrator state machine
MCPFastMCP (stdio + HTTP)
LLM providersGemini, Groq, OpenAI, xAI, DeepSeek, OpenRouter, Mistral, Together, and Cerebras via MultiProvider
Real-timeWebSocket + EventBus (100-event circular buffer)
DatabasePostgreSQL + SQLAlchemy async + Alembic
EncryptionFernet (AES-256)
AuthNextAuth v5 + Google OAuth
FrontendNext.js 15 (App Router) + React 19
Canvas@xyflow/react (React Flow)
StateZustand 5
StylingTailwind CSS v4
Testingpytest + pytest-asyncio

Contributing

See CONTRIBUTING.md for dev setup, project conventions, and how to open a pull request.


License

MIT — use it, fork it, build on it.

About

AgentMesh is a visual pipeline builder built on LangGraph + MCP — mix Gemini, OpenAI, and Groq agents per node, and watch execution happen live via real-time event streaming.

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages