Primitives.org.ai

services-as-software

AI-powered services that operate as software

npm install services-as-software

Primitives for building AI-powered services that cross business boundaries with pricing, SLAs, and autonomous delivery.

import { Service, POST, Client } from 'services-as-software'

const translationService = Service({
  name: 'translation-service',
  version: '1.0.0',
  pricing: {
    model: 'per-use',
    pricePerUnit: 0.01,
    currency: 'USD',
  },
  endpoints: [
    POST({
      name: 'translate',
      path: '/translate',
      handler: async (input) => ({
        translatedText: `Translated: ${input.text}`,
        confidence: 0.95,
      }),
    }),
  ],
})

// Use the service
const result = await translationService.call('translate', {
  text: 'Hello, world!',
  to: 'es',
})

Core Primitives

  • Service() — Define services with endpoints, pricing, and business logic
  • Client() — Connect to remote services
  • Provider() — Manage multiple services
  • POST(), GET(), PUT(), DELETE() — HTTP method helpers

Service Operations

  • ask(), do(), generate() — Execute tasks
  • quote(), order(), subscribe() — Commerce operations
  • on(), every() — Events and scheduling
  • kpis(), okrs(), entitlements() — Business metrics

Entity Definitions (Nouns)

Comprehensive entities for AI-delivered productized services:

CategoryEntities
ServicesProductizedService, ServiceOffering, ServicePlan, ServiceInstance, ServiceExecution
DeliveryAgentDelivery, AutonomyLevel, EscalationRule, ConfidenceThreshold, HumanHandoff, QualityGate
BillingServiceQuote, ServiceOrder, ServiceSubscription, Usage, Invoice, Payment
OperationsSLA, SLO, ServiceIncident, SupportTicket, ServiceFeedback, ServiceMetric
CustomersServiceCustomer, ServiceEntitlement, CustomerUsage, CustomerSegment
OrchestrationServiceWorkflow, WorkflowStep, ServiceTask, ServiceQueue, ServiceWorker
import { AgentDelivery, ProductizedService } from 'services-as-software'

console.log(AgentDelivery.properties.autonomyLevel)
// { type: 'string', examples: ['full', 'supervised', 'assisted', 'advisory'] }
Was this page helpful?

On this page