Skip to content

Latest commit

History

1,372 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Elemental

Chucho

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.

Why three agents?

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:

AgentCodenameRole
1IgniterGenerates a bold first-pass solution. Optimizes for breadth and creativity, not correctness.
2CrucibleAttacks the Igniter's output. Finds bugs, edge cases, unstated assumptions, and weak reasoning. Optimizes for rigor.
3AnvilSynthesizes 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.

Architecture

 ┌─────────────┐
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.

Install

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_MODEL

Configuration

Elemental 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.5

Point api_base / model at any OpenAI-compatible provider (OpenAI, a local vLLM/Ollama server, etc.) if you don't have Grok access.

Usage

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)."

Testing

pytest tests/ -v

Tests mock the API layer, so they run without network access or credentials.

Project layout

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

License

MIT — see LICENSE.

Built by Tae 🌙

About

A new way to explore XAI capabilities. Coming soon.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages