Built by Cyndra.
Replyfold is a support inbox you run on your own server. It connects your team's shared mailbox, writes a draft reply for every new customer email from your playbook, and sends only what a person approves.
- It connects Gmail and Google Workspace, Microsoft 365 and Outlook.com, or any mailbox with IMAP and SMTP (Yahoo, iCloud, Fastmail, Zoho, AOL, GMX, your own domain).
- It uses your credentials and your model. Sign in with your ChatGPT plan, or bring your own key for OpenAI, Anthropic, Google Gemini, OpenRouter, Groq, Mistral or any OpenAI-compatible server. You pick the provider and model in Settings.
- It tags every customer email with a case type and the customer's mood, so you can filter the inbox by mood and the draft matches the tone.
- It stores everything in one SQLite file. Mailbox credentials are encrypted with a key only your server has.
- It sends nothing on its own. Every reply goes out when someone presses Send.
Status: early. Expect breaking changes before 1.0.
- Replyfold checks each connected mailbox every minute.
- For each new customer email, a classifier tags the case type and the customer's mood. If tagging fails, the draft goes on without the tag.
- The model then makes two calls. The analyst call reads the whole thread and lists the facts it relies on. The writer call drafts the reply from your playbook, in a tone that fits the mood.
- The server checks every draft. It flags links that are not in the thread or the playbook, unfilled placeholders, raw timestamps, internal wording, missing information, and cases that need a person's judgment.
- You read the draft next to the thread, edit it, and send it with Ctrl+Enter (Cmd+Enter on a Mac). The reply goes out from your mailbox, in the same thread.
- When someone rewrites a draft before sending it, Replyfold proposes a playbook rule. A lead accepts or dismisses it. Nothing changes the playbook on its own.
Sends are safe to retry. Each send has a key, so a double click sends once. If the mail server stops answering after the message left, the conversation shows "This reply may already have been sent" until someone checks the Sent folder.
The demo uses a made-up shop, made-up customers and a built-in model. It needs no mailbox and no API key. In the demo, the AI settings accept made-up keys: a stand-in on the server answers for the built-in providers, so you can try every screen.
git clone https://github.com/Cyndra-AI/replyfold.git
cd replyfold
bun install
bun run demoOpen http://localhost:3000. The sign-in form is already filled in. The demo keeps its data in memory, so a restart resets it.
You need Bun 1.4 or later.
- Copy the example settings:
cp .env.example .env - Set
REPLYFOLD_SECRET_KEYto a random string.openssl rand -base64 32makes one. Keep it safe: without it, Replyfold cannot read the stored mailbox credentials. - Set
PUBLIC_URLto the address your team opens, for examplehttps://support.yourshop.com. - Start the server:
bun run start - Open the app and create the owner account.
- Go to Settings, then AI and classification. Connect ChatGPT or add an API key, then pick the model for drafts.
- Go to Settings, then Mailboxes, and connect your mailbox.
The owner sets the model in Settings, then AI and classification. Each provider bills your own account. Replyfold reads the provider's live model list with your key, so new models show up without an update.
Use your ChatGPT plan. Press Continue with ChatGPT. OpenAI asks you to name the app and allow plan use, then sends you back. Drafts then count toward the usage in your ChatGPT Plus or Pro plan, and you can set a weekly limit for Replyfold in ChatGPT settings. Replyfold follows OpenAI's ChatGPT plan usage flow for open-source apps: authorization code with PKCE, a 127.0.0.1 callback, and the public Responses API.
OpenAI only returns the sign-in to 127.0.0.1, the computer that runs Replyfold. Do this on that computer:
- Open
http://127.0.0.1:3000/settings/ai, using yourPORT. - Sign in to Replyfold as the owner.
- Press Continue with ChatGPT.
If Replyfold runs on a remote server, forward the port first: ssh -L 3000:127.0.0.1:3000 your-server. Then do the three steps in your own browser.
The plan belongs to the person who signs in. Every draft for the whole team then uses that person's plan.
Bring your own key. Open a provider, paste the key, and press Save. Test connection reads the provider's model list with the key. Keys are stored encrypted in the SQLite file with REPLYFOLD_SECRET_KEY. The app shows only the last four characters, and keys never appear in logs or API replies.
| Provider | Draft API | Model list |
|---|---|---|
| OpenAI | Chat Completions with JSON Schema output | GET /v1/models |
| Anthropic | Messages with one forced tool call | GET /v1/models |
| Google Gemini | generateContent with JSON Schema output |
GET /v1beta/models |
| OpenRouter | Chat Completions with JSON Schema output | GET /api/v1/models, after a key check |
| Groq | Chat Completions with JSON object output | GET /openai/v1/models |
| Mistral | Chat Completions with JSON Schema output | GET /v1/models |
| OpenAI-compatible server | Chat Completions at your base URL, for Ollama, vLLM, LM Studio and others | GET /models |
You can still set the model in .env with MODEL_PROVIDER (codex or openai). A model chosen in Settings takes priority.
Before each draft, Replyfold tags the email with a case type and the customer's mood: happy, calm, confused, worried, frustrated or angry. The inbox and the thread show the mood. The filter button above the list shows one mood at a time. Insights counts the emails per mood.
Replyfold picks the classifier in this order:
- Jev, TypeSafe's decision model, through OpenRouter's System One API. This needs an OpenRouter key and the Use Jev for classification switch. Replyfold finds the newest Jev on OpenRouter's live model list. At the time of writing, Jev costs $0.042 per million input tokens, with no output charge.
- Otherwise, a small model of the provider you picked for drafts, such as a Luna, Haiku or Flash model, read from that provider's live list. If the list has no small model, the drafts model does the tagging.
- Otherwise, no tag. Drafts still work.
Test classification sends one made-up email and shows the result.
- In your Google Cloud project, turn on the Gmail API.
- Create an OAuth client of type Web application.
- Add
PUBLIC_URL/api/oauth/gmail/callbackas an authorized redirect URI. - Put the client ID and secret in
.envasGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. - Restart Replyfold and click Connect next to Gmail.
Replyfold asks for the gmail.modify scope, which lets it read and send mail.
- In Microsoft Entra, register an app. Allow work and personal accounts if you want to connect an Outlook.com address.
- Add
PUBLIC_URL/api/oauth/microsoft/callbackas a Web redirect URI. - Create a client secret.
- Put the values in
.envasMICROSOFT_CLIENT_IDandMICROSOFT_CLIENT_SECRET. SetMICROSOFT_TENANTif you want to limit sign-in to one organization. - Restart Replyfold and click Connect next to Microsoft 365.
Replyfold asks for Mail.ReadWrite, Mail.Send, User.Read and offline_access.
Pick your provider in the IMAP and SMTP form, or enter the server names for your own domain. Use an app password, not your account password. Replyfold signs in to both servers before it saves the mailbox.
On the first sync, Replyfold reads the last 14 days of mail.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Key | Action |
|---|---|
| J, K | Next and previous conversation |
| Ctrl+Enter or Cmd+Enter | Send the reply |
| R | Edit the reply |
| Shift+R | Write the draft again with an instruction |
| E | Close the conversation |
| I | Assign it to me |
| / | Search the current view |
| C | Write a new email |
| Ctrl+K or Cmd+K | Open the command menu |
| G, then I, M, W, P, S | Go to Open, Mine, Waiting, Playbook or Insights |
| ? | Show every shortcut |
| Role | Can |
|---|---|
| Agent | Read and answer conversations, assign them, set reminders |
| Lead | Also edit the playbook, accept suggestions, connect and pause mailboxes |
| Owner | Also add and remove teammates, change roles, disconnect mailboxes, and set the AI provider, keys and classification |
Set MCP_TOKEN to turn on a read-only Model Context Protocol endpoint at /mcp. Send the token as Authorization: Bearer <token>. The tools are list_conversations, get_conversation, get_statistics and get_playbook. The endpoint cannot send mail or change anything.
bun install
bun run demo # demo workspace on port 3000
bun run check # type check and tests
bun run sync:coss # refresh the coss ui components in src/web/uiThe code is organized by job:
| Folder | Holds |
|---|---|
src/mail |
Mail providers (Gmail, Microsoft Graph, IMAP and SMTP), OAuth, MIME and the sync that files mail into conversations |
src/drafts |
The analyst and writer prompts, draft checks, sending, and learning from edits |
src/ai |
Model adapters for each provider, the ChatGPT sign-in, the classifier, and the stored AI settings |
src/db |
The SQLite schema and store |
src/server |
The HTTP API and the MCP endpoint |
src/web |
The React app, built with coss ui components |
src/demo |
The made-up shop, mailbox and model for the demo |
See CONTRIBUTING.md before you open a pull request, and SECURITY.md to report a vulnerability.
Built by Cyndra.













