HippocampAIF
A Biologically Grounded Cognitive Architecture for One-Shot Learning and Active Inference.
What This Is
HippocampAIF is a complete cognitive architecture implemented in pure Python (NumPy + SciPy only). Every module corresponds to a real brain structure with citations to the computational neuroscience literature.
The framework is designed to achieve two milestones that conventional machine learning approaches struggle with:
- One-shot classification - learn to recognize a new category from a single example.
- Fast game mastery - play Atari Breakout using innate physics priors without requiring millions of training episodes.
Instead of traditional AI approaches (like POMDPs or MCMC), HippocampAIF uses:
- Free-Energy Minimization (Friston) for perception and action.
- Hippocampal Fast-Binding for instant one-shot episodic memory.
- Spelke's Core Knowledge systems as hardcoded innate priors (understanding gravity, objects, and numbers inherently).
- Distortable Canvas for elastic image comparison and matching.
Architecture Map
flowchart TD
classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
PFC["Prefrontal Cortex (PFC)\nWorking memory (7 +/- 2)\nExecutive control\nGoal stack"]
TC["Temporal Cortex\nRecognition\nCategories\nSemantic mem."]
PC["Predictive Coding\nFriston Box 3\nFree-energy min\nError signals"]
PAR["Parietal Cortex\nPriority maps\nCoord. transforms\nSensorimotor"]
SC["Superior Colliculus\nSaccade"]
PM["Precision Modulator"]
BC["Biased Compete"]
subgraph Hippocampus ["H I P P O C A M P U S"]
direction LR
DG["DG\nSeparate"] --> CA3["CA3\nComplete"]
CA3 --> CA1["CA1\nMatch"]
CA1 --> IM["Index Memory\nFast-binding"]
EC["Entorhinal EC\nGrid cells"]
RB["Replay Buffer\nConsolidation"]
end
subgraph VisualCortex ["V I S U A L C O R T E X"]
direction LR
V1S["V1 Simple\nGabor"] --> V1C["V1 Complex\nMax-pooling"]
V1C --> HMAX["HMAX Hierarchy\nV2->V4->IT"]
end
subgraph RetinaData ["R E T I N A"]
direction LR
PR["Photoreceptors\nAdaptation"]
GAN["Ganglion\nDoG"]
STE["Spatiotemporal\nMotion energy"]
end
SENSES["SENSES\n=================\nraw image"]
subgraph CoreKnowledge ["C O R E K N O W L E D G E (Innate, Not Learned)"]
direction LR
OBJ["Objects\nPerm/Coh"]
PHY["Physics\nGravity"]
NUM["Number\nANS/Sub"]
GEO["Geometry\nCanvas"]
AGT["Agent\nGoals"]
SOC["Social\nHelper"]
end
subgraph ActionSystem ["A C T I O N S Y S T E M"]
direction LR
ACTI["Active Inference\na = -dF/da\nExpected FE min."]
MOT["Motor Primitives\nL/R/Fire"]
REF["Reflex Arc\nTrack"]
end
PFC -->|"top-down control"| TC
PFC -->|"top-down control"| PC
PFC -->|"top-down control"| PAR
PC --> TC
PC --> PAR
TC --> SC
PC --> PM
PAR --> BC
SC --> Hippocampus
PM -->|"attention"| Hippocampus
BC --> Hippocampus
Hippocampus -->|"features"| VisualCortex
VisualCortex -->|"ON/OFF sparse"| RetinaData
RetinaData --> SENSES
File Structure
hippocampaif/
βββ __init__.py
βββ core/ # Phase 1 β Foundation
β βββ tensor.py
β βββ free_energy.py
β βββ message_passing.py
β βββ dynamics.py
βββ retina/ # Phase 2 β Eye
β βββ photoreceptor.py
β βββ ganglion.py
β βββ spatiotemporal_energy.py
βββ v1_v5/ # Phase 3 β Visual Cortex
β βββ gabor_filters.py
β βββ sparse_coding.py
β βββ hmax_pooling.py
βββ hippocampus/ # Phase 4 β Memory
β βββ dg.py
β βββ ca3.py
β βββ ca1.py
β βββ entorhinal.py
β βββ index_memory.py
β βββ replay.py
βββ core_knowledge/ # Phase 5 β Innate Priors
β βββ object_system.py
β βββ physics_system.py
β βββ number_system.py
β βββ geometry_system.py
β βββ agent_system.py
β βββ social_system.py
βββ neocortex/ # Phase 6a β Higher Cognition
β βββ predictive_coding.py
β βββ prefrontal.py
β βββ temporal.py
β βββ parietal.py
βββ attention/ # Phase 6b β Attention
β βββ superior_colliculus.py
β βββ precision.py
β βββ competition.py
βββ learning/ # Phase 7 β One-Shot
β βββ distortable_canvas.py
β βββ amgd.py
β βββ one_shot_classifier.py
β βββ hebbian.py
βββ action/ # Phase 8 β Motor
β βββ active_inference.py
β βββ motor_primitives.py
β βββ reflex_arc.py
βββ agent/ # Phase 9 β Integration
β βββ brain.py
β βββ mnist_agent.py
β βββ breakout_agent.py
βββ tests/ # 8 test suites, 34+ tests passing
βββ test_core.py
βββ test_retina.py
βββ test_visual_cortex.py
βββ test_hippocampus.py
βββ test_core_knowledge.py
βββ test_neocortex_attention.py
βββ test_learning.py
βββ test_action.py
Tech Stack Audit
HippocampAIF is built intentionally with zero deep learning frameworks to maximize biological fidelity, deployment portability, and mathematical interpretability.
- Language: Python >= 3.10
- Math Engine: NumPy >= 1.24, SciPy >= 1.10
- Image Processing: Pillow >= 9.0
- Linting and Diagnostics: Pyre2 / Pyright explicit configurations
- Version Control Optimizations:
.gitattributesgenerated for Git LFS (GitHub) and Xet Storage (Hugging Face)
Setup
# 1. Clone the repository
cd C:\Your\Workspace\Path
# 2. Create the virtual environment
python -m venv .venv
# 3. Activate the environment
.venv\Scripts\activate
# 4. Install dependencies
pip install -r requirements.txt
# 5. Set the Python path explicitly
$env:PYTHONPATH = (Get-Location).Path
Running Tests
The test suite validates the biological mechanics built into the architecture.
# Core, Retina, Visual Cortex, Hippocampus
python -m hippocampaif.tests.test_core
python -m hippocampaif.tests.test_retina
python -m hippocampaif.tests.test_v1_v5
python -m hippocampaif.tests.test_hippocampus
# Core Knowledge, Neocortex, Learning, Action
python -m hippocampaif.tests.test_core_knowledge
python -m hippocampaif.tests.test_neocortex_attention
python -m hippocampaif.tests.test_learning
python -m hippocampaif.tests.test_action
License and Citation
License: Proprietary Author: Algorembrant, Rembrant Oyangoren Albeos Year: 2026
If you use this framework in research or production, please cite:
@software{hippocampaif2026,
author = {Albeos, Rembrant Oyangoren},
title = {HippocampAIF: Biologically Grounded Cognitive Architecture},
year = {2026},
description = {Free-energy minimization + hippocampal fast-binding +
Spelke's core knowledge for one-shot learning and active inference}
}
References:
- Friston, K. (2009). The free-energy principle: a rough guide to the brain. Trends in Cognitive Sciences, 13(7), 293-301.
- Lake, B. M., Salakhutdinov, R., & Tenenbaum, J. B. (2015). Human-level concept learning through probabilistic program induction. Science, 350(6266), 1332-1338.
- Spelke, E. S. (2000). Core knowledge. American Psychologist, 55(11), 1233-1243.