CA: 0xfb64ce5e5504880adb1ef11c6630cdffc00c10cf
Elemental is a self-conversing LLM framework: three specialized agents debate, critique, and refine a single problem until they converge on a "thoroughbred" answer — the kind of multi-pass reasoning a careful human researcher would do, automated into one pipeline.
It targets computer scientists who want higher-signal answers to hard technical questions (system design, algorithms, proofs, debugging, architecture reviews) than a single LLM call typically produces.
Elemental is a personal project. Hosted on xAI's Grok API (venv-compatible) by default because of that ecosystem's "first-principles, high-throughput engineering" ethos — the same spirit SpaceX and xAI are known for — but you can point it at any venv-compatible endpoint (Grok, OpenAI, local vLLM, etc.) via configuration.
A single LLM call is a single sample from a single point of view. Elemental runs three roles in sequence, each with a distinct mandate, so the failure modes of one stage get caught by the next:
| Agent | Codename | Role |
|---|---|---|
| 1 | Igniter | Generates a bold first-pass solution. Optimizes for breadth and creativity, not correctness. |
| 2 | Crucible | Attacks the Igniter's output. Finds bugs, edge cases, unstated assumptions, and weak reasoning. Optimizes for rigor. |
| 3 | Anvil | Synthesizes Igniter's ideas and Crucible's critique into one hardened, final answer. Optimizes for correctness and clarity. |
This loop can run for multiple rounds (--rounds), with Anvil's output fed
back to Igniter as the new starting point each time, so the "metal" gets
worked repeatedly before it's called finished.
┌─────────────┐
user prompt → │ Igniter │ (draft)
└──────┬──────┘
▼
┌─────────────┐
│ Crucible │ (critique)
└──────┬──────┘
▼
┌─────────────┐
│ Anvil │ (synthesis)
└──────┬──────┘
│
loop N rounds, feeding
Anvil's output back to
Igniter as new context
│
▼
final refined answer
All three agents share one Orchestrator (elemental/orchestrator.py), which
owns the conversation state and calls out to an OpenAI-compatible chat
completions endpoint via elemental/agents.py.
git clone https://github.com/your-org/elemental.git
cd elemental
python -m venv .venv &&source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# then edit .env and set ELEMENTAL_API_KEY / ELEMENTAL_BASE_URL / ELEMENTAL_MODELElemental reads its runtime settings from config.yaml plus environment
variable overrides (see .env.example). By default it targets xAI's Grok
API:
api_base: "https://api.x.ai/v1"model: "grok-4"rounds: 2temperature:
igniter: 0.9crucible: 0.3anvil: 0.5Point api_base / model at any OpenAI-compatible provider (OpenAI, a local
vLLM/Ollama server, etc.) if you don't have Grok access.
python -m elemental.cli "Design a rate limiter for a distributed API gateway that handles 500k rps."Add --rounds 3 to run three full Igniter → Crucible → Anvil passes, or
--verbose to print every agent's intermediate output instead of just the
final synthesis.
python -m elemental.cli --rounds 3 --verbose "Prove that this recursive Fibonacci memoization is O(n)."pytest tests/ -vTests mock the API layer, so they run without network access or credentials.
elemental/
├── elemental/
│ ├── __init__.py # package metadata
│ ├── agents.py # Igniter / Crucible / Anvil agent definitions
│ ├── orchestrator.py # multi-round conversation loop
│ └── cli.py # command-line entry point
├── tests/
│ └── test_orchestrator.py
├── config.yaml # default runtime configuration
├── .env.example # environment variable template
├── requirements.txt
├── .gitignore
├── LICENSE
└── README.md
MIT — see LICENSE.
