Observed since 20 Oct, 21:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Detect repeat, cyclic, and stagnation loops in AI agent tool-call sequences, with cross-session pattern learning. Part of the agentbelt suite.
Detect repeat, cyclic, and stagnation loops in AI agent tool-call sequences — with cross-session pattern learning. Part of the agentbelt suite.
pip install agentbelt-loop
from agentbelt_loop import LoopDetector, LoopPolicy, LoopDetected
detector = LoopDetector(LoopPolicy(max_exact_repeats=3))
detector.record("session-1", tool="search", args={"q": "foo"}, result=result)
try:
detector.check("session-1")
except LoopDetected as e:
print(e.kind, e.detail) # "repeat" | "cycle" | "stagnation" | "known_pattern"
Once a cyclic shape (e.g. search → rephrase_query → search → rephrase_query)
has been confirmed a loop in enough distinct sessions, new sessions matching
that shape trip early — after 2 local repeats instead of waiting out the
full threshold every time.
print(detector.impact_report())
# 3 loop(s) detected across 5 check(s) (repeat=3)
Breaks down detections by kind, and calls out known_pattern catches
specifically since those are the cross-session differentiator in action —
loops caught early because another session already proved the shape.
See the suite README
for the full concept and how this fits with agentbelt-budget and
agentbelt-sampler.
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 8 Sept 2026 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:172420dccfc00f1301bb0dc70e8d5bf40eb04aaf57016cfc2021c4f1a7f7d065