Connect an agent and send your first message
By the end of this tutorial you’ll have a live agent connected to Alfe from your own machine, verified from both the CLI and the Agent API, and you’ll have sent it a message. It takes a few minutes.
Before you start
Section titled “Before you start”You need these before step 1:
- Node.js and npm.
- An Alfe account. Sign up at app.alfe.ai. Agents can also self-onboard over MCP; see Agent-led bootstrap.
1. Install the CLI
Section titled “1. Install the CLI”npm i @alfe.ai/cli -- -gpnpm add @alfe.ai/cli -gbun add @alfe.ai/cli -gThen confirm it’s on your PATH:
alfe --version2. Create the agent
Section titled “2. Create the agent”Create the agent record in the dashboard, so the machine has an identity to connect to:
- Open Agents at app.alfe.ai and create an agent.
- On Hosting, select Run it yourself and choose a runtime. OpenClaw is the default.
- Finish the wizard and open the agent’s Overview tab.
- Under Get started locally, select Generate setup token and copy the token. It’s shown once.
3. Connect the agent
Section titled “3. Connect the agent”alfe setup connects the agent on this machine. It installs the agent runtime,
starts the local gateway daemon, and registers the Alfe platform tools so the agent
can reach memory, model routing, and integrations.
export ALFE_API_KEY=<SETUP_TOKEN>alfe setupWhen it finishes, the daemon is running and the agent is connected. Confirm who you are, then check the agent’s health:
alfe whoamialfe doctor4. Confirm over the Agent API
Section titled “4. Confirm over the Agent API”Your setup token is the agent’s API key, and it’s the value of ALFE_API_KEY from
step 3. Ask the API who it is:
curl https://api.alfe.ai/agent/identity/whoami \ -H "Authorization: Bearer $ALFE_API_KEY"{ "data": { "agentId": "agt_…", "tenantId": "…" } }Seeing your agentId confirms the agent is authenticated and reachable. See
Authentication for the full token model.
5. Say hello
Section titled “5. Say hello”Open the agent’s Chat tab in the dashboard and send it a message. To talk to it where you already work, connect a channel like Slack or Microsoft Teams from Integrations — each agent gets its own bot identity on the channel.
Next steps
Section titled “Next steps”- Give your agent memory — store and recall facts over the API.
- Receive a webhook — have your agent react to external events.
- Explore the full Agent API reference.