Executable Code
Executable Code
Functions, agents, workflows, and execution runtimes
The Executable Code layer brings MDX documents to life with TypeScript functions, AI agents, event-driven workflows, and multiple execution runtimes.
Core Concepts
Function
AI function definitions with four variants:
- CodeFunction - Deterministic TypeScript
- GenerativeFunction - LLM-generated responses
- AgenticFunction - Multi-step AI reasoning
- HumanFunction - Human-in-the-loop approval
See the Function overview.
Agent
Autonomous AI entities with roles, goals, and team coordination.
See the Agent overview.
Workflow
Event-driven business logic using the $ context:
See the Workflow overview.
Packages
mdxe
Execute MDX in various runtimes:
- @mdxe/workers - Cloudflare Workers (and local dev under Miniflare)
- @mdxe/hono - Hono web framework
- @mdxe/ink - Terminal UI
See the mdxe overview.
mdxai
AI integrations:
- @mdxai/claude - Claude AI with MCP tools
- @mdxai/mastra - Mastra agent framework
- @mdxai/vapi - Voice AI
See the mdxai overview.