Ainalyn SDK
Build task-oriented agents with Python. The Ainalyn SDK is compiler-first and turns your code into platform-ready agent definitions.
SDK = Compiler-First
The SDK creates agent descriptions and offers an optional runtime wrapper for ATOMIC handlers. The Ainalyn Platform executes and governs.
User Flow
What it does
- Define agents with a Python API
- Validate with schema checks, review gates, and static analysis
- Export to YAML for the platform
Features
- Type-safe API - Full type hints and IDE autocomplete
- Fluent builders - Chainable, intuitive API
- Validation - Catch errors before deployment
- Runtime wrapper (optional) - Wrap ATOMIC handlers for Core invocation
- YAML export - One command to platform-ready format
Example
from ainalyn import AgentBuilder, WorkflowBuilder, NodeBuilder, PromptBuilder
from ainalyn.api import validate, export_yaml
# Define a prompt
greeting_prompt = (
PromptBuilder("greeting-prompt")
.description("Generates a personalized greeting")
.template("Generate a personalized greeting for {{user_name}}")
.variables("user_name")
.build()
)
# Define an agent
agent = (
AgentBuilder("greeting-agent")
.description("Generates personalized greetings")
.version("1.0.0")
.add_prompt(greeting_prompt)
.add_workflow(
WorkflowBuilder("greet-user")
.description("Main greeting workflow")
.add_node(
NodeBuilder("generate-greeting")
.description("Generate a personalized greeting")
.uses_prompt("greeting-prompt")
.outputs("greeting")
.build()
)
.entry_node("generate-greeting")
.build()
)
.build()
)
# Validate and export
validate(agent)
yaml_output = export_yaml(agent)Getting Started
New to the SDK?
- Install the SDK
- Try the 5-minute quickstart
- Build your first agent
Understanding the SDK
- Platform Boundaries - What the SDK can and cannot do
- Compiler vs Runtime - Why the SDK is a compiler
- Architecture - How it’s built
- Agent Definitions - What you’re creating
Important: SDK Boundaries
The SDK creates descriptions. The platform runs them.
What the SDK does:
- Define agent structures
- Validate definitions
- Export to YAML
What the SDK does NOT do:
- Execute agents
- Handle billing
- Manage retries or timeouts
Learn more about platform boundaries