Skip to main content

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

etot_core-0.3.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etot_core-0.3.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

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

Hashes for etot_core-0.3.0.tar.gz
Algorithm Hash digest
SHA256 15eb456bdfbc139014319cdc2aba6b5d77e43b308057ff2c91157530e43b135d
MD5 6d90c002901693d357026da6365e3840
BLAKE2b-256 39d1d4bc40620b82c4195c67ccb2d0e74b8e17061f65c07b0468e34b8e6b6dd3

See more details on using hashes here.

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

Hashes for etot_core-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb77e2eabe477de763f5e77476521f2a3a89c8aff8b119186945ff9a0c60f02a
MD5 13381062f0d3a8fdbbc20cfb9262c085
BLAKE2b-256 ab83ac81a897f9e5714256658df196d69ae2480a4945148cb306bd96df9cf215

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page