Archetype
Archetype is a dataframe-first ECS runtime for simulations and agent workflows. Define state with components, transform populations with processors, and keep each tick as queryable history. Use a fork to continue from an earlier state without overwriting the original run.
It is built on Daft and LanceDB. The default Python
entry point is ArchetypeRuntime; HTTP services and the CLI use the same
command layer when you need a multi-user host.
Install
pip install archetype-ecs
For a checkout, install the development environment with make sync-dev.
Run a simulation
import asyncio
from daft import DataFrame, col
from archetype import ArchetypeRuntime, AsyncProcessor, Component
class Position(Component):
x: float = 0.0
y: float = 0.0
class Velocity(Component):
dx: float = 0.0
dy: float = 0.0
class Move(AsyncProcessor):
components = (Position, Velocity)
async def process(self, df: DataFrame, **_) -> DataFrame:
return df.with_columns(
{
"position__x": col("position__x") + col("velocity__dx"),
"position__y": col("position__y") + col("velocity__dy"),
}
)
async def main() -> None:
async with ArchetypeRuntime() as runtime:
world = runtime.world("demo", processors=[Move()])
await world.spawn(Position(), Velocity(dx=1, dy=2))
await world.run(steps=3)
history = await world.query(Position)
print(history.collect().to_pylist())
asyncio.run(main())
For a regular script without async, use with ArchetypeRuntime.sync() as runtime: and omit await.
What it gives you
- Columnar processors run one DataFrame transform over every matching entity.
- Every tick is append-only, so historical reads are ordinary queries.
- Forks inherit source history and create an independent future.
- The service layer can authorize and audit mutations before a tick applies them.
Documentation
Start with the quickstart, then use the guides for components, processors, and worlds.
The site also includes the current Python API, CLI, and REST API references.
Runnable examples live in examples/. Most run without
credentials:
uv run python examples/01_world_mutations.py
uv run python examples/02_fork_counterfactual.py
uv run python examples/03_time_travel.py
uv run python examples/04_messaging.py
uv run python examples/07_hooks.py
examples/05_llm_agents.py and parts of examples/06_trajectory_analysis.py
require OPENAI_API_KEY.
Development
make sync-dev # install development dependencies
make test # run the fast test suite
make check # format and lint
make docs # generate references and build the docs site
make ci # run the merge gate
Read CONTRIBUTING.md before changing the engine. The
normative contracts are under docs/guide/.
Status
Archetype is alpha software. The append-only world, history, and fork paths are the most mature parts of the project. The HTTP layer uses development-mode authentication by default; supply your own authentication before exposing it to untrusted users.
License
Apache-2.0. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file archetype_ecs-0.4.0.tar.gz.
File metadata
- Download URL: archetype_ecs-0.4.0.tar.gz
- Upload date:
- Size: 204.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26a771fdd46e2fb0cf9f53b36883e307dc99bc0c5a23a88ec1704ee30acbe15c
|
|
| MD5 |
aa235e08ff8839a8f32de61d78b5af53
|
|
| BLAKE2b-256 |
28bbe36b4022d978c4e1068504ef7c160e157a06c5e34f80dfc5e6f52a365ddb
|
Provenance
The following attestation bundles were made for archetype_ecs-0.4.0.tar.gz:
Publisher:
release.yml on VangelisTech/archetype
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archetype_ecs-0.4.0.tar.gz -
Subject digest:
26a771fdd46e2fb0cf9f53b36883e307dc99bc0c5a23a88ec1704ee30acbe15c - Sigstore transparency entry: 2188236658
- Sigstore integration time:
-
Permalink:
VangelisTech/archetype@2c441c84c897137c7541ee90d7c9c23e53549d38 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/VangelisTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2c441c84c897137c7541ee90d7c9c23e53549d38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file archetype_ecs-0.4.0-py3-none-any.whl.
File metadata
- Download URL: archetype_ecs-0.4.0-py3-none-any.whl
- Upload date:
- Size: 270.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84f173b07dc53d9c6f6c85dd7824edaf23bc578208a8105f750304ed0ca449d3
|
|
| MD5 |
2da463d7f3c3cc13b336d9b346738599
|
|
| BLAKE2b-256 |
0fe9cdb218b14772553c5a7bc50fb90984f6dc0a1d311e99f333d6d926abbf42
|
Provenance
The following attestation bundles were made for archetype_ecs-0.4.0-py3-none-any.whl:
Publisher:
release.yml on VangelisTech/archetype
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archetype_ecs-0.4.0-py3-none-any.whl -
Subject digest:
84f173b07dc53d9c6f6c85dd7824edaf23bc578208a8105f750304ed0ca449d3 - Sigstore transparency entry: 2188236673
- Sigstore integration time:
-
Permalink:
VangelisTech/archetype@2c441c84c897137c7541ee90d7c9c23e53549d38 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/VangelisTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2c441c84c897137c7541ee90d7c9c23e53549d38 -
Trigger Event:
push
-
Statement type: