Registry / ai-ml / cortexcore

cortexcore

JSON →
library0.1.6pypypiunverified

CortexCore is a modular library for building recurrent backbones and agent memory systems. It provides building blocks for stateful neural architectures, including LSTM, GRU, and attention-based memory modules, with a focus on composability and runtime efficiency. The current version is 0.1.6, targeting Python >= 3.12, with a monthly release cadence.

pip install cortexcore
INSTALL
IMPORT
SIG · CORTEXCORE
C
cortexcore
ai-mlpythonv0.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CortexBase
from cortexcore import CortexBase
from cortex import CortexBase
The top-level package is 'cortexcore', not 'cortex'.
LSTMCell
from cortexcore.cells import LSTMCell
from cortexcore import LSTMCell
Cell implementations are in the submodule 'cells'.
MemoryModule
from cortexcore.memory import MemoryModule
from cortexcore import MemoryModule
Memory modules are in the submodule 'memory'.

Minimal example creating a recurrent backbone using an LSTM cell and processing a sequence.

import torch from cortexcore import CortexBase from cortexcore.cells import LSTMCell # Create a simple recurrent backbone cell = LSTMCell(input_size=10, hidden_size=20) base = CortexBase(cell, stateful=True) # Process a sequence x = torch.randn(5, 10) # sequence length 5, batch size 1 output, hidden = base(x) print(output.shape) # torch.Size([5, 20]) # Reset state for new sequence base.reset_state()
Debug
Known issues
breakingIn version 0.1.6, the 'stateful' parameter of CortexBase must be passed as a keyword argument; positional usage is removed.
fix
Use `CortexBase(cell, stateful=True)` instead of `CortexBase(cell, True)`.
affects: >=0.1.6
gotchaThe package name is 'cortexcore' on PyPI, but the GitHub repository is under the 'metta' monorepo. Ensure you use 'cortexcore' in pip install, not 'metta-cortex'.
fix
Run `pip install cortexcore`.
affects: all
deprecatedThe alias 'CortexCore' (CamelCase) for the module is deprecated in favor of 'cortexcore' (all lowercase).
fix
Use `import cortexcore` instead of `import CortexCore`.
affects: <0.2.0
gotchaWhen using stateful mode, you must manually call `reset_state()` before processing a new independent sequence, otherwise the hidden state carries over.
fix
Always call `model.reset_state()` before a new sequence when `stateful=True`.
affects: all
Upgrade
Version history
0.1.6latest on PyPI · released Feb 26, 2026
Audit
Dependencies
torchrequiredRequired for tensor operations and neural network modules.
numpyrequiredUsed for numerical operations and array handling.
einopsoptionalUsed for tensor rearrangement and Einstein summation.
Agent activity
12 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
cortexcore — pip install cortexcore · libregistry