Sample — Getting Started

Quickstart

Build and deploy your first AI agent on Kraken AI in under five minutes. This guide walks through installation, agent creation, guardrail configuration, and deployment.

Installation

Install the Kraken CLI and Python SDK. The CLI provides scaffolding, local development, testing, and deployment commands. The SDK provides the agent runtime and decorator-based API.

pip install kraken-ai

# Verify the installation
kraken --version
kraken-ai v0.12.0

Create your first agent

The SDK provides three layers of abstraction. For this quickstart, we use Layer 2 — the decorated Python API — which gives you platform integration via decorators while keeping full control over your logic.

logic/graph.py
from kraken import Agent, perceive, act, guardrail
from kraken.types import PriceChangeEvent, RestockRecommendation

class MarketIntelligence(Agent):
    name = "market-intelligence"
    version = "1.0.0"

    @perceive(source="ebay-marketplace", event="price_change")
    async def on_price_change(self, event: PriceChangeEvent):
        analysis = await self.analyze_market(event)
        if analysis.arbitrage_detected:
            await self.alert(analysis)

    @perceive(schedule="*/5 * * * *")
    async def periodic_scan(self):
        prices = await self.connectors.ebay.get_prices(
            self.config.categories
        )
        return await self.analyze(prices)

    @act(permission="workflow:trigger-restock")
    @guardrail(require_approval_when="impact > threshold")
    async def trigger_restock(self, rec: RestockRecommendation):
        await self.workflows.trigger("restock", rec)

The @perceive decorator registers data sources and triggers. The @act decorator declares permissions for outbound actions. The @guardrail decorator attaches safety policies that the platform enforces at runtime — not the agent itself.