Skip to content

SvenLieber/HES-Agent

 
 

Repository files navigation

HES agent, data driven applications

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:

  1. The simplicity of a uniform Interface
  2. Portability of components by moving from program code to data
  3. Visibility of features by other service agents

Simplicity of a uniform Interface

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.

Portability of components by moving from program code to data

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.

Visibility of features by other service agents

@TODO

Current operations

By default, the API is defined using index.json files to be recursively read from a directory. There are some examples.

classes_all.svg

Running the agent

Note: (To try the application without installing EYE reasoner, you can use the Docker version below)

Default entry points

API

Dependency graph

Built-in applications:

Running it as command line

First of all, you need to install the EYE reasoner (WindowsOS XLinux).

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

Running

hes serve <directory>

More options with

hes --help

Examples

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

Run with docker

Start HES on host port 3000:

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:

Enter the container

docker exec -it hes /bin/bash

Stop the docker container

docker rm -f hes-agent

Test if it's up

curl -i localhost:3000

Build your own image

docker build . -t YOUR_USERNAME/hes-agent

(to build a clean image from scratch use the --no-cache option)

Anatomy of the agent

About

HES agent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.6%
  • HTML 7.4%
  • Other 1.0%