| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Multi-Language Active Inference Framework for Advanced AI Research and Applications
Welcome to Active InferAnts - a comprehensive, multi-language framework that implements Active Inference algorithms across 50 programming languages. This project serves as both a research platform for studying active inference mechanisms and a practical toolkit for building sophisticated AI applications that can learn, adapt, and make decisions in complex environments.
Active InferAnts represents a groundbreaking approach to implementing Active Inference algorithms - a mathematical framework for understanding perception, learning, and decision-making in biological and artificial agents. Our system uniquely combines:
Active Inference is a mathematical framework that explains how biological agents (including humans) perceive, learn, and act in uncertain environments. It proposes that agents minimize "surprise" by constantly updating their beliefs about the world and taking actions to confirm those beliefs.
Traditional AI approaches often separate perception, learning, and action. Active Inference unifies these processes under a common mathematical framework, enabling more robust, adaptable, and biologically-plausible AI systems.
By implementing the same algorithms in multiple programming languages, we ensure:
Get up and running with Active InferAnts in under 5 minutes:
# Clone the repository
git clone https://github.com/ActiveInferenceInstitute/ActiveInferAnts.git
cd ActiveInferAnts
# Set up environment and run all implementations
python3 0_CONTEXT/Computer_Languages/master_controller.py setup
python3 0_CONTEXT/Computer_Languages/master_controller.py run# Basic Active Inference example
from active_infer_ants import InferenceModel
# Initialize with default configuration
model = InferenceModel()
# Run inference for 1000 iterations
results = model.run(max_iterations=1000)
# Visualize results
model.visualize(results)# Start the FastAPI knowledge management service
cd 6_API && python3 Knowledge_API.py
# API will be available at http://localhost:8000
# Interactive docs at http://localhost:8000/api/docs# Run comprehensive performance benchmarks
python3 0_CONTEXT/Computer_Languages/master_controller.py benchmark
# View status dashboard
python3 0_CONTEXT/Computer_Languages/master_controller.py status# Clone the repository
git clone https://github.com/ActiveInferenceInstitute/ActiveInferAnts.git
cd ActiveInferAnts
# Install Python dependencies
pip install -r requirements.txt
# Optional: Install development dependencies
pip install -r requirements-dev.txtFor full multi-language support, install the required compilers and interpreters:
# Use the automated setup script
python3 0_CONTEXT/Computer_Languages/master_controller.py setup
# Or manually install language-specific dependencies
python3 0_CONTEXT/Computer_Languages/config_manager.py --all# Build the Docker image
docker build -t active-inferants .
# Run the container
docker run -p 8000:8000 active-inferants# Install in development mode
pip install -e .
# Install pre-commit hooks
pre-commit install
# Set up all language environments
python3 0_CONTEXT/Computer_Languages/master_controller.py setupfrom active_infer_ants import ActiveInferenceAgent, Environment
# Create an environment
env = Environment(config={"complexity": 3, "uncertainty": 0.2})
# Initialize an Active Inference agent
agent = ActiveInferenceAgent(
sensory_precision=5,
prior_precision=2,
learning_rate=0.1
)
# Run inference loop
for iteration in range(1000):
# Sense the environment
observation = env.observe()
# Update beliefs and plan actions
action = agent.infer(observation)
# Execute action and get reward
reward = env.step(action)
# Learn from the experience
agent.learn(reward)
# Visualize final beliefs
agent.visualize_beliefs()from active_infer_ants import AntColony, PheromoneNetwork
# Create a colony of 50 agents
colony = AntColony(n_agents=50)
# Initialize pheromone communication network
pheromones = PheromoneNetwork(colony.agents)
# Run distributed optimization
for iteration in range(100):
# Each agent performs active inference
actions = colony.parallel_inference()
# Update pheromone trails
pheromones.update_trails(actions)
# Agents learn from collective experience
colony.learn_from_colony(pheromones.get_pheromone_map())
# Analyze emergent behavior
colony.analyze_emergent_behavior()# Run all language implementations
python3 0_CONTEXT/Computer_Languages/master_controller.py run
# Run specific language implementation
python3 0_CONTEXT/Computer_Languages/master_controller.py run python
# Run comprehensive benchmarks
python3 0_CONTEXT/Computer_Languages/master_controller.py benchmark
# Generate detailed reports
python3 0_CONTEXT/Computer_Languages/master_controller.py report
# View interactive status dashboard
python3 0_CONTEXT/Computer_Languages/master_controller.py statusimport requests
# Store knowledge
response = requests.post(
"http://localhost:8000/api/knowledge/",
json={
"source": "experiment_001",
"content": {"accuracy": 0.95, "parameters": {"lr": 0.01}}
},
headers={"X-API-Key": "your-secret-key"}
)
# Retrieve knowledge
knowledge = requests.get(
"http://localhost:8000/api/knowledge/experiment_001",
headers={"X-API-Key": "your-secret-key"}
).json()# Using JSON configuration
config = {
"max_iterations": 1000,
"learning_rate": 0.1,
"exploration_factor": 0.3,
"visualization_enabled": True,
"output_directory": "./results"
}
# Load from file
with open('config.json', 'r') as f:
config = json.load(f)
# Initialize with custom config
agent = ActiveInferenceAgent.from_config(config)For comprehensive examples, see:
Active InferAnts follows a 6-phase operational pipeline that transforms theoretical Active Inference models into deployable applications:
graph LR
A[0_CONTEXT] --> B[1_PREPARE]
B --> C[2_OPERATE]
C --> D[3_MEASURE]
D --> E[4_REPORT]
E --> F[5_FOLLOWUP]
F --> G[6_API]
0_CONTEXT/ - Research context, specifications, and multi-language implementations
1_PREPARE/ - Data preparation, configuration, and foundational components
2_OPERATE/ - Runtime execution and simulation management
3_MEASURE/ - Analysis, statistics, and performance measurement
4_REPORT/ - Reporting and communication systems
5_FOLLOWUP/ - Continuous improvement and follow-up actions
6_API/ - REST APIs and external interfaces
9_OTHER/ - Third-party integrations and specialized modules
Active InferAnts implements Active Inference algorithms in 50 programming languages, ensuring:
Supported Languages:
Key Files:
A comprehensive REST API for managing knowledge across multiple databases with automatic synchronization:
# FastAPI-based service running on port 8000
# Features: Multi-database support, caching, async operations
# Endpoints: CRUD operations, search, analyticsKey Features:
Endpoints:
Advanced API for managing meta-information about Active Inference processes and agents:
Key Features:
Active InferAnts includes a sophisticated testing framework that ensures reliability across all implementations:
Key Components:
Test Categories:
# Run all language implementations with testing
python3 0_CONTEXT/Computer_Languages/master_controller.py test
# Run specific language tests
python3 0_CONTEXT/Computer_Languages/master_controller.py test python
# Run comprehensive benchmark suite
python3 0_CONTEXT/Computer_Languages/test_suite.py
# View test results
python3 0_CONTEXT/Computer_Languages/test_suite.pyComprehensive performance analysis across all language implementations:
# Run performance benchmarks
python3 0_CONTEXT/Computer_Languages/master_controller.py benchmark
# Generate performance reports
python3 0_CONTEXT/Computer_Languages/master_controller.py report
# View interactive performance dashboard
python3 0_CONTEXT/Computer_Languages/status_dashboard.sh# Set up development environment
python3 0_CONTEXT/Computer_Languages/master_controller.py setup
# Install development dependencies
pip install -r requirements-dev.txt
# Run linting and code quality checks
pre-commit run --all-files
# Run the unit test suite
python3 -m pytest -q
# Build documentation
mkdocs build
# Run development server
python3 6_API/Knowledge_API.py# Clean all outputs and caches
python3 0_CONTEXT/Computer_Languages/master_controller.py clean
# Check dependencies
python3 0_CONTEXT/Computer_Languages/config_manager.py --all
# Install a language's dependencies
python3 0_CONTEXT/Computer_Languages/config_manager.py --install <language>
# Generate comprehensive reports
python3 0_CONTEXT/Computer_Languages/master_controller.py reportProblem: Missing dependencies after installation
# Solution: Run dependency check and installation
python3 0_CONTEXT/Computer_Languages/config_manager.py --all
python3 0_CONTEXT/Computer_Languages/master_controller.py setupProblem: Permission denied when running scripts
# Solution: Make scripts executable
chmod +x 0_CONTEXT/Computer_Languages/run_all.sh
chmod +x 0_CONTEXT/Computer_Languages/status_dashboard.shProblem: API server fails to start
# Check database connections
python3 -c "import redis; print('Redis OK')" # Test Redis
python3 -c "import pymongo; print('MongoDB OK')" # Test MongoDB
# Check configuration
cat config.jsonProblem: Memory errors during large simulations
# Reduce simulation parameters
{
"max_iterations": 500, # Reduce from 1000
"memory_limit": "4GB",
"parallel_processes": 2 # Reduce parallelism
}Problem: Specific language implementation fails
# Run individual language test
python3 0_CONTEXT/Computer_Languages/master_controller.py run <language>
# Check language-specific dependencies
python3 0_CONTEXT/Computer_Languages/config_manager.py --install <language>Problem: Performance inconsistency across languages
# Run benchmark comparison
python3 0_CONTEXT/Computer_Languages/master_controller.py benchmark
# Check system resources
python3 0_CONTEXT/Computer_Languages/status_dashboard.shEnable detailed logging for troubleshooting:
# Set debug logging
export LOG_LEVEL=DEBUG
python3 0_CONTEXT/Computer_Languages/master_controller.py run
# View detailed logs
tail -f 0_CONTEXT/Computer_Languages/test_results/test_suite.logWe welcome contributions from researchers, developers, and enthusiasts! Here's how to get involved:
Fork and Clone
git clone https://github.com/your-username/ActiveInferAnts.git
cd ActiveInferAnts
git checkout -b feature/your-amazing-featureSet Up Development Environment
python3 0_CONTEXT/Computer_Languages/master_controller.py setup
pip install -r requirements-dev.txt
pre-commit installMake Your Changes
Test Your Changes
# Run tests
python3 0_CONTEXT/Computer_Languages/master_controller.py test
# Run benchmarks to ensure no performance regression
python3 0_CONTEXT/Computer_Languages/master_controller.py benchmark
# Check code quality
pre-commit run --all-filesSubmit Your Contribution
git add .
git commit -m "feat: add amazing new feature"
git push origin feature/your-amazing-featureThen create a pull request
Contributors are recognized through:
Active InferAnts is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license. This license allows you to:
When using or sharing this work, you must:
"Active InferAnts" by Active Inference Institute (@docxology unless otherwise specified) is licensed under CC BY-NC-ND 4.0
This project includes components with the following licenses:
Important Note: The CC BY-NC-ND 4.0 license applies to the Active InferAnts framework and documentation. Third-party components may have different licenses that allow more permissive use. Always check individual component licenses for redistribution rights.
For detailed license information, see LICENSE and the contribution guide for third-party component notes.
Active InferAnts builds upon groundbreaking research in Active Inference and swarm intelligence:
Special thanks to our core development team and contributors who have made this project possible through their expertise in:
We gratefully acknowledge:
This project has been supported by:
| Channel | Purpose |
|---|---|
| 🐛 GitHub Issues | Bug reports & technical issues |
| 💬 GitHub Discussions | Questions & community support |
| 💻 Discord | Real-time chat & community |
| Business & partnership inquiries |
We're always interested in collaborating with:
🧠 Active InferAnts - Bridging the gap between theoretical Active Inference and practical AI applications through multi-language implementation and rigorous validation.
Built with ❤️ by the Active Inference research community
| Back | FazBrowse Home | New Git URL |