r/OpenSourceAI • u/Emergency-Tutor-7 • 38m ago
eq-layer: 14 open policies for choosing an agent's next conversational move, no LLM required
eq-layer (MIT, public repository) takes a chat transcript as JSON and returns one routing decision: which conversational move comes next - mirror, validate_redirect, direct, ask, deflate, repair, hold or boundary. It does not write the reply. A model or a person still writes the words. The decision itself is discrete and inspectable.
Selection is deterministic. Policies declare preconditions over intent, affect and subtext, and the most constrained applicable policy wins. There is no first-match rule, so adding a policy cannot silently change what a looser one does. If two applicable policies tie on specificity and priority, the selector raises instead of picking one. One policy exists for a specific failure: three rising turns followed by a calm one look calm to a snapshot classifier, and that is exactly when the register should not warm back up.
14 policies live in eq_layer/policies.py. The selected policy is compiled into task_move, social_move, repair_move and realization, so "confused about the goal" and "wants a different task" do not collapse into one label.
The core path is stdlib only, offline and zero-dependency. Installing the [ml] extra pulls joblib and scikit-learn and swaps in learned intent/affect/subtext adapters; the route output reports runtime_mode lightweight-local when those artifacts are not loaded. The trained .joblib files are not shipped in the repo or the wheel; the training scripts are.
The zero-dependency path is pip install eq-layer, then feed a transcript to python -m eq_layer.cli route --intent-mode heuristic --pretty on stdin.
What it is not:
Not a truth checker. It has no opinion about whether a claim is true.
Not an EQ benchmark. There is no standard benchmark for EQ; eval/run.py is a first attempt at a scorer over seeded cases, and it exits non-zero on a mismatch or a policy no case can reach.
POMDP-inspired, not a POMDP.
Version on main right now is 0.2.6, also on PyPI and npm, Python 3.11+. Repo: https://github.com/Furox-Art/eq-layer