- Roboy Memory Module
This repository contains a memory module developed to use for Roboy, humanoid robot. The goal of the project is to provide Roboy with modern graph-based Knowledge Representation.
Roboy should feature the ability to remember information about himself: his name, his age, his origin, his location, his friends, etc.
The same is applicable to Roboy, when speaking about people who are his friends. Roboy should be able to tell information about a person or an object and be able to provide basic automatic inference (supported by the graph nature of KR). This way, Roboy Memory Module serves as a long-term memory repository of actionable information acquired by other Roboy modules. Persistency layer is presented by a Neo4j graph database.
Upon incoming request, a Java client will pre-process the request and initiate transaction with the database. Two ways of communication between Roboy Java client and Neo4J database are supported: communication using Neo4J driver operating Cypher query language and Neo4J native Java API. Cypher query language offers more flexible querying while communications via Neo4J Java API are implemented as usage-specific routines. Interfaces are implemented on top of ros through the Java client. The input is any type of information Roboy can retrieve from environment abiding by Knowledge Representation reference in format of Roboy Communication Standard protocol, the output are pieces of data related to the requested scope in the same form.
For a more indepth look into how Roboy Memory works, please see the Documentation
- Neo4J
- Docker installation highly recommended
- Git
- Maven
- Java 8
- ROS
- Ros Requires Ubuntu 16.04 LTS or Mac OSX
- Redis
- IntelliJ
- Roboy's IDE of choice
In the event that you do not require Neo4J or do not wish that the Neo4J tests execute (ie. situations with no internet connection and only remote instance setup), you can have the Neo4J tests ignored.
Simply append -D neo4jtest=false
to your maven command.
Example: mvn clean install -D neo4jtest=false
, mvn test -D neo4jtest=false
This shall disable
org.roboy.memory.util.Neo4jTest
from running
A detailed guide can be found for the latest version of memory here.
Simply run mvn clean install
in the roboy_dialog
folder, it will build memory and all dependencies for you.
Note that
Neo4J
must be running while using roboy_dialog. Do not forget to set your environmental variables.
There is little reason to do this anymore. Roboy Dialog automatically builds and installs Memory and there is little reason to run memory without dialog. Only do this if you are absolutly sure that you have to.
- Set Environmental Variables
- Install all neccessary dependencies
sudo apt-get install docker.io git maven openjdk-8-jdk
- Download and run the Neo4J Docker Image
sudo docker run --publish=7474:7474 --publish=7687:7687 --volume=$HOME/neo4j/data:/data --volume=$HOME/neo4j/logs:/logs neo4j:3.4
- Clone the Git Repo
git clone https://github.com/Roboy/roboy_memory -b master
- Change directory into roboy memory
cd roboy_memory
- Use maven to install roboy memory
mvn clean install
- Run memory
java -jar target/roboy_memory-1.1.0-jar-with-dependencies.jar
The roboy team runs a remote Neo4J instance. If you wish to have a copy of this for local testing purposes, you can find more info here.
As one may wish to develop offline or perform risky tests, that may compromise database integrity, it is possible to generate a sample set of data. To do this, simply run the main method of org.roboy.memory.data.Generator
. It will also generate a copy of the Roboy nodes, that Dialog uses. Each node that is created has a Generated
property, with the version number of the generated data.
Note: You will still be required to set up the environmental variables.
You can remove generated data, by running the following command MATCH (node2delete {generated: '0.0.2'}) DETACH DELETE node2delete
. If you only want to delete nodes of a specific kind, such as Person
s, run MATCH (node2delete:Person {generated: '0.0.2'}) DETACH DELETE node2delete
.
If you don't care and wish to remove all generated data across versions, use MATCH (node2delete) WHERE EXISTS(node2delete.generated) DETACH DELETE node2delete
.
Be aware, that these commands do not care about your existing data and may break things. It is advisable to read up the Neo4J Cypher documentation and making sure that all side effects are understood.