Skip to content
Hierarchical Temporal Memory Models Cluster implementation
Scala Java Shell HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Hierarchical Temporal Memory Models Cluster implementation

What is Htm-Moclu?

Short for Hierarchical Temporal Memory Models Cluster. Numenta presented HtmEngine which is a set of long-running services upon which a scalable, real-time, and production-ready scalar anomaly detection application may be built. As-is, HtmEngine is only configured to be scaled vertically. Htm-Moclu provides a similar platform for applications, and has the ability to scale horizontally using multiple servers.

You can have several Web servers and several servers just to handle model data all of them working as a Cluster.


  • Models, anomaly detection, and prediction provided by
  • Cluster implemented using Akka Cluster + Sharing + Persistence
  • Data store: Mongodb
  • Rest API: Lift Framework (moclu-http)





After installing MongoDB you will need to start mongod service and use default settings, otherwise you will need to configure application.conf

Starting the cluster

git clone
cd htm-moclu
sbt publishLocal
sbt console

Starting the Web server

cd htm-moclu/moclu-http
sbt ~container:start

Using the REST API

####Create model - Endpoint ####

/create/{model id}



  • Request Payload
{ }
  • Response
  "msg":"Htm Model 24StreetSensor created"

####Send data - Endpoint #### /event/{model id}



  • Request Payload
  "timestamp":"7/2/10 1:11" 
  • Response
  "msg":"Applied event Htm Model 24StreetSensor",

####Get submitted data - Endpoint #### /getData/{model id}



  • Request Payload
{ }
  • Response

Few examples using wget

  • Create
wget -O- --post-data='{}' --header=Content-Type:application/json "http://localhost:8080/create/24StreetSensor"
  • Send event data
wget -O- --post-data='{"value":13.2,"timestamp":"7/2/10 1:16"}' --header=Content-Type:application/json "http://localhost:8080/event/24StreetSensor"
  • Get events data
wget -O- --post-data='{}' --header=Content-Type:application/json "http://localhost:8080/getData/24StreetSensor"

Setting up the Cluster

Configuring MongoDB

To set the IP address where you have MongoDB running just add the following parameter to SBT:


For example having Mongo running on the config will look like


This configuration is the same for all nodes.

Cluster Seeds

You can have one or more seeds for your Cluster, you can start trying with just one.

add the following parameter to SBT:


In the case you have the Seed running on, after modifying:


If you want to add more seed nodes you will need to update the application.conf and add more parameters.

Local IP

Finally we need to specify the local IP with the following parameter


In case you are starting the node in

Putting all together

$ sbt -Djava.library.path=./sigar -DHOST= -DSEEDHOST= -DMONGOHOST= -Xmx8096M -Xss2M
You can’t perform that action at this time.