{"id":48732808,"url":"https://github.com/alwaysvivek/evolving-ai-biosphere","last_synced_at":"2026-04-12T02:40:44.050Z","repository":{"id":322319724,"uuid":"1088955928","full_name":"alwaysvivek/evolving-ai-biosphere","owner":"alwaysvivek","description":"A self-evolving AI biosphere leveraging LSTM/REINFORCE for adaptation.","archived":false,"fork":false,"pushed_at":"2026-01-13T09:43:52.000Z","size":520,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T11:40:01.054Z","etag":null,"topics":["ai","artificial-intelligence","biology","deep-learning","devops","evolutionary-algorithms","machine-learning","mlflow","mlops","numpy","python3","pytorch","reinforcement-learning","simulation","torch"],"latest_commit_sha":null,"homepage":"https://alwaysvivek.github.io/evolving-ai-biosphere/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alwaysvivek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-03T17:28:03.000Z","updated_at":"2026-01-13T09:52:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alwaysvivek/evolving-ai-biosphere","commit_stats":null,"previous_names":["alwaysvivek/evolving-ai-biosphere"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alwaysvivek/evolving-ai-biosphere","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysvivek%2Fevolving-ai-biosphere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysvivek%2Fevolving-ai-biosphere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysvivek%2Fevolving-ai-biosphere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysvivek%2Fevolving-ai-biosphere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alwaysvivek","download_url":"https://codeload.github.com/alwaysvivek/evolving-ai-biosphere/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysvivek%2Fevolving-ai-biosphere/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","biology","deep-learning","devops","evolutionary-algorithms","machine-learning","mlflow","mlops","numpy","python3","pytorch","reinforcement-learning","simulation","torch"],"created_at":"2026-04-12T02:40:42.505Z","updated_at":"2026-04-12T02:40:44.045Z","avatar_url":"https://github.com/alwaysvivek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌍 Evolving AI Biosphere\n\nA self-evolving digital ecosystem where AI organisms fight for survival, powered by Reinforcement Learning and Genetic Algorithms.\n\n![Status](https://img.shields.io/badge/Status-Active-success)\n![Python](https://img.shields.io/badge/Python-3.9%2B-blue)\n![Tech](https://img.shields.io/badge/ML-PyTorch%20%7C%20Ollama%20%7C%20MLflow-orange)\n\u003cbr\u003e\u003cbr\u003e\n[![Deploy static content to Pages](https://github.com/alwaysvivek/evolving-ai-biosphere/actions/workflows/static.yml/badge.svg)](https://github.com/alwaysvivek/evolving-ai-biosphere/actions/workflows/static.yml)\n\n## 📖 Overview\n\n**Evolving AI Biosphere** is a complex artificial life simulation where organisms are not pre-programmed with rules—they **learn** how to survive.\n\n- **Predators** share a collective \"Hive Mind\" (LSTM Neural Network) that evolves via Reinforcement Learning (Policy Gradient).\n- **Herbivores** evolve individually via Genetic Algorithms (mutation of weights).\n- **The World** is watched by an \"AI God\" (Ollama/Llama 3.2) that allows natural language control over the simulation.\n\n👉 **[Read the Full Technical Documentation](docs/index.html)** for a deep dive into the math, architecture, and evolutionary theory.\n\n### 📸 Demo\n![Simulation Demo](logs/sample-output-gen-100.jpeg)\n\n---\n\n## 🛠 Tech Stack\n\n| Component | Technology | Description |\n| :--- | :--- | :--- |\n| **Core Engine** | Python, Pygame | Real-time simulation loop (60 FPS) and rendering. |\n| **Neural Nets** | PyTorch | Custom LSTM architecture for Predator \"Hive Mind\". |\n| **Orchestration** | Python `subprocess` | Multi-threaded service manager (`launch_services.py`). |\n| **Inference** | Ollama | Local LLM serving (Llama 3.2) for God Mode control. |\n| **Observability** | MLflow | Real-time experiment tracking and metric logging (Port 5001). |\n\n\n\n---\n\n## 🧩 Architecture\n\n```mermaid\ngraph LR\n    %% Styling\n    classDef infra fill:#f9f,stroke:#333,stroke-width:2px;\n    classDef core fill:#bbf,stroke:#333,stroke-width:2px;\n    classDef brain fill:#bfb,stroke:#333,stroke-width:2px;\n\n    %% --- Infrastructure (Left Column) ---\n    subgraph Infrastructure\n        direction TB\n        Launch[launch_services.py]:::infra\n        Ollama[\"Ollama Service\u003cbr/\u003e(Llama 3.2)\"]:::infra\n        MLflow[\"MLflow Server\u003cbr/\u003e(Metrics)\"]:::infra\n        \n        Launch -.-\u003e|Starts| Ollama\n        Launch -.-\u003e|Starts| MLflow\n    end\n\n    %% --- Simulation (Middle Column) ---\n    subgraph \"Simulation Loop (60hz)\"\n        direction TB\n        User[User Input]\n        Pygame[Pygame Engine]:::core\n        Grid[NumPy Grid State]:::core\n        \n        User ==\u003e|Controls| Pygame\n        Pygame ==\u003e|Updates| Grid\n    end\n\n    %% --- Intelligence (Right Column) ---\n    subgraph \"The Hive \u0026 Agents\"\n        direction TB\n        Preds[\"Predator Hive Mind\u003cbr/\u003e(PyTorch LSTM)\"]:::brain\n        Herbs[\"Herbivores\u003cbr/\u003e(Genetics)\"]:::brain\n        \n        God[\"God Mode Agent\u003cbr/\u003e(LangChain)\"]:::brain\n        Council[\"Council System\u003cbr/\u003e(LangGraph)\"]:::brain\n    end\n\n    %% --- Connections (Critical Paths) ---\n    \n    %% Bio-Loop\n    Grid \u003c==\u003e|Sensors/Action| Preds\n    Grid \u003c==\u003e|Sensors/Action| Herbs\n    \n    %% God Mode Loop\n    Pygame -.-\u003e|Chat| God\n    God \u003c==\u003e|Tools| Pygame\n    God -.-\u003e|Inference| Ollama\n    \n    %% Council Loop\n    God -- Summon --\u003e Council\n    Council -.-\u003e|Debate| Ollama\n    \n    %% Logging\n    Pygame -- Log Data --\u003e MLflow\n```\n\n---\n\n## 🚀 Installation \u0026 Setup\n\n### Prerequisites\n- **Python 3.9+**\n- **Ollama** installed and running (`llama3.2` model pulled).\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/alwaysvivek/evolving-ai-biosphere.git\ncd evolving-ai-biosphere\n```\n\n### 2. Setup Virtual Environment\nWe provide a unified script to set up the environment and install dependencies:\n\n```bash\n# Make the script executable\nchmod +x setup_env.sh\n\n# Run the setup (creates venv and installs all requirements)\n./setup_env.sh\n```\n\n---\n\n## 🎮 How to Run\n\n### Step 1: Start Background Services\nThis script starts **MLflow** (logging) and checks for **Ollama** (AI Brain).\n```bash\npython3 launch_services.py\n```\n*Wait until you see: `✅ MLflow UI started at http://127.0.0.1:5001`*\n\n### Step 2: Run the Simulation\nOpen a **new terminal tab/window**, activate the environment, and run:\n```bash\nsource venv/bin/activate\npython3 simulation.py\n```\n\n---\n\n## 🎮 Controls\n\n| Key | Action |\n| :--- | :--- |\n| **SPACE** | Pause/Resume Simulation |\n| **Type** | Enter \"God Mode\" commands (e.g., \"kill half the plants\") |\n| **R** | Print Console Report |\n| **T** | Toggle Predator Training (ON/OFF) |\n| **K** | Kill All Predators (Extinction Event) |\n| **E** | Trigger Scarcity Event (Famine) |\n\n---\n\n## 📊 Monitoring\n\nOnce the simulation starts, open **MLflow** to see live metrics including population counts, average energy, and extinction events:\n👉 **http://127.0.0.1:5001**\n\n---\n\n## 📜 License\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwaysvivek%2Fevolving-ai-biosphere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falwaysvivek%2Fevolving-ai-biosphere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwaysvivek%2Fevolving-ai-biosphere/lists"}