How to come up with Autonomous Agents Ideas

in #obyte5 years ago (edited)

Since I've been seeing a few registry related Obyte Autonomous Agents (AA) turning up recently again.  Thought it would be a good idea to go over the thinking process I have used when I first submitted the OAAAAA concept during the contest's first round back in early Aug and revised version in mid Aug.  The latest full version is at the bottom.

Let start with an AA idea

In order to come up with an AA, some starts off thinking about a vending machine; but I tend to think first in terms of what people would likely need or want to use and whether the functionalities required to make the idea work can be decentralized.  I think this way it's easier to come up with practical ideas and allows me to defer the difficulties of the implementation, then for each piece I can think about how to implement these functionalities in Oscript, and then finally how to connect these to make the whole thing work.

The Basic Structure of an AA

To me, Oscript is a JSON based declarative structure, so it is helpful to me to develop and test each functionality individually, and then fit each part into the final structure.  I think that's one of the reason why I have been using flow charts more than start to write code immediately to develop AA.  Also, it helps to visualize how the whole thing will work in the end, even if I have lots of complicated moving parts like the REDvsBLUE AA which passes messages between multiple AAs.

In Conclusion

It's quite easy to come up with ideas for AA if I think in terms of functionalities, and if we use the divide and conquer method, we can surely make these ideas a reality.

{ messages:
// OAAAAA Obyte Autonomous Autonomous Agent Address Agent by [email protected]
// an address registry and router that allows updates & transfer of address/properties, see below USAGE
// please note : before registering an new AA or transfer ownership of an existing AA
// ***MAKE SURE*** to add ```var[ 'authors' ] = <author submission address>;``` to the new AA app : `state`
// as it will be the only address allowed to make future transfer
{ cases: [
{
if: "{
$checkaddress = trigger.data.address;
if ( !$checkaddress ) bounce( 'input: { address : address , [ data : passthur_data ] , [ newaddress : newaddress ] , [ checkonly : false ] }' ); // USAGE
// doesn't matter if checkaddress is valid or not because it will bounce when routing to the invalid address

$logicaladdress = var[ $checkaddress ];
if ( $logicaladdress ){ // FOUND LOGICAL ADDRESS

$currentaddress = var[ $logicaladdress ]; // GET LATEST ADDRESS

$newaddress = trigger.data.newaddress;
if( $newaddress ){ // again doesn't matter if newaddress is valid or not , RECEIVED NEW ADDRESS

if( var[ $currentaddress ][ 'authors' ] == trigger.address ){ // CHECK OWNERSHIP
// transfer of arbitrary address types will be possible in the future when AA can explore DAG

$route = $newaddress; // ROUTE TO NEW ADDRESS
// actual ownership transfer done in app state

} else {
bounce( 'Trigger address does not match with var[ authors ] in ' || $currentaddress || ' which is require to make newaddress transfer' );
}
} else {
$route = $currentaddress; // ROUTE TO LATEST ADDRESS
}

}else{
$route = $checkaddress; // registration will be done at app state , ROUTE TO CHECK ADRESS FIRST TIME
}

if( trigger.data.checkonly ){ // CHECKONLY
if( $checkaddress != $route ) bounce( 'Please use latest address at ' || $route );
else bounce( 'This address ' || $checkaddress || ' is the latest');
}

// ROUTE with pass thur data
$route

}",
messages: [
{
app: 'payment',
payload: {
asset: 'base',
outputs: [
{ address: '{$route}' }
]
}
},
{
app: 'data',
payload: '{trigger.data}'
},
{
app: 'state',
state: `{

if( !$logicaladdress ){
var[ 'L' || $checkaddress ] = $checkaddress; // create logical address
var[ $checkaddress ] = 'L' || $checkaddress; // set checkaddress to logical address
$msg = ' a new address registration';
}
if( $newaddress AND $logicaladdress AND $currentaddress AND var[ $currentaddress ][ 'authors' ] == trigger.address ){
var[ $logicaladdress ] = $newaddress;
var[ $newaddress ] = $logicaladdress;
$msg  = ' address has been transferred from ' || $currentaddress;
}

response[ 'message' ] = 'Routing to ' || $route || $msg;

var[ 'authors' ] = '7MDNSRYFRLJ4PQMPD5TZPIO5JHCTYNQI';

}`
}
]
}
] } }

Coin Marketplace

STEEM 0.25
TRX 0.20
JST 0.035
BTC 95037.22
ETH 3446.03
USDT 1.00
SBD 3.46