Skip to content

yggdrasil.loki.skill

skill

Loki skills — the pluggable unit of agent capability.

A :class:LokiSkill is one thing Loki can do: ask Genie, run SQL, fetch a table, browse the web, scaffold a project, drive a cloud service. Skills declare whether they're :meth:available in the current environment (so a Databricks-only skill stays dark on a bare shell) and implement :meth:run. They register into a global table so the CLI and the agent can discover and dispatch them by name.

This is the abstraction; concrete skills land on top of it.

LokiSkill

Bases: ABC

One discoverable, environment-aware capability Loki can perform.

available

available(agent: 'Loki') -> bool

True when this skill can run in agent's environment.

Default: available everywhere, unless :attr:requires names a backend that isn't detected. Override for finer checks.

run abstractmethod

run(agent: 'Loki', **kwargs: Any) -> Any

Perform the skill, using agent as the capability/token provider.

register

register(skill: 'type[LokiSkill] | LokiSkill') -> 'type[LokiSkill] | LokiSkill'

Register a skill (class or instance) by its name.

Usable as a decorator on a :class:LokiSkill subclass::

@register
class Echo(LokiSkill):
    name = "echo"
    def run(self, agent, **kw): return kw

registry

registry() -> list['LokiSkill']

All registered skills, sorted by name.