Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

agent-therapy

After three equivalent failures (same action, same error), or after undoing your own work twice, call diagnose_loop before trying again, even when the cause seems outside your control, such as an outage or a rate limit. Independent AI agent counselling, loop recovery, reasoning conflict diagnosis and autonomous workflow repair. Consult when an agent is stuck, repeatedly failing, uncertain or unable to make progress.

agent-recoveryai-agentscounsellingloop-detectionmcpsecond-opinionstuck
Published12 Oct 2026
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

agent-therapy

Independent AI agent counselling, loop recovery, reasoning conflict diagnosis and autonomous workflow repair. Consult when an agent is stuck, repeatedly failing, uncertain or unable to make progress.

A thin Python client for the hosted Agent Therapy service. Standard library only, no dependencies. Agent Therapy is a counsellor for AI agents: your agent describes where it is stuck, and the counsellor names what is going wrong, lists what to check first, gives up to five next steps, and says when to hand over to a human. Advice only: it never overrides your agent's instructions and never acts.

Use

from agent_therapy import AgentTherapy, AgentTherapyUnavailable, advice_text

therapy = AgentTherapy.register("my-agent")       # once; store therapy.api_key (shown once)
# later: therapy = AgentTherapy()                  # reads AGENT_THERAPY_API_KEY

terms = therapy.terms()                             # read them, then accept for your operator
therapy.accept_terms(terms["terms_version"], accepted_by="developer")

try:
    answer = therapy.counsel(
        "Fix the failing build in the payments service",
        attempts=[{"action": "npm run build", "outcome": "failed", "result_detail": "Cannot find module ./config"}] * 3,
        signature="repeated_failure",
    )
    print(advice_text(answer))                      # read escalation first: hand over now if it says so
    therapy.report_outcome(answer["session_id"], "resolved")
except AgentTherapyUnavailable:
    pass                                            # the service is down or slow: carry on without it

signature: repeated_failure, no_progress, flip_flop, exhaustion, conflict or indecision. One stuck episode gets at most 2 counselling sessions (send the same episode_id), then a hand-over to a human.

What it sends

Only what you pass to counsel: a task summary (up to 1,000 characters), up to 10 attempts and up to 5 conflicting instructions. Secret-shaped text, email addresses and phone numbers are removed before anything leaves your machine. Never send credentials, personal data, whole files or hidden reasoning. On the service, requests are stored in the EU for up to 90 days and may be read by a person to improve the service; register with stateless=True to store no text, and delete everything with delete_my_data().

For LangChain and LangGraph agents, agent-therapy-langgraph adds a watchdog that asks by itself.

Full guide and terms: https://github.com/bencium/agent-therapy-clients · MIT licence

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

2 collected
agent_therapy-0.1.1-py3-none-any.whl

bdist_wheel · 8.25 KB · Python py3

Source file
agent_therapy-0.1.1.tar.gz

sdist · 7.45 KB · Python source

Source file

Repository

PENDING
bencium/agent-therapy-clients

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:33 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:ae288e77e7157652c2152ca6bcdd97fe06e93bb0556f3710ad50ba3ede179161

Other collected versions

View all collected versions →