Functions Service (Part A)
Your Functions Service is where your @DaemoFunction code lives. It must be running for the AI to execute your functions.
Deployment Options
Serverless (Vercel/Railway/Render)
The easiest option for production. Push your code, get a URL.
Deploy to Vercel
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Set environment variables
vercel env add DAEMO_AGENT_API_KEY
Deploy to Railway
# Install Railway CLI
npm i -g @railway/cli
# Login and deploy
railway login
railway init
railway up
# Set environment variables in dashboard
Deploy to Render
- Push your repo to GitHub
- Create a new Web Service on render.com
- Connect your repo
- Set Build Command:
npm install && npm run build - Set Start Command:
npm start - Add environment variables
All three have free tiers. Vercel and Railway are especially quick to set up.
Docker
For maximum control or existing Docker infrastructure.
Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist/ ./dist/
ENV NODE_ENV=production
CMD ["node", "dist/index.js"]
Build and Run
# Build
docker build -t my-daemo-service .
# Run locally
docker run -p 3000:3000 \
-e DAEMO_AGENT_API_KEY=your_key \
my-daemo-service
# Push to registry
docker push your-registry/my-daemo-service
Deploy Anywhere
| Platform | Command |
|---|---|
| AWS ECS | aws ecs create-service ... |
| Google Cloud Run | gcloud run deploy ... |
| DigitalOcean | Use App Platform |
| Any VPS | docker run on your server |
Local Development
For active development. Fastest iteration, but only works while your machine is on.
# Development with auto-reload
npm run dev
# Or production build
npm run build
npm start
Local = only works when laptop is open. For 24/7 availability, deploy to serverless or Docker.
Keep Running with PM2
# Install PM2
npm i -g pm2
# Start and keep running
pm2 start dist/index.js --name "my-agent"
pm2 save
Checklist
Before deploying, make sure you have:
- Daemo SDK installed (
npm install daemo-engine) - Functions decorated with
@DaemoFunction - API key from app.daemo.ai
- Environment variables set
- Tested locally with Playground
Verify Deployment
After deploying, check that your service is connected:
- Go to app.daemo.ai
- Select your Agent
- Check the Services tab — should show "Online"
- Test in the Playground
Service offline? Check your logs for connection errors. Make sure DAEMO_AGENT_API_KEY is set correctly.
Next: Chat Interface
Once your functions service is deployed, integrate it into your apps →