spinabot/brigade
A self-hosted WebSocket gateway for agent teams with persistent memory
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Brigade is a TypeScript application packaged as @spinabot/brigade. The brigade CLI can run the long-lived WebSocket gateway on port 7777 or attach a thin client. Terminal and messaging inputs share a routing pipeline that resolves each message to an agent and session. The gateway assembles the prompt from persona, skills, and org context, streams model output, checks tool calls against approval and ownership rules, and persists the transcript. Work stays with the gateway when clients disconnect.
The package includes @earendil-works/pi-agent-core, @earendil-works/pi-ai, and @earendil-works/pi-tui, alongside channel libraries such as grammy, discord.js, and @whiskeysockets/baileys. The default filesystem layout keeps configuration, agent workspaces, JSONL sessions, memory, and cron state under ~/.brigade/; self-hosted Convex is optional. Extensibility comes through SKILL.md discovery, a typed channel-adapter contract, and MCP connections. The memory export exposed by brigade mcp uses stdio, not the gateway's WebSocket client protocol.
Key Capabilities & Differentiators
Tideline stores facts in facts.jsonl in filesystem mode. It scopes recall by origin, deduplicates writes, applies three tiers of decay, and checks provenance before allowing changes to identity or preferences. Retrieval combines BM25 with a model-free vector lane and a typed link graph; nightly consolidation maintains long-lived memory. Org rules govern agent-to-agent messaging. Parallel delegation has depth and child-count limits, cancellation cascades to children, and the parent is notified when they settle.
Brigade supports hosted providers such as Anthropic, OpenAI, Gemini, and OpenRouter, plus Ollama and OpenAI-compatible endpoints. Carrow keeps the transcript in the same session, strips provider-specific reasoning blocks as needed, and adjusts reasoning settings for the target model. A mid-turn switch aborts the current run and replays the last message; it does not transfer an in-flight generation. The crew is reachable through Slack, Telegram, WhatsApp, Discord, iMessage, and BlueBubbles, with text-only iMessage via imsg. Document tools analyze attachments and create or edit Word, Excel, PowerPoint, and PDF files; analysis provider choice matters for data handling.
Trade-offs & Limitations
Compared with a standalone model CLI, Brigade trades a simpler local process for a crew that can keep running, share persistent memory under origin rules, and accept work from multiple channels. Compared with a hosted workspace, it puts gateway and storage operations under your control, but leaves you responsible for channel credentials, backups, approvals, and access policy. Self-hosting is not the same as keeping all data local: hosted models, media analysis, messaging adapters, and Composio can send workflow data outside the host.
Switching providers makes it easier to choose a model per task, but replay after an interrupted turn should not be treated as a rollback of external tool actions. For workflows that write to third-party apps, confirm how retries are handled before enabling unattended runs. Origin scoping and org rules help contain context and communication, but do not establish OS-level sandboxing. Keep the gateway private by default, restrict shell approvals and connector scopes, and treat public tunneling as a change to the deployment's security boundary.
Hardware & Deployment Guide
Run it on Node.js 22.12 or newer. Install with npm i -g @spinabot/brigade, run brigade onboard to choose storage and a model provider, then open brigade tui, which starts the gateway if needed. Use brigade gateway run for a dedicated foreground process or brigade gateway install for launchd, systemd, or Windows Task Scheduler. The filesystem path requires no separate database. If you choose self-hosted Convex, plan for database operation and recovery; in either mode, test restoration of local configuration and workspaces.
For hosted inference, size the gateway for Node.js, enabled channels, document processing, and scheduled work rather than GPU inference. With Ollama, size inference separately for the chosen model and concurrency. To operate offline, pair local inference and storage with workflows that do not use web search, external connectors, or hosted messaging. Version 1.39.0 added durable collaboration mode; 1.39.1 made subscription sign-in failures more specific; 1.39.2 added trust for OS root certificates, relevant on networks that inspect HTTPS.
Individuals or small teams that want a persistent agent crew across terminal and messaging channels, with control over where the gateway and state run.
You only need interactive chat, want zero infrastructure maintenance, or need independently verified OS-level isolation before running privileged tools.
Quick Start & Installation
# macOS / Linux — installs Node if needed, then Brigade (no sudo) curl -fsSL https://brigade.spinabot.com/install.sh | sh brigade
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| brigade ★ | 11.4k | — | TypeScript | MIT | A self-hosted WebSocket gateway for agent teams with persistent memory |
| hermes-agent | 268.1k | +1.5k | Python | MIT | Self-hosted Python agent with persistent memory and automation across chat and C |
| AstrBot | 47.9k | +298 | Python | AGPL-3.0 | A self-hosted Python agent hub that connects chat platforms to model providers |
| CowAgent | 48.2k | +116 | Python | MIT | Self-hosted agent harness for running and remembering work across chat channels |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/spinabot/brigade.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about brigade
How do I connect another terminal or an MCP client?
brigade connect with --host and --port to attach a thin terminal client to an existing gateway. Use brigade mcp when an MCP client needs access to Brigade memory over stdio; --agent selects the agent. These are different interfaces: WebSocket connects a client to the running crew, while the stdio endpoint serves memory.Do I need a GPU, and what should I size for?
Can I use Brigade commercially and self-host it for compliance?
When is Brigade a better fit than a model CLI or hosted agent workspace?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy