Team Mustang v1.0

It’s already been two months since I started rebuilding my personal AI team. Things finally feel like they’ve settled into a fairly stable shape, so I’m going to be bold(?) and call the current setup v1.0 and write down what it looks like.

First, an introduction to the team as it stands today: one human and nine agents.

  • Kirin (me): Owner & CTO. Makes the final call on every blocking issue and scope change… or so Roy defined me.
  • Roy: AR (Agent Resource) & IT. Manages the agents, builds and maintains the shared tools
  • Breda: Turns all kinds of program development requests into concrete specs and builds them
  • Hawkeye: Writes and verifies success criteria for programs. I set up this role back when Planner / Generator / Evaluator multi-agent setups were all the rage. These days it’s basically closed for business.
  • Lina: Finance. I’ve been having Lina analyze data from the convenience store my younger brother runs, and also sort out our household budget. Fun fact: currently the only universe-breaker on the team. (Huh?)
  • Falman: SNS publishing helper
  • Envy: Multimedia Designer (Claude)
  • Armstrong: Multimedia Designer (Codex)
  • Fuery: Customer Support. An agent I set up ahead of an app launch, but also closed for business for now
  • Lust: Currently the only Discord agent. Supposed to be a personal notes assistant, but I mostly use it as a recipe assistant.

Core design principles

I laid out some core design principles in the post I wrote when I started rebuilding the team, but as the system took shape, more principles naturally emerged. Here’s where they stand today.

  1. Like a real organization – Just as people don’t work by staring at a messenger all day, each agent has its own work queue and reaches out only when needed. The issue tracker is the core medium.
  2. Need-to-know, routed by assignee – Agents only get notifications for work assigned to them. If you need someone to respond, you change the assignee to them. Mentions are for reference only. Humans and agents follow the same rule.
  3. Dooray is always the source of truth – A notification is just a signal to “wake up” an agent. Every time an agent gets one, it re-reads the Dooray issue tracker to figure out what to do. In exchange for getting the same result even when notifications are duplicated or resent, I accept wasting some tokens.
  4. Always-on reference docs live in the Obsidian Vault – Documents that need to be referenced all the time, like the constitution or the handbook, go in the Obsidian Vault.
  5. Multi-model by design – Aim for a setup that doesn’t depend on Claude alone.
  6. Minimal exposure – Assume the whole thing runs on a single Mac mini. The only thing open to the internet is one webhook path; everything else is reachable only inside the Tailscale VPN.
  7. No large files attached to tasks – Dooray has a cap on the total size of attachments you can upload. Images and videos in particular are big, so you have to be careful. Instead, agent outputs can be opened remotely inside the Tailscale VPN.

At first, there were only principles 1 through 5. I set up a web server called mustang-hub and used it to receive webhooks. At the same time, I opened a local-only WebSocket, and had the Claude CLI connect to it through its monitor feature to pick up its own events from mustang-hub. Running it this way, I noticed webhook events occasionally didn’t reach the agents. The reasons varied: temporary network failures, a web server or CLI restart, and so on. So I added a feature for mustang-hub to periodically poll Dooray for live tasks. Even so, failures happen. Sometimes a brief power outage reboots the Mac mini, and sometimes Claude’s login session expires. I wanted to observe and record events like these, so I decided to add a monitoring page.

I briefly wondered whether I needed to spin up yet another web server, but concluded that mustang-hub could just serve pages like this instead of only receiving webhooks. That said, I didn’t want this page exposed to the public. That’s how principle 6 came about. At first it was just the webhook and the monitoring page, but as a stats page and a files page were added later, this principle became even more important.

Of these, the files page is tied to principle 7. The first agents I built mostly produced text or a simple chart image or two, so I never had to think about size. But once Envy, the Multimedia Designer, joined, it was a different story. Envy’s outputs could easily run to several MB or more. And Dooray’s free plan only provides 5GB of storage for the entire tenant. That’s plenty for typical use, but not enough to hold a Multimedia Designer’s outputs too. So I set principle 7, and since I needed a way to remotely access outputs that couldn’t be attached to tasks, I added the files page to mustang-hub.

Up to this point, principle 5 was honestly a dead principle. Even the only Multimedia Designer, Envy, was running on Claude CLI, at first. But while working with Envy, I learned that there are areas of image generation where Codex does better, and principle 5 finally came to life. I changed Envy to run on an event-driven headless runner instead of the Claude CLI, and added Armstrong, an agent that uses the same runner but runs on Codex instead of Claude. I named this event-driven headless runner hub-agent-runner.

Automatic restart

If I only ever worked with my agent team while sitting in front of the Mac mini, none of this would have been necessary. I could just give instructions in each terminal. The reason I built all this is that I needed an environment where I can reach the team and work with it anytime, anywhere. As I kept building, an unexpected obstacle showed up: power outages. Surprisingly, outages aren’t rare in American homes. I can live with the team shutting down during an outage, but when the power comes back, the team needed to come back up on its own without me restarting it.

First, the Mac mini has a “Start up automatically after a power failure” option. Next, I needed programs to launch automatically on restart, which I could solve with automatic login and LaunchAgents. The catch was that using those two options meant turning off FileVault. It’s not the recommended choice from a security standpoint, but this machine doesn’t hold anything particularly confidential, and for a personal machine I can live with that.

I added OrbStack, which runs the Docker images, and Tailscale, which the VPN needs, to the login items. mustang-hub, the agent CLIs, and hub-agent-runner are registered as LaunchAgents. In particular, LaunchAgents create tmux sessions and run the agent CLIs and hub-agent-runners inside them, so I can attach to those tmux sessions from a remote shell when needed. These days I can hand work back and forth almost entirely through Dooray tasks, but every once in a while there’s an exceptional case where I need to connect to the CLI directly, so that’s the back door I left open.

Skills and environment variables

The skills I give agents fall into two broad groups: skills every agent should share, and skills only a specific agent uses. For example, the skill for accessing Dooray tasks and the skill for accessing Google Workspace are shared, while the Facebook posting skill is Falman’s alone. Claude, Codex, and the like all let you define global skills and project skills, so I mapped that concept straight onto the agents. Giving each agent its own project directory solves it.

This also solves the issue of each agent needing different environment variables. When the CLI starts, I just have it load the env file defined in the project directory as environment variables. That’s where I keep things like each agent’s default model, per-agent tokens, and special options.

What’s next?

I have about three things on my mind right now, but I don’t expect to move on them quickly. The main pieces are mostly done, and I’m happy using them as they are. The first is scheduled jobs. The options would be adding a scheduler to mustang-hub, using crontab, or using a dedicated tool like Jenkins or Airflow. The simplest is crontab, but the visibility just isn’t great, you know? Nothing’s urgent, so I’m leaving it open for now. The second is agent memory. I’m using the default memory with a bit of journaling on top, but I’m not sure it’s actually doing anything meaningful. Journaling feels really worthwhile in my work sessions at the company, but here I don’t feel much benefit. My guess is that it’s because everything leans so heavily on Dooray. The last is token optimization. I’m not using tokens heavily right now, so it’s not a problem, but I think I’ll hit a wall someday. Well, that’s a worry for later.

For now, I’d rather think first about what I can do with this team.

Leave a Reply