Give Replit apps a way to send and receive email
Call Agent Inbox from a Replit app: threads as memory, Ask before send. This is an HTTP/SDK integration, not an official Replit connector listing.
Discuss this post in AI
Send a pre-filled prompt to ChatGPT, Claude, Gemini, or Perplexity — get a summary, ask follow-ups, or compare ideas from this guide.
Replit is a fine place to prototype an app that people can talk to. Email is how those people come back when they are not in the webview. You do not need an official Replit connector listing to make that work. Call Agent Inbox from the app with the SDK or HTTP, store the inbox id, treat threads as memory, and keep send on Ask.
This is a generic Replit (or any hosted Node/Python) pattern. Secrets go in the repl’s secret store. The company version of the same app still belongs on Neuro OS when you have roles, forwarding, and an audit trail.
Create the mailbox from the app bootstrap
On first deploy, or behind an admin action, provision the inbox:
from agentinbox import AgentInbox
client = AgentInbox()
inbox = client.inboxes.create(username="replit-demo", domain="agentinbox.space")
Save inbox.id in your database or a config file that is not committed with the API key. Do not create a new inbox per HTTP request. Do not put the API key in client-side JavaScript.
Expose a server route that the Agent Inbox webhook can call when mail arrives. Verify the webhook. Enqueue work. If you cannot take webhooks from a sleeping repl, poll with backoff and accept that OTP flows will feel slower.
Threads as memory
The app’s chat history is not the customer’s email history. When a user replies by mail, load the thread, then continue. Persist the thread id on the user or tenant record. The next web session should show the same conversation the mailbox sees.
Search when you need to find an old order or ticket in mail, rather than stuffing every message into the model. For the mechanics of keeping replies in one conversation, see email threading for AI agents.
Ask before send
A Replit demo that auto-mails the world will get you blocked and will train you into a bad habit. Default send to Ask: the app shows the draft to the operator (you, during prototype; a named role later). After approval, call send.
If the app also writes to a CRM or a spreadsheet, that write waits too. Prototype gates can be a simple “Approve” button. Production gates should be Neuro OS Ask so the approval is logged next to the role, not in a random SQLite file on a repl disk.
What to build first
A useful first app is inbound-only: people email an address, the app extracts a structured request, and a human sends the reply. Second, add a draft from the web UI that still requires Ask. Third, add forwarding into Neuro OS when the request is too large for the toy app.
Do not claim you are “live as a Replit connector.” You are an app that calls an email API, which is the honest description and enough to ship.
Cleanup: when you fork the repl, rotate the API key and do not reuse the demo inbox for a customer. Isolation is the same rule as everywhere else — one mailbox per tenant if mail contains their data.
Agent Inbox is the mailbox. Replit is the editor and host. Neuro OS is where you put the role when the prototype has users who are not you.
Agent Inbox gives each role a mailbox people can reply to, with forwarding into Neuro OS when a human must see the thread. Outbound mail defaults to Ask. Run the role on Neuro OS. To scope the first inbox, get started.