Skip to main content

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

Metadata

Release files for agent-therapy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-therapy 0.1.1
File Size Uploaded Provenance Actions
agent_therapy-0.1.1.tar.gz 7.6 kB Without provenance Details for agent_therapy-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-therapy 0.1.1
File Interpreter ABI Platform Actions
agent_therapy-0.1.1-py3-none-any.whl Python 3 none any Details for agent_therapy-0.1.1-py3-none-any.whl

Total release size: 16.1 kB

Release files / agent_therapy-0.1.1.tar.gz

Download URL agent_therapy-0.1.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4340cc70ca51fd1644093b912539ce8198f738f47fac53ce540b4a60e07487ab
BLAKE2b-256 checksum
How to use checksums
4096a96bf50973122123318ef0030055e41b3afde58b777b17b92855613ce7bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Release files / agent_therapy-0.1.1-py3-none-any.whl

Download URL agent_therapy-0.1.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bdf72c51eb3fed2a1015d4e4144b93cf9d4052255443d5cc17aa3a2664a9f560
BLAKE2b-256 checksum
How to use checksums
79f3e77e6957585da65be40905f2afc9410af97b787383bc7ece32a987a85698
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Security for agent-therapy 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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