<?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: Greeves89</title>
    <description>The latest articles on DEV Community by Greeves89 (@greeves89).</description>
    <link>https://dev.to/greeves89</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%2F3872430%2Ff375b50a-b113-4ea4-bed8-5f0cd51fb0ad.png</url>
      <title>DEV Community: Greeves89</title>
      <link>https://dev.to/greeves89</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/greeves89"/>
    <language>en</language>
    <item>
      <title>I built a self-hosted multi-agent AI platform – here's what I learned</title>
      <dc:creator>Greeves89</dc:creator>
      <pubDate>Fri, 10 Apr 2026 20:14:39 +0000</pubDate>
      <link>https://dev.to/greeves89/i-built-a-self-hosted-multi-agent-ai-platform-heres-what-i-learned-4a2p</link>
      <guid>https://dev.to/greeves89/i-built-a-self-hosted-multi-agent-ai-platform-heres-what-i-learned-4a2p</guid>
      <description>&lt;p&gt;Most AI agent platforms give you one assistant with access to everything. Your files, your APIs, your calendar – all in one process, no isolation, no guardrails. That bothered me enough to build something different.&lt;/p&gt;

&lt;p&gt;I'm an AI consultant and I've been running my own agentic setup for a while. This week I made it public: &lt;strong&gt;AI-Employee&lt;/strong&gt;, a self-hosted platform for running teams of specialized AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;p&gt;Instead of one mega-agent, you run a team. Each member has a specific role – Legal Assistant, Tax Advisor, DevOps Engineer, Marketing Manager. Each runs in its own Docker container. They have their own memory, their own workspace, their own tools, and their own rules.&lt;/p&gt;

&lt;p&gt;They can collaborate. They can hold meetings. They can ask you for approval before doing something sensitive. And they do all of this on your hardware, with your data never leaving your server.&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser / Mobile
       |
  Caddy / Traefik (TLS)
       |
  Orchestrator (FastAPI + Docker SDK + WebSocket)
  /         |           \             \
Redis    Postgres    Embedding      Agent Pool
PubSub   pgvector    (bge-m3)      (Docker)
                                       |
                              Each agent container:
                              - Claude Code CLI runtime
                              - Own workspace + memory
                              - MCP server connections
                              - Optional Telegram bot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Stack:&lt;/strong&gt; FastAPI + Next.js 14 + PostgreSQL + pgvector + Redis + Claude Code CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes it interesting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  True container isolation
&lt;/h3&gt;

&lt;p&gt;Each agent = its own Docker container. Not a shared process with a prompt that says "please don't touch the other agent's files." Actual isolation. The orchestrator manages the lifecycle via Docker SDK – agents start on demand, go idle after configurable timeout, restart on incoming work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approval rules in plain language
&lt;/h3&gt;

&lt;p&gt;Define governance rules like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"Ask before spending more than €50"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Confirm before emailing external clients"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Never delete files without approval"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agents enforce these automatically at runtime via the &lt;code&gt;request_approval&lt;/code&gt; MCP tool. You approve or reject via Telegram inline button. No code needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Proactive mode
&lt;/h3&gt;

&lt;p&gt;Agents don't just wait to be asked. They wake up on a schedule, check their task queue, and execute work autonomously. Your morning briefing is ready when you wake up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Meeting rooms
&lt;/h3&gt;

&lt;p&gt;Put 3–4 agents in a room with a topic and they debate, challenge each other's reasoning, and reach a decision. Useful for architecture reviews, legal-vs-marketing tradeoffs, or anything where you want a second (or third) opinion before acting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-improvement loop
&lt;/h3&gt;

&lt;p&gt;After every task, agents reflect on what worked. You rate completed tasks via Telegram (⭐1–5). Bad ratings feed into a background &lt;code&gt;ImprovementEngine&lt;/code&gt; that periodically analyzes performance, classifies agents (excellent/good/improving/declining), and sends you a notification when status changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local embeddings
&lt;/h3&gt;

&lt;p&gt;Uses BAAI/bge-m3 – 1024-dim, multilingual, runs entirely on your server. No OpenAI embedding API calls, no per-token costs, no data leaving your infrastructure. The shared knowledge base uses Obsidian-style &lt;code&gt;[[backlinks]]&lt;/code&gt; and &lt;code&gt;#tags&lt;/code&gt; and is readable/writable by all agents.&lt;/p&gt;

&lt;h3&gt;
  
  
  MCP-native
&lt;/h3&gt;

&lt;p&gt;Ships with 5 built-in MCP servers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mcp-memory&lt;/code&gt; – semantic long-term memory per agent&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mcp-knowledge&lt;/code&gt; – shared knowledge base&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mcp-notifications&lt;/code&gt; – Telegram messages, approval requests&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mcp-orchestrator&lt;/code&gt; – spawn agents, create tasks, team communication&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mcp-skills&lt;/code&gt; – reusable capability modules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any third-party MCP server plugs in out of the box.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned building this
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Container lifecycle is tricky.&lt;/strong&gt; Managing "start on demand, stop when idle" sounds simple until you're dealing with mid-task interruptions, race conditions on the task queue, and WebSocket reconnects. The solution was a proper state machine in the orchestrator with Redis pub/sub for events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local embeddings are worth it.&lt;/strong&gt; The initial setup of bge-m3 adds complexity, but never having to worry about embedding API costs or rate limits is completely worth it. Multilingual support is a bonus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approval workflows change agent behavior.&lt;/strong&gt; Once agents know they'll be asked before sensitive actions, the whole dynamic changes. Agents become more conservative and explicit about what they're about to do, which is exactly what you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Self-improvement is hard to measure.&lt;/strong&gt; The ImprovementEngine is the most experimental part. I'm still tuning what "good" looks like per agent type.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Better credential management (vault integrations)&lt;/li&gt;
&lt;li&gt;Stronger sandbox isolation per agent&lt;/li&gt;
&lt;li&gt;More pre-built integrations (Paperless-ngx, *arr stack, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/greeves89/AI-Employee.git
&lt;span class="nb"&gt;cd &lt;/span&gt;AI-Employee
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.community.example .env
&lt;span class="c"&gt;# Add your Claude token or Anthropic API key to .env&lt;/span&gt;
docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; docker-compose.community.yml up &lt;span class="nt"&gt;-d&lt;/span&gt;
open http://localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;License:&lt;/strong&gt; Fair-Code – free for internal use. Commercial license only if you resell as SaaS.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/greeves89/AI-Employee" rel="noopener noreferrer"&gt;github.com/greeves89/AI-Employee&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Would love feedback – especially from folks who run self-hosted infrastructure and know where the pain points actually are.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tv3x3la9xtkv5g8wfjj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tv3x3la9xtkv5g8wfjj.png" alt="AI-Employee Dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>selfhosted</category>
      <category>docker</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
