MCPcopy Index your code
hub / github.com/algorithmfoundry/Foundry

github.com/algorithmfoundry/Foundry @CognitiveFoundry-4.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release CognitiveFoundry-4.0.1 ↗ · + Follow
18,016 symbols 78,503 edges 2,040 files 12,745 documented · 71%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cognitive Foundry

About

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.

License

See License.txt for information about the license.

Binaries

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:

<dependencies>
  <dependency>
    <groupId>gov.sandia.foundry</groupId>
    <artifactId>gov-sandia-cognition-common-core</artifactId>
    <version>4.0.1</version>
  </dependency>
  <dependency>
    <groupId>gov.sandia.foundry</groupId>
    <artifactId>gov-sandia-cognition-common-data</artifactId>
    <version>4.0.1</version>
  </dependency>
  <dependency>
    <groupId>gov.sandia.foundry</groupId>
    <artifactId>gov-sandia-cognition-learning-core</artifactId>
    <version>4.0.1</version>
  </dependency>
  <dependency>
    <groupId>gov.sandia.foundry</groupId>
    <artifactId>gov-sandia-cognition-text-core</artifactId>
    <version>4.0.1</version>
  </dependency>
  <dependency>
    <groupId>gov.sandia.foundry</groupId>
    <artifactId>gov-sandia-cognition-framework-core</artifactId>
    <version>4.0.1</version>
  </dependency>
  <dependency>
    <groupId>gov.sandia.foundry</groupId>
    <artifactId>gov-sandia-cognition-framework-learning</artifactId>
    <version>4.0.1</version>
  </dependency>
</dependencies>

Example Ivy dependencies

<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"/>
</dependencies>

Building

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

Modules

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.

Contacts

Here are some useful contact points for the Foundry.

Extension points exported contracts — how you extend this code

CognitiveModuleState (Interface)
The CognitiveModuleState defines the interface for the state of a CognitiveModule. The reason it exists is because the d [371 …
Components/FrameworkCore/Source/gov/sandia/cognition/framework/CognitiveModuleState.java
ReversibleDataConverter (Interface)
Represents a DataConverter whose conversion can be reversed. The reverse is just another DataConverter. [9 implementers]
Components/CommonData/Source/gov/sandia/cognition/data/convert/ReversibleDataConverter.java
TermOccurrence (Interface)
Interface for an occurrence of a term in some text. @author Justin Basilico @since 3.0 [6 implementers]
Components/TextCore/Source/gov/sandia/cognition/text/term/TermOccurrence.java
UnivariateProbabilityDensityFunction (Interface)
A PDF that takes doubles as input. Most PDFs will inherit from this interface. @author Kevin R. Dixon @since 3.0 [17 implementers]
Components/LearningCore/Source/gov/sandia/cognition/statistics/UnivariateProbabilityDensityFunction.java
IterativeAlgorithmListener (Interface)
The IterativeAlgorithmListener interface defines the events that are generated by an IterativeAlgorithm. [12 implementers]
Components/CommonCore/Source/gov/sandia/cognition/algorithm/IterativeAlgorithmListener.java
CognitiveModuleFactoryLearner (Interface)
The CognitiveModuleFactoryLearner is an interface defining the functionality of an Object that can learn a CognitiveModu [67 …
Components/FrameworkLearning/Source/gov/sandia/cognition/framework/learning/CognitiveModuleFactoryLearner.java
PotentialHandler (Interface)
This interface defines the problem-specific methods this class requires as input @param The type for labels [9 implementers]
Components/GraphCore/Source/gov/sandia/cognition/graph/inference/GraphWrappingEnergyFunction.java
CognitiveModuleFactory (Interface)
The CognitiveModuleFactory interface defines the functionality required by something that creates new CognitiveModules f [14 …
Components/FrameworkCore/Source/gov/sandia/cognition/framework/CognitiveModuleFactory.java

Core symbols most depended-on inside this repo

get
called by 1980
Components/CommonCore/Source/gov/sandia/cognition/math/matrix/Matrix.java
size
called by 1792
Components/CommonCore/Source/gov/sandia/cognition/collection/Indexer.java
add
called by 1514
Components/LearningCore/Source/gov/sandia/cognition/learning/algorithm/nearest/NearestNeighbor.java
nextDouble
called by 1052
Components/CommonCore/Source/gov/sandia/cognition/util/DoubleReuseRandom.java
addEdge
called by 821
Components/GraphCore/Source/gov/sandia/cognition/graph/DenseMemoryGraph.java
contains
called by 728
Components/TextCore/Source/gov/sandia/cognition/text/term/filter/StopList.java
getDefault
called by 705
Components/CommonCore/Source/gov/sandia/cognition/math/matrix/VectorFactory.java
evaluate
called by 704
Components/LearningCore/Source/gov/sandia/cognition/learning/function/kernel/Kernel.java

Shape

Method 15,616
Class 2,106
Interface 286
Enum 8

Languages

Java100%

Modules by API surface

Components/LearningCore/Source/gov/sandia/cognition/statistics/distribution/UnivariateGaussian.java71 symbols
Components/LearningCore/Source/gov/sandia/cognition/statistics/distribution/MultivariateGaussian.java69 symbols
Components/CommonCore/Source/gov/sandia/cognition/math/matrix/custom/SparseMatrix.java66 symbols
Components/CommonCore/Test/gov/sandia/cognition/math/matrix/MatrixTestHarness.java57 symbols
Components/CommonCore/Source/gov/sandia/cognition/math/matrix/custom/DenseMatrix.java57 symbols
Components/LearningCore/Source/gov/sandia/cognition/statistics/bayesian/AdaptiveRejectionSampling.java56 symbols
Components/LearningCore/Source/gov/sandia/cognition/learning/function/scalar/PolynomialFunction.java55 symbols
Components/LearningCore/Test/gov/sandia/cognition/learning/algorithm/annealing/SimulatedAnnealerTest.java53 symbols
Components/CommonCore/Source/gov/sandia/cognition/math/matrix/mtj/AbstractMTJMatrix.java53 symbols
Components/LearningCore/Source/gov/sandia/cognition/statistics/bayesian/DirichletProcessMixtureModel.java50 symbols
Components/GraphCore/Source/gov/sandia/cognition/graph/GraphMetrics.java50 symbols
Components/CommonCore/Source/gov/sandia/cognition/math/LogNumber.java49 symbols

For agents

$ claude mcp add Foundry \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact