Skip to content
A framework for integrated Artificial Intelligence & Artificial General Intelligence (AGI)
Branch: master
Clone or download
#74 Compare This branch is 42 commits ahead, 144 commits behind opencog:master.
vsbogd Merge pull request #67 from ngeiswei/oc-to-sn
Merge opencog/opencog to singnet/opencog
Latest commit fda2fd4 Mar 13, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci First Checkout AtomSpace then restor Cache Jan 17, 2019
doc Remove obsolete libspatial and MapTools documentation. Aug 8, 2018
examples Juice up logger settings for debugging Feb 28, 2019
lib Update Vagrantfile Jan 2, 2019
opencog Merge branch 'master' into oc-to-sn Mar 7, 2019
scripts Remove temporary miner specifics from Nov 23, 2018
tests Improve support for patterns with joint variables Feb 28, 2019
.gitignore git ignore chatscript files Sep 14, 2017
.gitmodules Merge branch 'master' into oc-to-sn Mar 7, 2019
AUTHORS Revert "fixed fedora pattern install for development tools" Apr 13, 2015
CMakeLists.txt Fix error when packaging Dec 19, 2018
HACKING Revert "remove everything except the util directories" Apr 28, 2015
LICENSE Revert "Additional clearnup" Apr 28, 2015 Add README link to circleci build Aug 2, 2018



OpenCog is a framework for developing AI systems, especially appropriate for integrative multi-algorithm systems, and artificial general intelligence systems. Though much work remains to be done, it currently contains a functional core framework, and a number of cognitive agents at varying levels of completion, some already displaying interesting and useful functionalities alone and in combination.

The main project site is at


OpenCog consists of multiple components. At its core is a (hyper-)graph database, the AtomSpace, which is used for representing knowledge and algorithms, providing a surface on which learning and reasoning algorithms are implemented. The AtomSpace consists of an in-RAM database, a "query language" aka "pattern matcher", a (ProLog-like) rule system, including forward and backward chainers, and an evaluator for the internal "programming langauge", Atomese. This language is not really meant to be used by humans (although, defacto, it is) but rather, it is a language for representing knowledge and algorithms, on which (automated) reasoning and learning can be performed. The AtomSpace also provides Scheme (guile) and Python bindings. The AtomSpace is maintained in a separate git repo:

This git repository contains assorted projects that are central to the OpenCog project, but are not yet mature or stable, and are subject to active development and experimentation. These include:

  • An assortment of natural language processing subsystems, including: -- Natural language generation (for expressiong thoughts as sentences). -- Natural language input (for reading and hearing). -- Assorted chatbots, some of which are embodied.
  • PLN, a probabilistic reasoning and inference system.
  • Attention Allocation, for managing combinatoric explosion during reasoning and language generation.
  • Space-time servers, for managing spatial and time data (grounding common-sense natural language concepts such as "next-to", "nearby", and "soon".)
  • An embodiment subsystem, attaching language to visual and auditory senses. This is primarily located in the ROS Behavior Scripting repository.
  • OpenPsi, a model of psychological states. Its currently a mashup of two unrelated ideas: a generic rule-class selection and plannning system, and a model of human psychological states. An open to-do item is to untangle these two.
  • An unsupervised learning system or "pattern miner", for extracting "surprising" patterns.
  • A supervised learning system, MOSES, for extracting patterns from tabular data. This is located in a seprate repository, MOSES.
  • The CogServer, a network server providing shell access and a REST API.
  • Several (obsolete!?) data visualization subsystems.

With the exception of MOSES and the CogServer, all of the above are in active development, are half-baked, poorly documented, mis-designed, subject to experimentation, and generally in need of love an attention. This is where experimentation and integration are taking place, and, like any laboratory, things are a bit fluid and chaotic.

Building and Running

For platform dependent instruction on dependencies and building the code, as well as other options for setting up development environments, more details are found on the Building Opencog wiki.

There is no single "demo" or system that can be "run"; rather, the various subsystems can be run individually, or together. The single most-fully-integrated, complete demo would be the embodied Hanson Robotics chat subsystem. This can be run without having an actual robot; a virtual Blender animation may be used instead; a webcam and microphones are required for sensory input. Portions of this system can be found in the nlp directory, in this repo, as well as the ROS Behavior Scripting repo. The full setup is located in the Hanson Robotics HEAD repo, and ready-to-run Docker images can be found in the OpenCog Docker repo.


To build and run OpenCog, the packages listed below are required. With a few exceptions, most Linux distributions will provide these packages. Users of Ubuntu 14.04 "Trusty Tahr" may use the dependency installer at /scripts/octool. Users of any version of Linux may use the Dockerfile to quickly build a container in which OpenCog will be built and run.


Common OpenCog C++ utilities It uses exactly the same build procedure as this package. Be sure to sudo make install at the end.


OpenCog Atomspace database and reasoning engine It uses exactly the same build procedure as this package. Be sure to sudo make install at the end.


Library for generating UUID's Used by various internal subsystems. sudo apt-get install uuid-dev

Optional Prerequisites

The following packages are optional. If they are not installed, some optional parts of OpenCog will not be built. The CMake command, during the build, will be more precise as to which parts will not be built.

Link Grammar

Natural Language Parser for English, Russian, other languages. Required for natural language generation, and the chatbot.


MOSES Machine Learning It uses exactly the same build proceedure as this package. Be sure to sudo make install at the end.


3D occupancy grid mapping library Required for the robot perception subsystem. sudo apt-get install liboctomap-dev

Obsolete Prerequisites

The following packages are needed to build some of the old, obsolete packages.


C++ HTTP RESTful interfaces Used by the Pattern miner for distributed processing (this will be replaced by gearman in future releases). sudo apt-get install libcpprest-dev

Threading Building Blocks

C++ template library for parallel programming Used to implement the optional REST API. (TODO: the REST API should be refactored to not use TBB) sudo apt-get install libtbb-dev

Building OpenCog

Perform the following steps at the shell prompt:

    cd to project root dir
    mkdir build
    cd build
    cmake ..

Libraries will be built into subdirectories within build, mirroring the structure of the source directory root.

Unit tests

To build and run the unit tests, from the ./build directory enter (after building opencog as above):

    make test

CMake notes

Some useful CMake's web sites/pages:

The main CMakeLists.txt currently sets -DNDEBUG. This disables Boost matrix/vector debugging code and safety checks, with the benefit of making it much faster. Boost sparse matrixes and (dense) vectors are currently used by ECAN's ImportanceDiffusionAgent. If you use Boost ublas in other code, it may be a good idea to at least temporarily unset NDEBUG. Also if the Boost assert.h is used it will be necessary to unset NDEBUG. Boost ublas is intended to respond to a specific BOOST_UBLAS_NDEBUG, however this is not available as of the current Ubuntu standard version (1.34).

-Wno-deprecated is currently enabled by default to avoid a number of warnings regarding hash_map being deprecated (because the alternative is still experimental!)

You can’t perform that action at this time.