Skip to content
The Cognitive Foundry is an open-source Java library for building intelligent systems using machine learning
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.

Cognitive Foundry


The Cognitive Foundry is an open-source Java library for building intelligent systems with a focus on machine learning. The Foundry's development is led by Sandia National Laboratories and is released under the open-source BSD license.

The Foundry contains four primary packages: Common, Learning, Text, and Framework. Common defines many of the basic interfaces and types in the Foundry. It also includes a linear algebra package and other generally useful Java utilities. Learning contains components and algorithms for machine learning and statistics. Text contains components and algorithms for text analysis and information retrieval such as topic modeling. Framework contains a framework for building multi-level models.

The Foundry requires Java 1.8 or later.


See License.txt for information about the license.


The latest version of the Cognitive Foundry can be downloaded from the GitHub site or official site. You can also get the jars from Maven Central using Maven or Ivy. The organization/groupId is gov.sandia.foundry.

Example Maven dependencies:


Example Ivy dependencies

    <dependency org="gov.sandia.foundry" name="gov-sandia-cognition-common-core"        rev="4.0.1"/>
    <dependency org="gov.sandia.foundry" name="gov-sandia-cognition-common-data"        rev="4.0.1"/>
    <dependency org="gov.sandia.foundry" name="gov-sandia-cognition-learning-core"      rev="4.0.1"/>
    <dependency org="gov.sandia.foundry" name="gov-sandia-cognition-text-core"          rev="4.0.1"/>
    <dependency org="gov.sandia.foundry" name="gov-sandia-cognition-framework-core"     rev="4.0.1"/>
    <dependency org="gov.sandia.foundry" name="gov-sandia-cognition-framework-learning" rev="4.0.1"/>


To compile the Foundry from source, you can use either the Ant or Maven build scripts.

Using Ant you can simply invoke the main build.xml file in the root directory by doing:

ant clean build

Using Maven you can invoke the pom.xml in the root directory by doing:

mvn clean package


The Foundry has four main packages some of which have multiple modules. Each module has a jar whos ename is prefixed with gov-sandia-cognition-.

  • common-core - Contains base interfaces and types, including classes for linear algebra.
  • common-data - Contains utilities for handling data.
  • learning-core - Contains algorithms and components for machine learning and statistics.
  • text-core - Contains algorithms and components for text analysis and Information Retrieval.
  • graph-core - Contains algorithms and components for graphs.
  • framework-core - Contains a framework for multi-level models.
  • framework-learning - Contains adapters for Machine Learning in the framework.

Example Code

Each of the four main packages has example code for how to get started with some of the basic components.

Common Package Examples

Learning Package Examples

Text Package Examples

Framework Package Examples

For more information about a specific class you can also look at the unit test for examples of how to create and use it.


Here are some useful contact points for the Foundry.

You can’t perform that action at this time.