How do I launch an iMessage agent without running servers?
Define the agent with create() from @onkeiki/agents and call kit.sync(): Keiki stores the config and runs every turn, so there is no server, queue or webhook for you to operate.
How do I launch an iMessage agent without running servers?
Define the agent with create() from @onkeiki/agents and call kit.sync(): Keiki stores the config and runs every turn, so there is no server, queue or webhook for you to operate. Keiki also handles the iMessage line, delivery and the team inbox, and a person can take over the thread when the agent needs help.
Key takeaways
- Put your product in iMessage with Keiki: a support agent that answers from your FAQ and hands the conversation to your team, and Keiki runs it, so there is no server to deploy.
- Keiki runs the model loop, the line and the conversation. There are no servers to run.
- The open-source imessage-support-agent-hosted repo is a working example you can fork.
What you write
A hosted Keiki agent is a config file plus a sync command. You write the instructions, pick a model (or let Keiki choose with keiki:auto), list your tools, and turn on the features you need. kit.sync() bundles each tool and sends everything to Keiki in one request. Run it from your laptop or from CI on every push.
import { create } from '@onkeiki/agents'
import { agent } from './agent'
const kit = create({ ...agent, apiKey: process.env.KEIKI_API_KEY! })
await kit.sync()The open-source imessage-support-agent-hosted starter is a working support agent built this way. It answers from your product FAQ with a search_faq tool, and when it has no answer it offers a teammate and calls the built-in escalate tool, which opens the conversation in the Keiki Handoffs queue.
Steps
- Clone the starter, run
npm install, and put your Keiki API key in.env. - Edit
src/faq.tswith your product's answers and runnpm run sync(it needs Bun). - Attach an iMessage line to the agent in the dashboard and text it.
If you later want the model loop on your own servers, the self-hosted version keeps the same tools and moves the loop into your app.
FAQ
Do I need a server for the agent's tools?
No. Tools you define with defineTool are bundled by kit.sync() and run on Keiki. Keep keys out of the code: store them as Keiki secrets and read them in the tool with ctx.secrets.
How do I update the agent after it is live? Change the config and run the sync again. Sync replaces the prompt, model, tools and feature settings in one request, so the repo stays the source of truth for the agent.
What happens when a customer asks for a person?
The agent calls escalate, and the conversation shows up in the Handoffs queue in Keiki. While a teammate has it, the agent stays quiet, and it picks the thread back up when the teammate hands it back.