Engine · Available

AI

Shared AI steps for products and automations.

@keystone/engine-ai

Purpose

Platform contracts for chat, embeddings, classify, and summarize so apps and Automation share one AI surface instead of wiring vendors in every feature. Usage meters through Billing. Document retrieval is supported; so are steps that run inside rules when work changes.

In a product

A record moves to “At risk” → an automation classifies severity → starts a workflow or notifies the owner.

How it works

  1. Callers use chat, embed, or runStep (classify / summarize) with an organization id.
  2. Automation flow graphs can include those steps beside query, branch, and action.
  3. Providers return content or vectors; the engine records usage on Billing.
  4. Optional agents store reusable prompts and ops per organization.

Capabilities

  • Chat completions and text embeddings
  • runStep classify / summarize for Automation graphs
  • In-memory agents (upsert / list / delete)
  • Meters ai.chat, ai.embedding, and ai.step via Billing
  • API under /v1/ai (chat, embeddings, steps/run, agents)

Related

Automation · Billing · Document · Report · Trigger