The idea is to have agents that expose APIs formed as a stock of building blocks -or features- that can be shared by other agents so they learn
from each other.
HES was built from these requirements:
- The simplicity of a uniform Interface
- Portability of components by moving from program code to data
- Visibility of features by other service agents
HES agents expose Hypermedia APIs, including the necessary information to navigate the functionality via including links with the responses. When using Hypermedia APIs, a client can discover the interfaces, which is particularly useful when clients and servers need to evolve independently. Also allows highly personalized APIs, shaping them according to the data.
An excellent Hypermedia APIs introduction here.
The HES agents use N3 Logic. Notation N3 is a rule-based language defined as a superset of turtle that adds support for additional constructs. Is possible, for instance, to describe a set of rules to generate new knowledge, extending the data we have
{ ?bob is:ancestor ?maria } => { ?maria is:descendent ?bob }.
The rules are stated using curly brackets {}
and the implication symbol =>.
In a typical reasoning operation, one combines data with rules and a query. The results are then serialized in Json-LD to be consumed by applications. An agent might also expose their knowledge artifacts and features through the URLs.
@TODO
By default, the API is defined using index.json
files to be recursively read from a directory. There are some examples.
Note: (To try the application without installing EYE reasoner, you can use the Docker version below)
API
Dependency graph
Built-in applications:
First of all, you need to install the EYE reasoner (Windows – OS X – Linux).
Alternatively, install it from the source
(make sure that you can run this using '/bin/sh eye,' or set the EYE_PATH environment variable)
Then, install the server package as follows:
$ [sudo] npm -g install hes-agent
hes serve <directory>
More options with
hes --help
The workspace folder contains examples on what kind of things can be declared.
To see the results do:
hes serve ./workspace
and point your browser to:
http://localhost:3000
Then 'follow the links'
Operations and dependency graph:
http://localhost:3000/dataspaces/operations
docker run --name=hes-agent -p 3000:3000 -v $PWD/workspace:/usr/src/app/workspace cristianvasquez/hes-agent -t
Running your image with -d runs the container in detached mode, leaving the container running in the background. The -p flag redirects a public port to a private port inside the container. The -v flag mounts a directory to a directory inside the container.
If you need to go into the container you can use the exec command:
docker exec -it hes /bin/bash
docker rm -f hes-agent
curl -i localhost:3000
docker build . -t YOUR_USERNAME/hes-agent
(to build a clean image from scratch use the --no-cache option)