Skip to content
Back to skills

GEO INFER ACT

ASecurity

Canonical GEO-INFER Active Inference implementation. Use when implementing or reviewing free-energy minimization, belief updating, generative models, policy selection, H3/spatial active inference, or typed ACT diagnostics.

  • 18 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 1, 2026
datapythongobashapibackend

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add ActiveInferenceInstitute/GEO-INFER --skill GEO-INFER-ACT --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of GEO INFER ACT?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for GEO INFER ACT
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/activeinferenceinstitute-geo-infer-act/badge)](https://www.skillsdirectory.com/skills/activeinferenceinstitute-geo-infer-act)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: geo-infer-act
description: Canonical GEO-INFER Active Inference implementation. Use when implementing or reviewing free-energy minimization, belief updating, generative models, policy selection, H3/spatial active inference, or typed ACT diagnostics.
prerequisites:
  required:
    - geo-infer-bayes
  recommended:
    - geo-infer-space
    - geo-infer-time
difficulty: advanced
estimated_time: 60min
examples_dir: ./examples/
---

# GEO-INFER-ACT

## Instructions

Use `GEO-INFER-ACT/src/geo_infer_act` as the canonical implementation for
Active Inference inside GEO-INFER. Prefer these public exports:

```python
from geo_infer_act import (
    ActiveInferenceModel,
    ActiveInferenceStepResult,
    FreeEnergyBreakdown,
    FreeEnergyCalculator,
    GenerativeModel,
    H3BeliefUpdateResult,
    H3CellDiagnostics,
    H3EdgeDiagnostics,
    H3GridInferenceResult,
    H3LevelDiagnostics,
    H3SpatialConsistency,
    NestedH3BeliefUpdateResult,
    NestedH3GridInferenceResult,
    NestedH3LevelSummary,
    PolicyEvaluation,
    PolicySelector,
    SpatialActiveInferenceAgent,
    SpatialInferenceTrace,
)
```

## Examples

```python
import numpy as np
from geo_infer_act import ActiveInferenceModel, GenerativeModel

generative_model = GenerativeModel(
    "categorical",
    {"state_dim": 3, "obs_dim": 3},
)

agent = ActiveInferenceModel(
    model_type="categorical",
    policy_selection_mode="deterministic",
    random_seed=42,
)
agent.set_generative_model(generative_model)

result = agent.step(
    np.array([1.0, 0.0, 0.0]),
    available_actions=["survey", "wait"],
    return_result=True,
)

assert isinstance(result, ActiveInferenceStepResult)
```

```python
import numpy as np
from geo_infer_act import ActiveInferenceModel, GenerativeModel

cells = ["89283082803ffff"]
model = GenerativeModel("categorical", {"state_dim": 4, "obs_dim": 4})
model.enable_nested_h3_spatial([7, 8, 9], cells=cells)

agent = ActiveInferenceModel(
    model_type="categorical",
    policy_selection_mode="deterministic",
)
agent.set_generative_model(model)

nested = agent.infer_over_nested_h3_grid(
    {model.h3_cells[0]: np.array([1.0, 0.0, 0.0, 0.0])},
    return_result=True,
)
trace = agent.trace_over_nested_h3_grid(
    {model.h3_cells[0]: np.array([1.0, 0.0, 0.0, 0.0])},
    grid_result=nested,
)

assert isinstance(nested, NestedH3GridInferenceResult)
assert isinstance(trace, SpatialInferenceTrace)
```

### Agent interfaces

Use `uv run --frozen geo-infer catalog ACT` to discover public source
APIs, then `geo-infer describe` before calling a selected target. Scripts use
`geo_infer_api.agent_runtime.AgentSession`; the optional stdio MCP server is
`geo-infer-mcp`. See [requests, native objects and composition](../GEO-INFER-INTRA/docs/integration/agent_interfaces.md).
The adapter retains this module's dependencies and authorization requirements.

## Guidelines

### Method Contracts

- `geo_infer_act.utils.pymdp_adapter` is the only production runtime bridge to
  `inferactively-pymdp==1.0.5`; it builds JAX `pymdp.agent.Agent` instances,
  validates the exact installed version, uses explicit RNG-key action sampling,
  and returns normalized posterior, action posterior, negative EFE, and VFE/free
  energy metadata.
- `FreeEnergyCalculator.compute_categorical_free_energy(..., return_breakdown=True)`
  returns `FreeEnergyBreakdown` with `free_energy = complexity - accuracy`.
- `FreeEnergyCalculator.compute_expected_free_energy(..., return_breakdown=True)`
  returns pragmatic, epistemic, risk, ambiguity, and entropy terms.
- `PolicySelector.select_policy(...)` returns selected policy metadata and a
  `PolicyEvaluation` object.
- `ActiveInferenceModel.step(..., return_result=True)` returns an
  `ActiveInferenceStepResult`; the default return is the `(beliefs, action)`
  tuple.
- `GenerativeModel.update_h3_beliefs(..., return_result=True)` returns an
  `H3BeliefUpdateResult` with normalized per-cell beliefs, aggregate free
  energy, and `H3SpatialConsistency`.
- `ActiveInferenceModel.infer_over_h3_grid(..., return_result=True)` and
  `SpatialActiveInferenceAgent.step(..., return_result=True)` return
  `H3GridInferenceResult`; their default dictionary outputs include per-cell
  pymdp metadata.
- `GenerativeModel.compute_h3_cell_diagnostics(...)`,
  `ActiveInferenceModel.trace_over_h3_grid(...)`,
  `ActiveInferenceModel.trace_over_nested_h3_grid(...)`,
  `SpatialActiveInferenceAgent.trace_step(...)`, and
  `SpatialActiveInferenceAgent.trace_nested_step(...)` return
  `SpatialInferenceTrace` with `H3CellDiagnostics`, `H3EdgeDiagnostics`, and
  `H3LevelDiagnostics`.
- `GenerativeModel.enable_nested_h3_spatial(...)` delegates hierarchy
  construction to SPACE and stores parent/child closure for ordered H3
  resolutions.
- `GenerativeModel.update_nested_h3_beliefs(..., return_result=True)` returns
  `NestedH3BeliefUpdateResult` with normalized finest-cell beliefs,
  parent-level aggregate beliefs, `NestedH3LevelSummary` rows, cross-level
  coherence, and finite aggregate free energy.
- `ActiveInferenceModel.infer_over_nested_h3_grid(..., return_result=True)` and
  `SpatialActiveInferenceAgent.step_nested(..., return_result=True)` return
  `NestedH3GridInferenceResult` while preserving existing flat H3 behavior.
- H3 methods must validate real `h3>=4.5.0,<5` cells. Synthetic cells are only
  for explicit `cell_*` unit-test paths.
- Runner `h3` and nested H3 modes emit `data/pymdp_h3_diagnostics.json`,
  `data/pymdp_policy_posteriors.csv`, and
  `visualizations/pymdp_policy_free_energy.html` with manifest-linked sidecars.
- Runner `h3`, `spatial`, and nested H3 modes emit
  `data/spatial_inference_trace.json`, `data/spatial_research_statistics.json`,
  `data/h3_cell_diagnostics.csv`, `data/h3_edge_diagnostics.csv`,
  `visualizations/h3_belief_flux_map.html`, `visualizations/h3_policy_surface.html`,
  `visualizations/h3_policy_transitions.html`,
  `visualizations/h3_spatial_autocorrelation.html`,
  `visualizations/h3_entropy_free_energy_phase.html`, and
  `visualizations/spatial_inference_research_report.html`; nested mode also
  emits `data/nested_h3_parent_child_diagnostics.csv`,
  `data/nested_h3_level_diagnostics.csv`, and
  `visualizations/nested_h3_hierarchy_map.html` plus
  `visualizations/nested_h3_parent_child_residuals.html`.
- Research-profile H3 runs are opt-in with
  `RunConfig.parameters["research_profile"] = True` or
  `geo-infer-act-run --research-profile`. They keep real H3 cells and real
  `inferactively-pymdp==1.0.5` while installing deterministic likelihoods,
  preferences, and action-conditioned transitions that avoid collapsed traces.
- The deterministic visualization gallery is generated with
  `uv run python GEO-INFER-ACT/examples/spatial_active_inference_gallery.py`.
  Use `uv run`; system Python may contain a legacy pymdp distribution and is
  outside the supported ACT/H3 runtime contract.

### Integrations

- AGENT active-inference adapters should call or conform to ACT typed result
  contracts.
- MATH/BAYES convenience surfaces may expose helpers, but ACT remains the
  canonical implementation for Active Inference policy and free-energy logic.
- Optional external backends may be absent; use real local ACT methods or
  explicit `not_available` results.

## Verification

```bash
uv run python GEO-INFER-TEST/validate_h3_active_inference_contract.py
uv run python GEO-INFER-TEST/validate_active_inference_contract.py
uv run python GEO-INFER-TEST/validate_act_geospatial_contract.py
uv run pytest GEO-INFER-ACT/tests/unit/test_spatial_trace_diagnostics.py -q
uv run pytest GEO-INFER-ACT/tests/unit/test_spatial_research_statistics.py -q
uv run pytest GEO-INFER-ACT/tests/unit/test_pymdp_h3_backend.py -q
uv run pytest GEO-INFER-ACT/tests/unit/test_nested_h3_active_inference.py -q
uv run python GEO-INFER-ACT/examples/spatial_active_inference_gallery.py --json
uv run python GEO-INFER-TEST/run_unified_tests.py --module ACT
```

Do not add inert placeholders, fake policy selection, first-policy defaults, or
undocumented public methods. Do not import legacy `pymdp.control` or
`pymdp.inference` in production code.

Files in this skill

  • AGENTS.md4.5 KB
  • README.md6.4 KB
  • SKILL.md7.6 KB
  • config/AGENTS.md1.2 KB
  • config/README.md930 B
  • config/active_inference_run.yaml213 B
  • config/example.yaml1.2 KB
  • debug_models.py622 B
  • docs/AGENTS.md1.4 KB
  • docs/README.md1.1 KB
  • docs/active_inference_overview.md4.9 KB
  • docs/api_schema.yaml25.7 KB
  • docs/categorical_inference.md1.9 KB
  • docs/free_energy_principle.md5.7 KB
  • docs/geospatial_applications.md19.3 KB
  • docs/mathematical_framework.md5.8 KB
  • docs/method_inventory.md18.2 KB
  • docs/references.md2.7 KB
  • docs/world_systems_modeling.md3.8 KB
  • examples/AGENTS.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.