Practical Guides · knowledge base from X

Company Brain open-sourced — multiplayer Slack harness as an AI teammate

Architecture of Supermemory's open-sourced Company Brain: Cloudflare Durable Object per org, Slack event triage, confidence-based proactivity (ANSWER/INVESTIGATE/PASS + emoji), phased state machine, progressive tool disclosure, approvals, recovery. One-click Workers deploy in <5 min.

✍️ Dhravya Shah · @DhravyaShah
🔗 Read the original on X · X Article · published 26 Sep 2026
📊 1,630 likes · 4,244 bookmarks · 517k views
Summary and adaptation in English; content and results belong to the author.

Part of the manual Automation with AI agents — the complete manual

Claimed result

  • About 2 weeks after shutting down the commercial "company brain," Supermemory open-sourced the full harness: repo github.com/supermemoryai/company-brain, one-click Cloudflare Workers deploy, setup <5 minutes, user-owned data.
  • Why the product shut down: focus on building the world's best memory system (separate blog); customers moved elsewhere, then asked for open source.
  • Engineering: mainly @maheshthedev on Cloudflare Agents SDK (@threepointone); months of work condensed into architecture decisions + diagrams — not "AI slop."
  • Extra: org custom-emoji resolver github.com/supermemoryai/emoji-resolve.

Proof: medium-high. Verifiable artifact (repo + deploy); very high engagement (4.2k bookmarks). Not a P&L — a documented production-grade harness.

The key idea

A model can classify, call tools, write fluently. It does not inherently know: whether it may speak in a channel, whether a memory container is safe to search, whether email needs approval first, whether a newer message replaced the request, whether a model "working on it" is a final answer, how to recover if the runtime dies mid tool call, or when silence is correct.

The harness = runtime + policy + memory boundary + tool system + conversation protocol that turns raw capability into a dependable teammate: responsive when asked, selectively proactive, able to investigate, quiet when appropriate, recoverable when infra fails.

Premise: teammate, not bot ("send prompt → reply").

Step-by-step playbook

Cloudflare architecture

  • CompanyBrainAgent = Durable Object keyed by organization ID.
  • Owns: fiber-backed turn lifecycles + recovery checkpoints; durable local SQL (active turns, inboxes, approvals, bot threads, cooldowns, rollout cursors, traces); Slack API ops after decrypting the bot token; triage / proactivity resolution / action evaluation; main model+tool loop; approval suspend/resume; billing + telemetry scheduling.

Incoming Slack event classes

Type Examples
Explicit @mention, DM, assistant thread, name wake
Passive top-level message in a channel where proactive participation is allowed
Context-only conversation to retain but not answer at the HTTP routing layer
Ignored bot/self traffic, unsupported subtypes, ineligible events

Then triage → action.

Proactivity: not a binary yes/no

Two questions: (1) could the agent do something useful? (2) should it interrupt now?

They moved from binary to a confidence model with thresholds (small model). Typical cases: - Useful but low-confidence → investigate instead of answer - Socially fine but informationally empty → react - Urgent but disruptive → investigate under a stricter mode - Correct/useful but already answered → pass - Explicit and lightweight → acknowledge instead of a full turn

Output: action + reaction - Primary: ANSWER | INVESTIGATE | PASS - Reaction: allowlisted emoji | none

Four natural behaviors: reply without reacting; react without replying; both; nothing.

Per-channel config can disable proactivity. Explicit @ tags ≈ always answer.

Custom org emojis: dedicated resolver so the model asks for an emoji and the system resolves it (including workspace customs).

Answering: phased state machine

When triage picks ANSWER or INVESTIGATE, the harness runs a phased state machine with time awareness: human updates like "found X, next I'll do Y" (AI SDK streaming + pacing nudges via onBeforeStep).

Step budget is an active control: near the end the harness tells how many steps remain; at the final boundary it removes tool access so the model must synthesize from what it has — prevents the failure mode where the last step launches one more search and never answers.

Tool assembly: progressive disclosure + codemode

Not every tool schema needs to be visible at once. activeTools selects names available each step; sandbox and scheduler enter when needed (codemode). Progressive disclosure cuts confusion and tokens.

Permissioning, memory boundary, approval

For larger orgs you need determinism: not YOLO like consumer Pi/opencode/Codex. Memory tool use, access control, and approval flows (e.g. approve before email send) are controllable and tunable per customer.

Objective ≠ reply quality alone: value as an employee. A technically correct answer is still a bad intervention if: wrong channel, private context exposed, duplicates a human, interrupts a sensitive discussion, or ignores a newer message.

The system also asks: should I say anything? Check first? Is a reaction enough? Which information boundary? Has the request changed? Do I need permission? Can I finish reliably?

Deploy

  1. Repo: https://github.com/supermemoryai/company-brain
  2. One-click: https://deploy.workers.cloudflare.com/?url=https://github.com/supermemoryai/company-brain
  3. Stated setup <5 min; own your data.

Tools and costs

Item Note
Cloudflare Workers + Durable Objects main runtime
Cloudflare Agents SDK harness base
Slack multiplayer surface
company-brain repo open source (check LICENSE in repo)
emoji-resolve companion repo
Cost Cloudflare usage + LLM (not priced in the article)

Limitations

  • Commercial product is gone: community/best-effort support.
  • Harness complexity is high — overkill for single-player bots.
  • Cloudflare + Slack dependency; porting to other chats is nontrivial.
  • ASCII diagrams in the original: some tool/scheduler detail lives only in the repo.
← More guides in “Automation with AI agents”