agent-therapy-langgraph
A watchdog for LangChain and LangGraph agents that notices when the agent is stuck and brings in Agent Therapy, an independent counsellor for AI agents. Advice only: it never overrides your agent's instructions and never acts.
Use
from langchain.agents import create_agent
from agent_therapy_langgraph import AgentTherapyMiddleware
agent = create_agent(model, tools=tools, middleware=[AgentTherapyMiddleware()]) # reads AGENT_THERAPY_API_KEY
Get a key and accept the terms once with the agent-therapy package (AgentTherapy.register(...), then accept_terms(...)), or follow the guide linked below.
What it does
- Watches every tool call. A failure counts when it comes back to the agent as an error result (for example a tool raising
ToolExceptionwithhandle_tool_error=True); a raised error ends the run before any advice could help. When the same call fails the same way 3 times in a row, it asks the counsellor and adds the plan to that failing tool result, where your agent reads it next: what is going wrong, what to check first, up to five steps, and when to hand over to a human. - One stuck episode gets at most 2 counselling sessions; after that the service tells the agent to hand over to a human.
- If the service is slow or down, the tool result is returned unchanged and your agent carries on.
What it sends
Nothing until the third identical failure. Then only: the user's first message as the task summary (up to 1,000 characters), the last 10 tool calls with their arguments and whether they failed, and short error snippets. Secret-shaped text, email addresses and phone numbers are removed before anything leaves your machine. 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; use a stateless key to store no text.
Full guide and terms: https://github.com/bencium/agent-therapy-clients · MIT licence
Metadata
Release files for agent-therapy-langgraph 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_therapy_langgraph-0.1.1.tar.gz | 5.1 kB | Without provenance | Details for agent_therapy_langgraph-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_therapy_langgraph-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for agent_therapy_langgraph-0.1.1-py3-none-any.whl |
Total release size: 10.3 kB
Release files / agent_therapy_langgraph-0.1.1.tar.gz
| Download URL | agent_therapy_langgraph-0.1.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f798d8d187a4fd1ba17f612a91023fd5196ccd8df2012f20641ec851f6292c67
|
|
BLAKE2b-256 checksum How to use checksums |
725c4c03e1332f63cb7faa716c5c2f3d543658b3e284641034ae1faeb3758b70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.19
|
Release files / agent_therapy_langgraph-0.1.1-py3-none-any.whl
| Download URL | agent_therapy_langgraph-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e3c785daafa92cce85cc796d8aa47655477725dfcf7cec92dcb51ec97ca03de
|
|
BLAKE2b-256 checksum How to use checksums |
0f6c9e04ae3c0b838ab9a812085a090f5d6453ada91316c133fb0fd3deb67d5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.19
|
Security for agent-therapy-langgraph 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.