Node.js / TypeScript
Build AI agents that connect to your backend functions in minutes.
The Big Picture
Daemo lets you expose your backend functions to AI agents. Here's what that means:
Write functions in your repo using TypeScript decorators
Register functions and connect to Daemo Engine
Functions appear in dashboard, ready for AI to use
What You'll Build
By the end of this quickstart, you'll have:
- A service running locally that exposes your functions
- Functions visible in the Daemo dashboard with full type information
- An AI agent that can call your functions via natural language
- Full logs + visibility into what prompts are fed into your agent and how your agent behaves
Two Ways to Get Started
Step-by-step guide to create your first agent from an empty project
Start with a working SF 311 Agent template repo — clone it, explore it, learn Daemo, then customize
Recommended for learningQuick Links
| Section | What You'll Learn |
|---|---|
| How It Works | Architecture overview — understand the system |
| Installation | Set up your project and get your API key |
| Defining Tools | Create functions with decorators |
| Registering Services | Connect your functions to Daemo |
| Example Project | Real-world SF 311 Agent walkthrough |
| Dashboard Integration | See your functions in app.daemo.ai |
Ready to test? See Testing & Debugging for CLI scripts, Playground usage, and troubleshooting.
5-Minute Quickstart
Want to skip the details and just get something running? Here's the fastest path:
1. Install
npm install daemo-engine reflect-metadata2. Get Your API Key
- Go to app.daemo.ai and sign up
- Create an Organization (or use existing)
- Click Create New Agent — give it a name
- Copy your
DAEMO_AGENT_API_KEY(shown once — save it!)
3. Create Your First Tool
Create MyFunctions.ts:
import { DaemoFunction } from 'daemo-engine';
import "reflect-metadata";
export class CalculatorFunctions {
@DaemoFunction({
description: "Computes A to the power of B"
})
async power(args: { a: number; b: number }) {
return { result: Math.pow(args.a, args.b) };
}
}
4. Register and Run
Create index.ts:
import "reflect-metadata";
import { DaemoBuilder, DaemoHostedConnection } from 'daemo-engine';
import { CalculatorFunctions } from './services/MyFunctions';
async function main() {
const calculatorService = new CalculatorFunctions();
const sessionData = new DaemoBuilder()
.withServiceName("CalculatorService")
.registerService(calculatorService)
.build();
const connection = new DaemoHostedConnection(
{ agentApiKey: process.env.DAEMO_AGENT_API_KEY },
sessionData
);
await connection.start();
console.log("🚀 Agent online!");
}
main().catch(console.error);
5. Run It
export DAEMO_AGENT_API_KEY="your-api-key"
npx ts-node index.ts
6. Test in the Playground
- Go to app.daemo.ai
- Select your Agent → Playground
- Ask: "What is 2 to the power of 10?"
That's it! Your function is now callable by AI. Continue reading to understand how each piece works.
SDK Information
| Package | daemo-engine |
| Latest Version | 0.2.4 |
| Registry | libraries.io/npm/daemo-engine |
| License | ISC |
Key Features
- Decorators-First Design — Use
@DaemoFunctionand@DaemoSchemato expose your code - Automatic Schema Generation — Rich schemas from your DTO classes give the AI precise context
- Hosted Connection — Connect to Daemo Gateway for a fully managed experience
- Agent Client — Query your agent, manage conversation threads, and stream responses from your app
- Strongly Typed — Full TypeScript support
Check npm or libraries.io for the latest version updates.
Next Steps
Ready to dive deeper? Start with How It Works to understand the architecture, or jump to any section that interests you.