ActiveInferenceForager is an open-source action research project that implements an intelligent agent using principles from Active Inference, a neuroscientific theory of brain function and decision-making. This project aims to bridge the gap between theoretical neuroscience and practical AI applications, creating adaptive agents capable of learning and making decisions in complex, dynamic environments.
Current MAS Dynamics Research repo: https://github.com/leonvanbokhorst/lab-politik
ActiveInferenceForager implements an intelligent chat agent using principles from Active Inference, focusing on free energy minimization. The project includes:
- A core implementation of Active Inference algorithms
- A Multi-Agent System (MAS) dynamics simulation framework
- Several proofs of concept demonstrating key concepts
- A flexible and extensible architecture for further research and development
For a detailed explanation of the Free Energy Principle and Active Inference, please refer to our Active Inference Q&A.
- LLM Proactive Agent: An advanced chatbot implementing Active Inference principles.
- Goal Seeker: Manages the agent's goals and decision-making process.
- Rapport Builder: Handles user interaction and relationship building.
- OpenAI Provider: Integrates with OpenAI's language models for natural language processing.
The MAS dynamics simulation framework allows for modeling complex interactions between multiple agents in various environments. Key components include:
- Agent: Abstract base class for implementing various types of agents.
- Environment: Represents the world in which agents operate.
- Personality: Implements the Big Five personality model for agents.
- Decision Making: Handles agent decision-making processes.
The project includes several POCs demonstrating key concepts:
- Variational Free Energy Minimization
- Prediction Error Propagation
- VFE Minimization
These POCs provide practical implementations of core Active Inference concepts and serve as building blocks for more complex agent behaviors.
To set up the ActiveInferenceForager project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/ActiveInferenceForager.git cd ActiveInferenceForager
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Install the project in editable mode:
pip install -e .
To use the ActiveInferenceForager project, follow these steps:
-
Ensure you have completed the installation process described above.
-
Set up your OpenAI API key:
export OPENAI_API_KEY=your_api_key_here
-
Run the main application:
python src/main.py
-
To run specific proofs of concept:
python src/poc/variational_free_energy.py python src/poc/prediction_error_propagation.py python src/poc/vfe_minimization.py
-
To run the Multi-Agent System simulation:
python src/mas_dynamics_simulation/simulation.py
For more detailed usage instructions and examples, please refer to the documentation in the docs
folder.
We welcome contributions to the ActiveInferenceForager project! Here's how you can contribute:
-
Fork the repository on GitHub.
-
Create a new branch for your feature or bug fix.
-
Write your code and add tests if applicable.
-
Ensure all tests pass by running:
pytest
-
Submit a pull request with a clear description of your changes.
Please make sure to follow our coding standards and commit message conventions. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.