Skip to main content

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 ToolException with handle_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.0

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-langgraph 0.1.0
File Size Uploaded
agent_therapy_langgraph-0.1.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-therapy-langgraph 0.1.0
File Interpreter ABI Platform
agent_therapy_langgraph-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / agent_therapy_langgraph-0.1.0.tar.gz

Download URL agent_therapy_langgraph-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
776dc5bc6d20b010ed3d15ddc110c5a7ab620ab397fe3f243f9d5843b459651d
BLAKE2b-256 checksum
How to use checksums
e4e6133fcac67d265221311bfca8797b9d3e847f459b7c13ef1126b19fd4d3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Release files / agent_therapy_langgraph-0.1.0-py3-none-any.whl

Download URL agent_therapy_langgraph-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ca014d11150e2aad59ddcebc634b07325cb14837de13f53552b6f6fd358d6f5
BLAKE2b-256 checksum
How to use checksums
0b622eed5391328abf3701f5e80d3084af16589814725579a0171e0182d9b5d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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