# Definition

### **Arguments**

* **address** `string` *required*\
  Address of the definition
* **definition** `array` *required*\
  Definition of the autonomous agent

### Returns

Returns the unit hash.

### Example

```javascript
const { Client, utils } = require('obyte');

const client = new Client('wss://obyte.org/bb-test', { testnet: true });

const definition = [
  'autonomous agent',
  {
    bounce_fees: {
      base: 10000
    },
    messages: [
      {
        app: 'payment',
        payload: {
          asset: 'base',
          outputs: [
            {
              address: "{trigger.address}",
              amount: "{trigger.output[[asset=base]] - 1000}"
            }
          ]
        }
      }
    ]
  }
];

const params = {
  address: utils.getChash160(definition),
  definition
}

client.post.definition(params, wif, function(err, result) {
  if (err) return console.error(err);
  console.log(result);
});
```

The above example of an AA just sends the received money less 1000 bytes back to the sender.&#x20;

### **Learn more**

* "Getting started guide": <https://developer.obyte.org/autonomous-agents/getting-started-guide>
* "Oscript language reference": <https://developer.obyte.org/autonomous-agents/oscript-language-reference>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://obytejs.com/0.1.14/post/definition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
