Declarative YAML Configuration
Decouple metadata from Python code using YAML declarations.
Declarative Configuration (YAML)
For enterprise scenarios, separate protocol metadata from code using a landmarks.yaml file:
yaml
global_aliases:
user_id: [uid, customer_id, user]
landmarks:
- id: compute
description: "Virtual machine management"
type: navigation
tools:
- id: compute:toggle_power
description: "Toggle VM power state"
type: action
remedy: "Check valid instance IDs with inspect_landmark"
parameters:
- name: instance_id
type: string
description: "The unique VM identifier"
required: true
- name: state
type: string
description: "Desired state: 'on' or 'off'"
options: ["on", "off"]Clean Python Decorators (Metadata Inheritance)
💡 TIP
When using
MetadataRegistry with a YAML file, you do not need to duplicate metadata in the Python decorators. The decorators only require the action_id. Elemm automatically inherits description, parameters, remedies, and instructions from the YAML file.This separates the API declaration from the implementation, making your Python code extremely clean:
python
# The YAML file defines description, remedy, and parameter constraints.
# The Python decorator only binds the function to the ID.
@manager.landmark("compute:toggle_power")
async def toggle_power(instance_id: str, state: str):
# Business logic here...
return {"status": "success", "new_state": state}Available YAML Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique ID. Use namespace:action_name for hierarchy |
description | string | Description shown to the agent |
type | string | "navigation" (namespace) or "action" (executable) |
remedy | string | SmartRepair hint on errors |
instructions | string | Behavioral guidelines injected on inspection |
priority | int | Sort weight (1 = highest priority) |
returns | string | Description of the return value |
response_schema | object | JSON Schema of the return object |
parameters | list | Parameter definitions |