Skip to content

Programmatic API

OpenExpertise is designed to be used both from the CLI and as a library. Every action the CLI takes is available as a composable TypeScript function or class. This page lists all public packages and explains when to reach for each one.

Workspace package map

PackageWhat it exportsWhen to import
@openexpertise/schemaparseExperienceYaml, validateExperienceSpec, all schema typesParsing and validating experience.yaml without running anything
@openexpertise/corerunExperience, LLMClient, NodeDispatcher, DispatcherRegistry, StateStore, EventBus, RunContextBuilding a custom runner, embedding OE in your own app
@openexpertise/node-kinds-toolToolDispatcherRegistering the tool node kind in a custom DispatcherRegistry
@openexpertise/node-kinds-agentAgentDispatcher, AnthropicLLMClientRegistering the agent node kind; Anthropic-backed LLM client
@openexpertise/node-kinds-skillSkillDispatcherRegistering the skill node kind
@openexpertise/node-kinds-datasetDatasetDispatcherRegistering the dataset node kind
@openexpertise/node-kinds-experienceExperienceDispatcherRegistering the experience node kind (sub-experience composition)
@openexpertise/node-kinds-cli-agentCliAgentDispatcherRegistering the cli-agent node kind (Claude Code / Codex / Gemini)
@openexpertise/llm-openaiOpenAILLMClientUsing an OpenAI-compatible endpoint instead of Anthropic
@openexpertise/evolutionEvolutionAdvisor, EvolutionProposalGenerating YAML improvement proposals after a run
@openexpertise/authoringUltraExpertise, AnalysisOutput, SynthesisOutputLLM-assisted experience.yaml authoring
@openexpertise/mcp-serverMCP server entry pointExposing OE as an MCP tool to Claude Code
@openexpertise/tuiTUI dashboard entry pointEmbedding the terminal dashboard in another CLI
@openexpertise/cliCLI entry pointUsually invoked via oe; rarely imported directly
@openexpertise/skill-experience-creatorSkill definition filesThe bundled SKILL.md skill used by oe ultra

Quick start

ts
import { runExperience } from '@openexpertise/core'
import { parseExperienceYaml } from '@openexpertise/schema'
import { DispatcherRegistry } from '@openexpertise/core'
import { ToolDispatcher } from '@openexpertise/node-kinds-tool'
import { AgentDispatcher, AnthropicLLMClient } from '@openexpertise/node-kinds-agent'
import { readFileSync } from 'node:fs'

const spec = parseExperienceYaml(readFileSync('experience.yaml', 'utf8'))

const client = new AnthropicLLMClient()
const dispatchers = new DispatcherRegistry()
dispatchers.register(new ToolDispatcher())
dispatchers.register(new AgentDispatcher({ client }))

const result = await runExperience({
  spec,
  experienceDir: process.cwd(),
  dispatchers,
})

console.log(result.status, result.finalState)

In this section

Released under the MIT License.