docs / env-kernel / overview

env-kernel

A deterministic, game-agnostic simulation kernel — LLMs are brains, code is physics.

fg-env-kernel is the engine underneath Fareground's simulations. You describe a world as declarative data (JSON/dict), and the kernel compiles it into an executable, deterministic, multi-agent simulation. Agents — real LLMs, cheap heuristics, or test stubs — make discrete, turn-based decisions; the kernel is the deterministic rule engine that resolves those decisions and evolves the world. The engine knows nothing about chess, markets, or elections — those are just configurations.

The core idea

Separation of concerns

Layer Owns Examples
Agent (decision_fn) Choices LLM, heuristic, test stub
Kernel runtime Rules & consequences preconditions, resolution, effects, termination
Physics & dynamics Continuous evolution coupled ODEs, property drift, world events
Template The world itself entity types, actions, physics block, win conditions

The same world runs identically with real LLM agents or deterministic stubs — the agent interface is a plain callback, with no LLM dependency anywhere in the kernel.

Status

Version 0.1.0 (alpha) · Python ≥ 3.11 · single runtime dependency (pydantic>=2.0) · 28 test files, ~353 tests, with determinism explicitly tested (tests/test_determinism.py). Freshly extracted from the Fareground platform (single initial commit); license intentionally unset (proprietary, TBD). Continuous time and physics are the newest features (Unreleased in the changelog). Known debt: runtime/engine.py (3,284 lines) is a self-acknowledged "god class" mid-extraction, and docs/ARCHITECTURE.md in the repo still describes the parent monorepo's layout — the docs here reflect the actual package.

→ Start with Getting started · Concepts · API reference · Examples