Skip to main content
The domain engine provides the product-facing API for building agent applications. It wraps TENET’s internal infrastructure (memory, training, policy, eval) into a clean interface that any app can use.

Core Types

TenetEntity

Generic entity that any domain maps to:
interface TenetEntity {
  id: string
  source: string           // which platform/connector
  sourceId: string         // platform-specific ID
  name: string
  metadata: Record<string, any>
  funnelStage: string      // from template FUNNEL.md
  temperature: 'hot' | 'warm' | 'cooling' | 'cold'
  createdAt: Date
}
  • Dating: Entity = Match
  • Sales: Entity = Lead
  • Recruiting: Entity = Candidate

TenetConnector

Typed interface to external platforms:
interface TenetConnector {
  authenticate(credentials: ConnectorCredentials): Promise<void>
  syncEntities(since?: Date): Promise<TenetEntity[]>
  syncInteractions(entityId: string): Promise<TenetInteraction[]>
  send(entityId: string, content: string): Promise<{ platformMsgId: string }>
  getProfile(entityId: string): Promise<Record<string, any>>
}

TenetRewardFunction

Domain-specific reward definitions:
interface TenetRewardFunction {
  signals: RewardSignal[]
  calculate(context: RewardContext): number
}

The World Class

The World (or DomainEngine) wraps everything:
import { World } from '@tenet-ai/cli'

const world = await World.create({
  template: 'dating',
  storage: cloudStorage(userId),
  connectors: [tinder(token), bumble(token)],
})

await world.sync()                          // pull from platforms
const draft = await world.generateDraft(matchId)  // memory + policy
await world.recordOutcome(draftId, 'send')  // training signal
await world.train()                         // nightly: policy improves