Kaya Language Documentation
Where AI generation and traditional programming meet
This book covers the Kaya language: writing programs, working with AI, and building agents. For installation, model configuration, and command-line setup, see the separate Installation Guide.
Quick Start
š¤ For AI agents: Skill for Agents ā condensed syntax reference
šØāš» For developers: Getting Started ā a quick tour of the language
Look for Run in Browser ā beneath selected snippets. Each opens an editable, complete example; some include extra variables or helper files beyond the short documentation fragment. Examples marked Text model required use the model and API key you configure in the browser IDE's Settings.
Documentation Sections
š¤ AI Language Features
Work with model-powered types, conversations, and semantic reasoning.
- Type System - Model-powered type coercion and structured output
- Chat Output - Bare strings, speaker roles, and multi-modal messages
- Fuzzy Logic - AI-powered language features: is, as, pick, and vary
⨠Generation
Generate text, images, speech, and video from your Kaya programs.
- Generating Text - Prompts, model aliases, conversation history, and tools
- Generating Images - Image prompts, sizes, and variations
- Generating Speech - Voices, delivery, and audio output
- Generating Video - Text-to-video and image-to-video
šØ Rendering
Turn authored content into diagrams, documents, images, and ebooks.
- Rendering Text - Plain text from Kaya templates
- Rendering Mermaid - Print-safe SVG diagrams
- Rendering PDF - Paginated documents and print layouts
- Rendering HTML - Static HTML from React and TSX
- Rendering Images - PNG and JPEG captures of HTML
- Rendering Ebooks - EPUB and AZW3 output
- Resizing Images - Image dimensions and formats
š ļø Agents
Build agents that use tools and follow reusable execution profiles.
- Tool Calling - Give models access to Kaya functions and admitted tools
- Native Coding Profiles - Configure coding agents and their workflows
š Integrations
Run interactive Kaya programs in agent clients without moving execution out of Kaya.
- ACP - Expose a Kaya job through the Agent Client Protocol and accept session MCP tools
- Buzz - Connect Kaya agents, try runnable examples, and host the workspace
š” Interesting Bits
Explore events, session playback, and templating.
- Events - Emit and await structured events
- The Timeline - Channels, scheduling, and session playback
- Templating - Variables, expressions, and Liquid filters inside strings
š Language Details
Learn Kaya with practical guides and look up syntax, types, operators, and built-in functions.
- Syntax Basics - Variables, expressions, and core features
- Type System - Built-in types, custom definitions, arrays, and constraints
- Functions - Defining and calling functions, parameters, closures
- Control Flow - If statements, loops, break/continue
- Syntax Reference - Complete syntax specification
- Standard Library - Built-in functions (generate, generateImage, etc.)
- Annotations - Metadata system (#writeIsolated, #debug, etc.)
- Operators - All operators, precedence, and behavior
- Built-in Types - Type system, modifiers, and validation
Looking for best practices, the quick reference card, and common pitfalls? Those now live in the Skill for Agents.
Documentation Philosophy
This documentation is organized by use case rather than implementation:
- Learning? Start with Language Details.
- Looking something up? Use the reference pages within Language Details.