Active Inference Agent (Generative Model + EFE + Empowerment)

Build Active Inference agents that plan actions by minimizing Expected Free Energy.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/sovr610/refffiy --skill active-inference-agent-generative-model-efe-empowerment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Active Inference Agent (Generative Model + EFE + Empowerment)
Source: https://github.com/sovr610/refffiy/tree/main/brain-ai-dev/skills/active-inference-agent
Command: npx skills add https://github.com/sovr610/refffiy --skill active-inference-agent-generative-model-efe-empowerment

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, pytest, and includes scripts (resource) and assets (resource) and references (resource) components.

What problem does it solve?

The Active Inference Agent enables autonomous decision-making in uncertain environments by unifying a generative-world-model with a principled planning objective (Expected Free Energy) to minimize surprise while balancing goal achievement, information gathering, and controllability.

Core Features & Use Cases

  • Modular four-component world model: Latent Encoder q(s|o), Likelihood P(o|s), Transition P(s'|s,a), and Preferences C.
  • Three-term EFE planning: Pragmatic, Epistemic, and Instrumental terms with horizon normalization, per-step terms, and FP32 precision invariants.
  • Flexible planning engines: Random Shooting, Cross-Entropy Method (CEM), and an Amortized Policy for fast inference, with optional discrete POMDP backends via pymdp.
  • Offline RL integration: Minari-based dataset training and evaluation, plus telemetry for model debugging and optimization.
  • Research-to-deployment bridge: end-to-end workflow from data to planning, including configuration presets for small and large-scale deployments.

Quick Start

Create a tiny Active Inference agent with a minimal config and call reset, then plan from a small observation to obtain an action.

Frequently Asked Questions about Active Inference Agent (Generative Model + EFE + Empowerment)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an active inference agent for reinforcement learning under uncertainty?

To build an active inference agent, use a modular generative model with a four-component stack (q(s|o), p(o|s), p(s'|s,a), C) and plan actions by minimizing Expected Free Energy (EFE) to balance goal achievement and information gathering.

What is Expected Free Energy (EFE) planning and how does it handle decision-making?

Expected Free Energy (EFE) planning drives autonomous decision-making by minimizing surprise through three terms: Pragmatic for goal achievement, Epistemic for information gathering, and Instrumental for controllability, all normalized over the planning horizon.

Can I use Minari datasets for offline reinforcement learning with a generative model?

Yes, the agent supports offline reinforcement learning by integrating with Minari-based datasets for training and evaluation, bridging research-to-deployment workflows with telemetry for model debugging and optimization.

Does this active inference agent work with discrete POMDP environments via pymdp?

Yes, the agent includes optional integration with pymdp to support discrete POMDP backends, allowing you to apply active inference and EFE minimization to discrete domains alongside continuous planning engines.

What planning engines are available for active inference beyond random shooting?

Beyond random shooting, the active inference agent supports the Cross-Entropy Method (CEM) for optimization and an Amortized Policy for fast inference, providing flexible planning engines for robust action selection.

Do I need PyTorch to implement an active inference agent with EFE planning?

Yes, PyTorch is required as a core dependency to implement the generative model and perform EFE planning computations with FP32 precision invariants for robust decision-making under uncertainty.