AI marketing agent
GlobalManaged by Graphed
Deploys an AI teammate into your Slack. Mention it or send it a message and it pulls your numbers, researches, and makes files with your Graphed data and tools, then answers in the thread with tables, charts and next-step buttons. It remembers your company and shows what each task cost.
AI Marketing Agent
An AI teammate the agent deploys into the user's own Graphed project and connects to their Slack workspace.
One always-on Node service (the dispatcher) gets Slack events over Socket Mode, queues each request in
Postgres, and starts Claude Code in a Modal sandbox through Graphed Tools (modal:sandbox). The
sandbox has the graphed CLI, Python and ffmpeg. The model is Claude Sonnet through the Graphed LLM proxy.
The answer and its files go back to the Slack thread.
- Memory: one shared memory (
~/brain/CLAUDE.mdplus notes, scripts and its own skills) in project object storage. The agent adds what it learns. Every thread also keeps its session and work folder, so a reply in the thread goes on where it stopped. - Cards: when the answer is data, the agent also writes a UI spec (json-render format, Chat SDK card components). The app turns it into native Slack blocks: a header, key numbers, a data table, charts and buttons. A click on a button sends the button's label as that person's next request in the thread.
- Status page (Graphed login): setup checklist, runs with their steps and answers, spend by day and by person, the memory, the sandboxes, and a box to ask without Slack.
- Public surface: only the sandbox worker's callback paths, each call checked against that run's token. Slack connects out from the service, so there is no public Slack route.
The deeper reference (files, settings, tables, security, limits, gotchas) is app/AGENTS.md.
Find the account id with graphed --format json accounts list. deploy.sh copies <skill-dir>/app/ to
apps/<slug>/, runs the offline tests, makes the project and any missing secret (as -), deploys, saves the
service's address, and prints the Slack link and the next steps. Re-running it updates the same project; the
database, the memory and the secrets stay. Flags: --slug, --name, --dir,
--agent-login, --dry-run. The Slack app is always named Graphed with the handle @graphed; there is
no option to change it, so do not ask.
Default run
You do the setup. The person does only what Slack makes them do: approve two things and copy two tokens. Keep them on one short list of things to do at a time, and do everything else yourself.
- Ask, in one message.
- Which Graphed account (
graphed --format json accounts list), the company's website, and the email they use in Slack (for the test message at the end). - Who may use it: every full member of the workspace (default), or a list of people.
- Tell them the two things under What the user must know below, and get a yes.
- Which Graphed account (
- Deploy:
deploy.sh --account <act_…> --agent-login --slug <slug>. The person approves the agent's Graphed login in the browser when it opens; tell them that is coming. Wait until the script prints the setup list (before that the page says "Cloud service not found"). - Make the Slack app. The status page's setup guide has four steps, each with Slack's screen (the button
to press marked in red), a link to the right Slack page, and the paste box. Give the person the page URL, or
do the first part yourself:
- With browser tools (Claude in Chrome, tools named
mcp__claude-in-chrome__*; load them with ToolSearch to check): offer to do the Slack clicks in their Chrome and do them after their yes.- Open the guide's Create the Slack app link (
node cli.mjs slack-linkprints it). Pick their workspace in the Workspace box at the bottom (until then Next is grey), press Next, then Create. If a welcome box shows, press Got It. - The app's ID is now in the address (
api.slack.com/apps/<ID>/…). Runnode cli.mjs set slack_app <ID>so the guide's links open this app's own pages. - On Basic Information: upload the icon under Display Information → + Add App Icon
(
file_uploadwithapps/<slug>/assets/slack-icon.png; Slack saves it). Then App-Level Tokens → Generate Token and Scopes, type the namesocket, Add Scope →connections:write. Stop there. Do not press Generate, and do not open Install App. - Hand over. Slack prints each token in plain text: the bot token on Install App right after Allow, and the app-level token in the window right after Generate. A screenshot or page read of those screens puts the token in your transcript. So from here on, do not take a screenshot of, read or get the text of any Slack tab. The person does the rest on the guide (steps 2 to 4): Install to <workspace> → Allow → Copy → paste → Save, then in the tab you left open Generate → Copy → paste → Connect. The guide page itself is safe to look at (its boxes hide what is typed).
- Open the guide's Create the Slack app link (
- Without browser tools: open the link for them (
open "<link>"on a Mac) and point them at the guide. After they create the app, ask for its ID (in the Slack address) and runnode cli.mjs set slack_app <ID>. The icon is optional: Basic Information → Display Information → + Add App Icon withapps/<slug>/assets/slack-icon.png.
- With browser tools (Claude in Chrome, tools named
- The two tokens. The person copies them; you never read a token off a screen or type one into a page.
They either paste them into steps 3 and 4 of the setup page (it checks them, keeps them encrypted in the
project database with the key secret
TOKEN_KEYthatdeploy.shmade, and connects at once), or paste them to you in this chat. If they give them to you: save each as a project secret, then deploy again:Then check:bashgraphed exec --project <slug> --account <act_…> -- sh -c 'node cli.mjs slack; sleep 5'saysconnected.half connectedmeans only the bot token is there: the bot can send, but mentions and messages do not arrive until the app-level token is saved (Connect). Never repeat a token back, never write one to a file. - Teach it the company:
graphed exec … -- sh -c 'node cli.mjs memory <website>; sleep 5'queues a run that reads the site and the connected Graphed data and writes the memory (about 2 minutes). Check it withnode cli.mjs show <run>every 30 seconds untilstatusisdone, then show the person the summary (node cli.mjs brainprints the memory). - Test it in Slack:
graphed exec … -- sh -c 'node cli.mjs hello <their Slack email>; sleep 5'. The bot sends them a direct message and answers a first question in that thread, end to end (sandbox, model, Slack). Checknode cli.mjs show <run>untildone, and tell them to look at the DM. If the email lookup fails (an app made before theusers:read.emailscope), use their Slack member ID instead (their profile → ⋮ → Copy member ID). - Settings they asked for:
node cli.mjs set allowed U0123,U0456,set guests on. - Check:
node cli.mjs setupshows every lineok, andnode smoke.mjspasses. Ask them to invite the bot to one channel (/invite @graphed). - Report (see Done).
What the user must know (say it before the deploy)
- The agent acts as the person who approves its Graphed login. That token can reach every project, secret and credit in the account. Anyone allowed to talk to the agent in Slack can ask it to use that access. In a large or mixed workspace, set an allow list.
- It spends credits, and there is no limit. Each request costs LLM calls plus sandbox time. A simple
question is about 10 to 30 credits; a long research task can be a few hundred. Graphed Tools the agent runs
(enrichment, search, video) are extra. Nothing stops spend: the app shows it (each answer's "Done" line, the
status page,
node cli.mjs spend), and the agent's instructions make it ask before a tool batch over about 50 credits. The allow list is how the user limits who can spend.
What the user sees
- In Slack:
@graphed <request>in a channel, or a direct message. A status line shows what it is doing in plain English ("Pulling last week's ad spend"), then "Done in 40s · 6 steps · about 18 credits". The answer is a thread reply; files it made (CSV, PNG, PDF, MP4) are uploaded there. A data answer also gets a card under the reply: key numbers, one table, up to two charts, and buttons for the next step ("Break this down by keyword"). A click starts that request. Files attached to the request are given to the agent. Reply in the thread to continue. Writestopto cancel. - Status page: the setup checklist until every step is done, every run, today's spend, the last 7 days by day and by person, the memory, the sandboxes.
Costs
| What | Credits (1 credit = 1¢) |
|---|---|
| The always-on service | the project's hosting, no credits per request |
| Sandbox time | about 24 per hour (2 vCPU, 4 GB); a sandbox stops after 10 idle minutes |
| A simple question (3 to 6 model calls) | about 10 to 30 |
| A long task | a few hundred; one run ends after 25 minutes at most |
| Graphed Tools the agent runs | the tool's own price |
smoke.mjs | free; --paid about 1 |
Rules
- Tokens: the person copies them. Do not read a token from a screen, and do not type or paste one into a
web page, also when you drive their browser. Do not look at (screenshot, read, get text of) Slack's
Install App page after the install, or the app-level token window after Generate: both show a
token in plain text. When the person pastes tokens to you in chat, store them only
with
graphed secrets set; never print, repeat or write them anywhere else. - Ask before you click for them. Creating the Slack app, installing it (the person's Allow grants it access to the workspace) and generating the app-level token each need the person's yes first.
- Do the rest yourself. Memory, settings, the Slack test and the checks are commands you run; do not hand them to the person.
- Say the access and the cost before the deploy, and get a yes.
- There is no spend limit in the app. Say so before the deploy. The allow list is how the user limits who can spend.
- Default access is workspace members only. Turn
guestson, or add an outside person toallowed, only when the user names them. - After a secret change, deploy again (tokens saved on the setup page need no deploy), and after a new
agent login also stop live sandboxes (
node cli.mjs stop-sandboxes);deploy.sh --agent-logindoes both. - One workspace per project. For a second workspace deploy again with another
--slug. - The memory is the user's. Show them what you wrote before
brain-put.brain-resetputs the empty template back and keeps the old copy.
Limits
- 5 live Modal sandboxes per Graphed account, shared with other apps that use
modal:sandbox. - 3 runs at the same time, one per Slack thread; more wait in the queue. A run is 25 minutes at most.
- One card per answer: 1 table (100 rows, 20 columns), 2 charts, 10 key numbers, 5 buttons. More rows go in a CSV file. A card that does not pass the check, or that Slack refuses, is left out or sent as plain text; the written answer always arrives.
- Button clicks need "Interactivity" on in the Slack app. The manifest turns it on for a new app. For an app made before this, switch it on under Interactivity & Shortcuts (Socket Mode needs no URL).
- The agent has no web search tool of its own; it searches with Graphed Tools (Exa, Serper) and reads pages.
- The Graphed LLM proxy passes OpenAI chat completions only, so the app translates for Claude Code
(
app/agent/shim.mjs). - Sandbox spend is an estimate from running time when Graphed reports no bill for the call.
graphed execcan drop the output of a short command; thesleep 5in the commands above keeps it.
Files
Done
Reply with the status page URL, who may use it, what you wrote
in its memory, which setup lines are ok, and any step still open on the user's side (Slack tokens, icon,
first message).
About Graphed
Graphed is a marketing cloud. It includes the infrastructure for an agent to do marketing: a data warehouse, data pipelines, a Postgres database, cron jobs, runtime servers, a tool catalog, custom domains, and internal app tooling.