Skip to main content

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:

1
Your Code

Write functions in your repo using TypeScript decorators

2
Daemo SDK

Register functions and connect to Daemo Engine

3
app.daemo.ai

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

SectionWhat You'll Learn
How It WorksArchitecture overview — understand the system
InstallationSet up your project and get your API key
Defining ToolsCreate functions with decorators
Registering ServicesConnect your functions to Daemo
Example ProjectReal-world SF 311 Agent walkthrough
Dashboard IntegrationSee 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-metadata

2. Get Your API Key

  1. Go to app.daemo.ai and sign up
  2. Create an Organization (or use existing)
  3. Click Create New Agent — give it a name
  4. Copy your DAEMO_AGENT_API_KEY (shown once — save it!)

3. Create Your First Tool

Create MyFunctions.ts:

src/services/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:

src/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

Terminal
export DAEMO_AGENT_API_KEY="your-api-key"
npx ts-node index.ts

6. Test in the Playground

  1. Go to app.daemo.ai
  2. Select your Agent → Playground
  3. Ask: "What is 2 to the power of 10?"
Note

That's it! Your function is now callable by AI. Continue reading to understand how each piece works.

SDK Information

Packagedaemo-engine
Latest Version0.2.4
Registrylibraries.io/npm/daemo-engine
LicenseISC

Key Features

  • Decorators-First Design — Use @DaemoFunction and @DaemoSchema to 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
Tip

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.