JJoeven

Reference/Python

Python stdlib for agents

The modules Joeven Try-it boxes actually use: json, re, math, hashlib, copy, collections.

Joeven browser examples stay on the stdlib. No NumPy, no requests.

Cheat sheet

ModuleAgent job
jsonactions, traces, reports
reReAct parse, tokenize, redact
mathcosine, softmax, sqrt
hashlibapproval digests, file hashes
copy.deepcopysnapshot worlds
collections.Counterbag-of-words counts
itertoolsproduct of eval grids
functools.lru_cachecache embeddings of chunks
dataclasses (optional)typed traces on disk

Regex fragments

PatternMeaning
[a-z]{3,}tokens length ≥ 3
Thought:\s(.)ReAct thought line
sk-[A-Za-z0-9]{6,}fake API keys to redact
(?m)^# markdown headings
(?<=\.)\s+sentence split

hashlib

python
import hashlib, json
def sha(obj):
    blob = json.dumps(obj, sort_keys=True, separators=(class="tok-s">",", class="tok-s">":"))
    return hashlib.sha256(blob.encode()).hexdigest()

Always encode() — sha256 wants bytes.

copy

CallWhen
dict(d)shallow, values immutable/strings
list(xs)copy a log tail
copy.deepcopy(world)nested metrics dicts
Watch out:exec / eval are stdlib and still hostile. Use only in the multi-agent classroom oracle with tiny __builtins__.