Text a bot anything. It texts back a meme.
An open source iMessage agent built with Composio and Photon, running on Eve.
you a meme about Mondays
memebot 🖼️ [meme]
you roast my friend Sam, he's always "five minutes away"
memebot 🖼️ [meme]
- iMessage, no app. Photon gives the bot a real iMessage number.
- Memes as a tool. Composio Instant tools run Memelord with no account to connect, in one 25-line file.
- Serverless. Runs on Vercel with no database and no always-on machine.
Deploy with the button above, or from your terminal:
npx @composio/memebot deployThe CLI checks your tools (git, gh, npx), logs you in to Vercel and GitHub, asks which Vercel team to use, creates your repo and deploys. If a step fails, it tells you how to fix it; re-run the same command to pick up where it stopped.
Either way, finish the setup below.
- Composio key. Create an API key at dashboard.composio.dev, then turn on Instant tools in project settings.
- Photon project. Create a free project at app.photon.codes and copy its project id and secret.
- Deploy with
COMPOSIO_API_KEY,IMESSAGE_PROJECT_IDandIMESSAGE_PROJECT_SECRET. Use any placeholder forIMESSAGE_WEBHOOK_SECRETfor now. - Register the webhook in Photon:
https://<your-project>.vercel.app/eve/v1/photon. Use your production domain, not a per-deployment URL. - Set the real
IMESSAGE_WEBHOOK_SECRETfrom Photon and redeploy. - Add who can text it. On Photon's free plan, only numbers listed in the Photon dashboard under Users reach the bot. Add your own number first.
- Text the bot. Its number is in the Photon dashboard.
| Variable | Where to get it |
|---|---|
COMPOSIO_API_KEY |
Composio dashboard → API keys |
IMESSAGE_PROJECT_ID |
Photon dashboard → your project |
IMESSAGE_PROJECT_SECRET |
Photon dashboard → your project |
IMESSAGE_WEBHOOK_SECRET |
Photon, after registering the webhook |
No model key is needed: the LLM runs through Vercel AI Gateway.
iMessage ──▶ Photon ──signed webhook──▶ Eve agent on Vercel ──▶ Composio Memelord (Instant)
▲ │
└──────────── meme image ◀─────────────────┘
- Photon delivers your message to
/eve/v1/photon; Eve checks the signature and ignores retries. - The agent opens a Composio session for the sender (
imessage:<phone>) with three Memelord image tools preloaded, and calls one. - The bot downloads the meme and sends it back in the same thread.
All of the Composio code, using its Eve provider:
const composio = new Composio({ provider: new EveProvider() });
const session = await composio.create(userId, {
sessionPreset: "direct_tools", // preload the allowed tools; no search or auth
toolkits: ["memelord"],
tools: { memelord: ["MEMELORD_GENERATE_IMAGE_MEMES", "MEMELORD_GENERATE_CAPTION_MEME", "MEMELORD_GENERATE_AI_MEME"] },
instant: { toolkits: { enable: ["memelord"] } }, // no account or connection needed
});
const tools = await session.tools({ beforeExecute }); // forces include_nsfw offagent/
agent.ts model (via Vercel AI Gateway)
instructions.md the bot's prompt and safety rules
channels/photon.ts iMessage channel; sends the meme image back
tools/composio.ts one Composio session per sender
lib/
composio.ts the Composio session and tools
meme-image.ts finds, downloads and packages the meme image
evals/ behavior tests against the real agent (Memelord stubbed)
test/ unit tests
cli/ `npx @composio/memebot deploy`
Contributions are welcome: new meme behaviors, better prompts, more channels, and fixes.
pnpm install
cp .env.example .env.local # fill in the four variables
npx eve link # AI Gateway access for the model
pnpm devPhoton can't reach localhost, so test changes with the evals instead of texting the bot.
pnpm test # unit tests
pnpm typecheck
pnpm eval # agent evals; needs COMPOSIO_API_KEY and AI Gateway, Memelord is stubbed so nothing is billed
cd cli && pnpm testBefore opening a PR, make sure pnpm test and pnpm typecheck pass. If you change the bot's behavior, add or update an eval. Keep changes small and focused, and open an issue first for anything big.
- The bot doesn't reply. Check that your number is under Users in Photon, that
IMESSAGE_WEBHOOK_SECRETmatches the webhook, then check the Vercel logs. - "Instant accounts are not enabled". Turn on Instant tools in Composio project settings.
- You got an apology instead of a meme. Memelord sometimes takes over 60 seconds, past Composio's SDK timeout. Try again.
- Every meme is billed to your Composio balance, for every user you add in Photon (up to 10 on the free plan).
- NSFW is always off, enforced in code. The bot won't make memes attacking appearance, race, gender, religion, disability or other sensitive traits, and roasts target what a friend does, never who they are.