Skip to main content

Agent Definition Compiler for Ainalyn Platform

Project description

Ainalyn SDK

Python 3.11+ License: MIT Documentation

Agent Definition Compiler for the Ainalyn Platform

Ainalyn SDK helps you define, validate, and export task-oriented agents using a clean Python API. Think of it as a compiler: you describe what your agent does, the SDK validates it, and outputs a platform-ready YAML file.

Note: This SDK is a compiler, not a runtime. It creates agent descriptions—the Ainalyn Platform handles execution.

Why Ainalyn SDK?

  • Type-safe Builder API - Define agents with IDE autocomplete and compile-time checks
  • Comprehensive Validation - Catch errors before deployment
  • YAML Export - One-line compilation to platform-ready format
  • Clean Architecture - Well-tested, maintainable codebase

Quick Start

Installation

pip install ainalyn-sdk

Your First Agent

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 a simple 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 message")
            .uses_prompt("greeting-prompt")
            .outputs("greeting")
            .build()
        )
        .entry_node("generate-greeting")
        .build()
    )
    .build()
)

# Validate and export
result = validate(agent)
if result.is_valid:
    yaml_output = export_yaml(agent)
    print(yaml_output)

Output:

# Ainalyn Agent Definition
# This file is a description submitted to Platform Core for review.
# It does NOT execute by itself. Execution is handled by Platform Core.
#
# Local compilation does NOT equal platform execution.

name: greeting-agent
version: 1.0.0
description: Generates personalized greetings
workflows:
- name: greet-user
  description: Main greeting workflow
  entry_node: generate-greeting
  nodes:
  - name: generate-greeting
    description: Generate a personalized greeting message
    type: prompt
    reference: greeting-prompt
    outputs:
    - greeting
prompts:
- name: greeting-prompt
  description: Generates a personalized greeting
  template: Generate a personalized greeting for {{user_name}}
  variables:
  - user_name

Submitting Agents to Platform

After compiling your agent, submit it directly to the Ainalyn Platform for review:

from ainalyn import AgentBuilder, submit_agent, track_submission

# Build your agent
agent = (
    AgentBuilder("my-agent")
    .version("1.0.0")
    .description("My awesome agent")
    # ... add workflows, prompts, tools ...
    .build()
)

# Submit for review
result = submit_agent(agent, api_key="your_api_key")
print(f"Review ID: {result.review_id}")
print(f"Track at: {result.tracking_url}")

# Check submission status
status = track_submission(result.review_id, api_key="your_api_key")
if status.is_live:
    print(f"Agent is live: {status.marketplace_url}")

Important:

  • SDK can submit but NOT approve - Platform Core has final authority
  • Submission does NOT create an Execution
  • Submission does NOT incur billing (unless platform policy states)
  • Get your API key at: https://console.ainalyn.io/api-keys

See examples/submit_agent_example.py for a complete walkthrough.

CLI Usage

# Validate an agent definition
ainalyn validate my_agent.py

# Compile to YAML
ainalyn compile my_agent.py --output agent.yaml

Documentation

Full Documentation - Complete guides, API reference, and examples

Quick Links:

Examples

Check out the examples/ directory:

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

For newcomers, look for issues labeled good first issue.

Requirements

  • Python 3.11, 3.12, or 3.13
  • PyYAML >= 6.0

License

MIT License - see LICENSE file for details.

Support


Built by the CoreNovus Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ainalyn_sdk-0.1.0a2.tar.gz (70.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ainalyn_sdk-0.1.0a2-py3-none-any.whl (86.0 kB view details)

Uploaded Python 3

File details

Details for the file ainalyn_sdk-0.1.0a2.tar.gz.

File metadata

  • Download URL: ainalyn_sdk-0.1.0a2.tar.gz
  • Upload date:
  • Size: 70.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ainalyn_sdk-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 60308c6764c97c0e719564cbdae139d8f003a4aecd69585865ee76d9e637c1c4
MD5 b97fe9a8701cfeb78c45094506b9e1e6
BLAKE2b-256 b5a84c57128be62d8f49e2a1fe61bd4efd94ca0a44fa0e982f7ee248b6d03575

See more details on using hashes here.

Provenance

The following attestation bundles were made for ainalyn_sdk-0.1.0a2.tar.gz:

Publisher: release.yml on CoreNovus/ainalyn-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ainalyn_sdk-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: ainalyn_sdk-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 86.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ainalyn_sdk-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 e9bb81ae4636aef54b913bbec92b6b631d1edc2c1f022c835921f2b20a8677e2
MD5 fa42965c0cb196bd8e3630cf421985d5
BLAKE2b-256 9c2dd54135de14a42a6388a50199dd3fdf19025e277efcfca4733edb7682db3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ainalyn_sdk-0.1.0a2-py3-none-any.whl:

Publisher: release.yml on CoreNovus/ainalyn-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page