Giter VIP home page Giter VIP logo

buttercup's Introduction

buttercup - small yet brave behavior tree engine written in Rust

NOTE: project is in early stages although happy to talk if you think contributing is something worth doing.

Concept

Behavior Tree is an abstraction widely used in gaming and robotics industry, it provides an easy to comprehend and extendable interface for designing complex behavior.

Buttercup aims to provide a platform for designing and running agents which can execute a complex behavior in the Web environment.

So instead of using actuators or performing actions in a game you can send emails, scrape the web, perform http requests, etc.

Background

Quite awesome book on BTs - basis for the ongoing implementation:

Handful of papers about Behavior Trees:

State of the project

The project is in first draft stages, so you will see greatly undertested code that will change frequently.

Please track the POC project for more details.

Behavior Trees Features

Here are some well known features that BTs implementations may have:

  • Subtrees
  • Blackboards
  • Reactive Nodes
  • Condition Decorator Nodes
  • Parametrized Trees and Subtrees
  • Stateful Nodes

Roadmap

After the POC we're going to have some more fun.

The most important part of the 1.0 version is getting the test coverage to 80% and a stable API.

After that, we should ask about the distributed mode, where each execution can be repeated, e.g. with at-least-once execution guarantees, so even if a node running a certain agent fails another can pick up almost at the point where the other ended and continue the execution.

This would allow to run a swarm of agents which could be orchestrated with or without a centralised source of truth with quite decent guarantees.

At the moment looking at Raft in a multi-raft variant, where agents would be partitioned and each partition would have 1 node selected as the leader but it's an early concept.

Potential use cases

Some visions on how this project can be used and specialize in the future, mentioned in order from most probable to most adventurous:

  • Pentesting: BTs allows for designing clear and auditable scenarios, where groups of agents can coordinate parts of the attack, e.g. on group hammers a given service for others to abuse the downtime in other parts of the system;
  • IoT: the engine is written in Rust and will run on whatever can execute async-await so potentially you could design BTs on the server and broadcast those to connected devices;
  • Web3: fast and lean implementation could provide desired latencies for crypto use cases.

Why buttercup?

Buttercup-pic

C'mon, small yet brave! :)

buttercup's People

Contributors

mrrabbitte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

radgli

buttercup's Issues

Repeat and Retry decorator nodes

  • repeat should fail on first failure and pass success after n successes;
  • retry should pass success on first success or fail after n retries;

Architectural layers should be separated and the interaction between them possible to define from the user level

Architecture layers should be separated and the interaction between them possible to define from the user level. The layers should include:

  • Connectors: various 'observers' on external systems, e.g. file system connector, email connector, GSuite connector;
  • Events: this layer should handle mapping between Connectors and Data Services such as Global Records Service and Blackboards Service;
  • Data: this should be directly accessible for Behavior Trees / Agents or any other automation;
  • Automation: BTs and any other automation abstractions should live here and use only the Data layer for receiving data.

Endpoints Service is an example of a Connector.

All of the layers should use the same Value space (buttercup-values).
image1

Mapping between the layers should be configurable by the end user, i.e. which events are put into which Record tables and which BTs will listen on those or use those in their processing.

Connectors Service that yields events

Connectors should produce events which in turn should be consumed by:

  • records service;
  • local / global blackboard services;
  • analytics service.

Endpoints service should emit event as one of the Connectors. Mapping of events to internal data processors should be easy to configure, there should be a shorthand for linking Endpoint services to a family of local blackboards.

There should be a global records service

Record is just a set of named Values.
This is just a BT adapter layer over SQL-like databases.

Materialize.io looks promising as you can subscribe to queries which allows for reactive conditions over query results.

Fix: Agent tests

buttercup-agents test fails because of the Arbiter vs. actix_rt runtime mismatch

Root Nodes

Root nodes should be able to execute the tree:

  • one-off: once and then off;
  • until-stopped: despite fails it will repeat;
  • to-first-fail: will repeat unless there's a failure or error returned;
  • reactive-condition: until some condition is true.

Transform response states decorator nodes

Decorator nodes for transforming states from the child nodes:

  • reverse, i.e. success -> failure, failure -> success;
  • ignore failure, i.e. failure -> success;
  • error as failure, i.e. error -> failure;
  • always success.

Exclude tests from blackboards

The tests write to the hard drive and as those currently pass locally there's a problem with running them in Github Actions.

Endpoint Service

Endpoint service that is configurable with different extraction strategies that will push values to other services and will allow for transformations of provided data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.