etot-core
Shared engine for ETOT agentic loops: a produce → check → revise controller, a structured Claude client, a run logger, and config loading. It knows nothing about any one tool's prompts, rules, or corpus — those live beside each tool that uses it.
Motif is the first tool built on it.
What's in it
etot_core/
loop.py generic plan -> act -> check -> revise -> stop controller
llm.py thin Claude client: one call, structured JSON out, usage tracked
logger.py per-run directory with every prompt, response, and metric saved
config.py load YAML config with model roles and critic rules
Install
pip install etot-core
Python 3.10+. Requires an Anthropic API key at call time (ANTHROPIC_API_KEY or a context-scoped key passed to core.llm).
A tool path that never calls a model can load its config without a key: load_config(path, require_key=False). The default (require_key=True) raises when no key is available.
Snapshots
RunLogger.snapshot_corpus(processed_dir, names) copies what a run reads into runs/<id>/corpus/, driven by processed_dir/manifest.json. Each entry needs a name; its files default to <name>.txt and <name>.jsonl, or it can list its own as "files": ["library.jsonl", ...]. A words count is recorded when every entry has one.
Use it in a new tool
from etot_core.loop import run_loop
from etot_core.logger import RunLogger
from etot_core import llm
result = run_loop(
state={},
produce=produce, # state -> state: first draft into state
check=check, # state -> verdict: {"pass": bool, "failures": [...]}
revise=revise, # state, verdict -> state: address failures
max_iterations=3,
)
The loop stops on a passing verdict, on no progress (the same set of failures twice running), or at
max_iterations. Failures are identified by (insight_id, rule) by default; pass failure_key= to name them
by your own fields, e.g. failure_key=lambda f: (f["finding_id"], f["rule"]).
Call models through llm.call, log through RunLogger, and keep tool-specific prompts, rules, and corpus handling in your own package — etot_core never talks to a tool's domain, and a tool never re-implements the loop.
License
MIT. 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 etot_core-0.3.0.tar.gz.
File metadata
- Download URL: etot_core-0.3.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15eb456bdfbc139014319cdc2aba6b5d77e43b308057ff2c91157530e43b135d
|
|
| MD5 |
6d90c002901693d357026da6365e3840
|
|
| BLAKE2b-256 |
39d1d4bc40620b82c4195c67ccb2d0e74b8e17061f65c07b0468e34b8e6b6dd3
|
File details
Details for the file etot_core-0.3.0-py3-none-any.whl.
File metadata
- Download URL: etot_core-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb77e2eabe477de763f5e77476521f2a3a89c8aff8b119186945ff9a0c60f02a
|
|
| MD5 |
13381062f0d3a8fdbbc20cfb9262c085
|
|
| BLAKE2b-256 |
ab83ac81a897f9e5714256658df196d69ae2480a4945148cb306bd96df9cf215
|