See docs/DISCLAIMER_SNIPPET.md
Alpha Asi World Model
Current runnable path โ 1.14.0
Mode: Research training. Explores generated grid worlds using a small learner and local API.
Prerequisites: torch, numpy, FastAPI and the demo requirements; CPU training can be slow.
After installation:
python -m alpha_factory_v1.demos check alpha_asi_world_model
python -m alpha_factory_v1.demos run alpha_asi_world_model
Expected result: Local web service on port 7860; stop with Ctrl+C.
Scope: Grid-world research only; ASI and generalization beyond the tested environments are not established.
The catalog explains installation, stopping, backups and recovery. Browser charts for legacy demos are labeled sample replays. Original research narratives and advanced scripts below are preserved; they do not expand the tested scope stated here.
This repository is a conceptual research prototype. References to "AGI" and "superintelligence" describe aspirational goals and do not indicate the presence of a real general intelligence. Use at your own risk. Nothing herein constitutes financial advice. MontrealAI and the maintainers accept no liability for losses incurred from using this software.
Each demo package exposes its own __version__ constant. The value marks the revision of that demo only and does not reflect the overall AlphaโFactory release version.
ฮฑ-ASI World-Model Demo ๐๏ธโจ
The open-ended curriculum engine + MuZero learner that powers the
Alpha-Factory v1 multi-agent runtime.
Out-Learn ยท Out-Think ยท Out-Design ยท Out-Strategise ยท Out-Execute
0 Table of Contents
- Why this demo matters
- Quick-start ๐ฅ
- Offline setup
- High-level architecture ๐บ๏ธ
- Meet the agents ๐ค (โฅ 5)
- Runtime controls ๐ฎ
- Deployment recipes ๐
- Safety, antifragility & governance ๐ก๏ธ
- Extending the demo ๐งฉ
- Troubleshooting ๐ง
- Production checklist โ
- License & citation
1 Why this demo matters
MissionโProve that a constellation of agentic micro-services can independently grow their own synthetic worlds (open-ended POET curriculum), learn a general world-model (MuZero-style), automate strategy research, detect live alpha opportunities across industries, and march toward the ฮฑ-ASI referenced by Vincent Boucher, President of MONTREAL.AI and QUEBEC.AI โก).
Success criteria โ
| Pillar | Concrete demonstration |
|---|---|
| Open-Endedness | Automatic generation & evaluation of ever harder MiniWorld mazes |
| World-Models | MuZero learner predicts reward/value & policy without ground-truth rules |
| Multi-Agent | โฅ 5 independent Alpha-Factory agents coordinate via A2A bus |
| Cross-Industry Alpha | StrategyAgent spots profitable โalphaโ events (simulated market feed) |
| Antifragility | SafetyAgent can freeze learner on NaN/spike; system self-recovers |
| Local-First | No internet or API keys required; LLM helpers activate only if keys provided |
2 Quick-start ๐ฅ
# โ Local Python (CPU or GPU)
pip install -r requirements.txt # torch, fastapi, uvicornโฆ
# All interactive helpers (`run_ui`, `run_headless`) require these packages.
torch is by far the largest dependency. Tests that import it are skipped when
the package is missing. For a short smoke test use:
pytest -m 'not e2e'
# new CLI (after `pip install -e .` at repo root)
alpha-asi-demo --demo # same as `python -m alpha_asi_world_model_demo --demo`
alpha-asi-demo --demo --no-llm # force-disable the optional LLM planner
python -m webbrowser http://localhost:7860 # dashboard & Swagger
# โ One-liner Docker
python -m alpha_asi_world_model_demo --emit-docker
docker build -t alpha_asi_world_model .
docker run -p 7860:7860 alpha_asi_world_model
# โ Helm (K8s)
python -m alpha_asi_world_model_demo --emit-helm
helm install alpha-asi ./helm_chart
# โ Notebook
python -m alpha_asi_world_model_demo --emit-notebook
jupyter lab alpha_asi_world_model_demo.ipynb
# โ Colab
Open `alpha_asi_world_model_colab.ipynb` in Google Colab for an end-to-end guided setup.
Nonโtechnical users can run it step by step:
1. Visit the notebook on GitHub and click **Open in Colab**.
2. Wait for the environment to start then choose **Runtime โ Run all** (or run each cell manually).
3. The notebook installs requirements and launches the demo. When no API key is provided it automatically sets `NO_LLM=1`.
4. Interact with the dashboard in the new browser tab and run the final **Shut down** cell when done.
# โ Shell helper
./deploy_alpha_asi_world_model_demo.sh
# โ OpenAI Agents bridge
# uses ``OPENAI_API_KEY`` if set
python openai_agents_bridge.py
# โ Google ADK gateway
ALPHA_FACTORY_ENABLE_ADK=true python openai_agents_bridge.py
Set OPENAI_API_KEY to connect the bridge to the OpenAI Agents platform.
Tip ๐ก Set
ALPHA_ASI_SEED=<int>orgeneral.seedinconfig.yamlto reproduce identical curriculum runs. Tip ๐ก SetALPHA_ASI_SILENT=1to hide the startup banner.
Offline setup
When working without internet access, first build a local wheelhouse:
mkdir -p /media/wheels
pip wheel -r requirements.txt -w /media/wheels
pip wheel -r ../../../requirements-dev.txt -w /media/wheels
Install and verify using the wheelhouse from the repository root:
WHEELHOUSE=/media/wheels AUTO_INSTALL_MISSING=1 ./codex/setup.sh
WHEELHOUSE=/media/wheels AUTO_INSTALL_MISSING=1 \
python check_env.py --auto-install --wheelhouse /media/wheels
See docs/OFFLINE_SETUP.md for a short reference.
Set NO_LLM=1 to disable the planning agent when no API key is available. The
deploy_alpha_asi_world_model_demo.sh helper exports this variable
automatically.
Define ALPHA_ASI_LLM_MODEL=gpt-4o-mini to change the planner's model.
Device selection
config.yaml exposes a device field controlling which accelerator PyTorch
uses. Accepted values are cpu, cuda and auto. With auto (the default),
the demo runs on GPU when torch.cuda.is_available() returns True and falls
back to CPU otherwise.
3 High-level architecture ๐บ๏ธ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Alpha-Factory Bus (A2A) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโโโโโโโโโโโโโโ curriculum โโโโโโโโโโโโโ telemetry โโโโโโโโโโโโโโ โ
โ โ StrategyAgentโโโโโโโโโโโโโโโโโบโ Orchestr. โโโโโโโโโโโโโโโโบโ UI / WS โ โ
โ โโโโโโโโโโโโโโโโ โ (loop) โโโโโโโโโโโโโโโโโ Interface โ โ
โ โฒ โฒ โโโโโโโโโโโโโ commands โโโโโโโโโโโโโโ โ
โ โ โ new_env/reward โฒ โ
โ plans โ โ loss stats โ halt โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโดโโโโโโโโ context โ โ โ
โ โ ResearchAgentโโโโโโโโโโโโโโโโโบ Learner (MuZero) โโ SafetyAgent (loss guard) โ
โ โโโโโโโโโโโโโโโโ โ โฒ โ
โ code patches โ โ โ
โ โโโโโโโโโโโโโโโโ โ โ gradients โ
โ โ CodeGenAgent โโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโ โ โ
โ โผ โ
โ POET Generator โ MiniWorlds (env pool) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- All messages flow through a single in-proc A2A topic bus (swap for Redis/NATS at scale).
- MCP is used by ResearchAgent to attach rich โcontext blocksโ to learner queries when an LLM key is supplied.
- Components comply with OpenAI Agents SDK & Google ADK lifecycle
(
init/step/shutdown), so they can be re-packaged as micro-services at will.
4 Meet the agents ๐ค (โฅ 5)
| Topicย ๐ฐ | Skill | How it contributes to End-to-End Alpha |
|---|---|---|
| planning_agent | Long-horizon curriculum sketching (optionally via GPT-4o) | Keeps learner near its โzone of proximal developmentโ โ faster capability gain |
| research_agent | Literature & data mining (papers, patents, SEC filingsโฆ) | Injects distilled insights; helps learner transfer skills across domains |
| strategy_agent | Real-time alpha detection (mock market feed ๐) | Signals lucrative industry opportunities; triggers env mutations that mimic them |
| codegen_agent | Auto-ML / network surgery | Evolves MuZero hyper-params & architecture โ antifragile optimisation |
| market_agent | Streams synthetic or live financial ticks | Provides cross-domain stressor; validates Alpha-capture loops |
| safety_agent | Alignment guardrails | Halts on NaN/catastrophe; enforces resource quotas & ethical policies |
(If a concrete implementation is absent the stub logs every call, guaranteeing bus liveness even on a clean clone.)
5 Runtime controls ๐ฎ
| REST | Use case |
|---|---|
GET /agents |
List active agent topics |
POST /command {"cmd":"new_env"} |
Force-spawn a fresh world |
POST /command {"cmd":"stop"} |
Graceful halt โธ |
WebSocket (/ws) streams JSON telemetry every ui_tick steps:
{"t":1234,"r":-0.01,"loss":0.872} โ plug into Grafana or a custom React chart.
6 Deployment recipes ๐
| Target | Guide |
|---|---|
| ๐ณ Docker | Auto-generated Dockerfile (<100 MB slim). GPU builds: swap base for nvidia/cuda:runtime-12.4. |
| โธ๏ธ Kubernetes | Run --emit-helm; edit values (replicaCount, resources.limits). Works on GKE, AKS, EKS, k3d. |
| ๐ Pure Python | No Docker needed; just pip install -r requirements.txt. |
| ๐ Air-gapped | Offline wheels; set NO_LLM=1 to disable the planner or omit API keys. |
| ๐ Cloud LLM mode | Export OPENAI_API_KEY โ PlanningAgent & ResearchAgent auto-upgrade to LLM assistants. |
7 Safety, antifragility & governance ๐ก๏ธ
- Reward-hacking firewall โ StrategyAgent & SafetyAgent cross-check any sudden reward spike; suspicious events quarantine the environment seed for forensic replay.
- Loss guard โ Threshold
loss > 1e3orNaNtriggers globalstop. - Compute budget โ Learner train loop obeys
torch.set_grad_enabled(False)for evaluation, cuts GPU utilisation to โค 80ย %. - Policy logging โ Every 10โฏk steps, MuZero weights hashed (SHAโ256) + signed for traceability.
- Audit-ready โ All IPC messages dumped to
./logs/audit_<ts>.ndjson(regulator-friendly).
8 Extending the demo ๐งฉ
One-file hackability yet enterprise scalability.
- New env type โ subclass
MiniWorld(step/reset/obs), register inPOETGenerator.propose. - Swap learner โ Implement
.act/.remember/.trainin a new class; StrategyAgent can trigger hot-swap via{"cmd":"swap_learner"}. - External micro-service โ Reuse
BaseAgent; deploy as HTTP worker that bridges to A2A via WebSockets.
9 Troubleshooting ๐ง
| Problem | Cause / Fix |
|---|---|
| โUI stallsโ | Browser blocked WS โ check console; ensure port 7860 reachable. |
| CUDA OOM | export TORCH_FORCE_CPU=1 or downsize net via CodeGenAgent. |
| Docker build slow | Add build-arg TORCH_WHL=<local-wheel> (offline). |
| K8s CrashLoop | kubectl logs; missing GPU driver or env var. |
| Hide banner | Set ALPHA_ASI_SILENT=1 before launching. |
Need help? Open an issue โ @MontrealAI/alpha-factory-core.
10 Production checklist โ
- Ensure
python3 --versionreturns 3.11โ3.13. - Install dependencies:
pip install -r requirements.txt. - Launch via
./deploy_alpha_asi_world_model_demo.shand visithttp://localhost:7860. - The script sets
NO_LLM=1automatically whenOPENAI_API_KEYis unset. - Provide an
OPENAI_API_KEYto unlock planner features. - Set
NO_LLM=1to skip the LLM planner even when a key is provided.
11 License & citation
Apacheโ2.0 ยฉ 2025 MONTREAL.AI
Please cite Alpha-Factory v1 ๐๏ธโจ โ Multi-Agent AGENTIC ฮฑ-AGI:
MONTREAL.AI (2025). Fully-Agentic ฮฑ-AGI: Foundation World Models for ฮฑ-ASI.
GitHub https://github.com/MontrealAI/AGI-Alpha-Agent-v0