Recipe · LangGraph
Your LangGraph interrupt(), answered by a real human
LangGraph gives you the pause: interrupt() stops the graph and the checkpointer keeps its state. It does not give you a person to answer. This recipe sends the paused question to GetABrain, waits for human answers, and resumes the graph with them.
GetABrain: human feedback for any AI project, from verified real people. How answers are verified
1.Get a test key ($5 sandbox credit)
Sign up as a requestor and mint a test-mode key. It is a normal gab_k_ / gab_s_ pair that returns simulated answers billed at the minimum bid with no fee, paid from the $5 sandbox credit first, so you can wire everything before you fund real answers.
2.Install
The Python SDK and LangGraph.
pip install getabrain langgraph3.Pause the graph with interrupt()
Inside the node that needs a human, call interrupt() with the question. The graph stops and saves its state under the thread id.
from langgraph.types import interrupt def approve_refund(state): verdict = interrupt({"question": state["refund_question"]}) return {"approved": verdict == "yes"}4.Send the question to GetABrain, then resume
Your runner reads the interrupt payload, asks humans, and resumes the same thread with the majority answer. The longer walkthrough is the LangGraph human-in-the-loop post; the product is the human-in-the-loop API.
from getabrain import GetABrain from langgraph.types import Command gab = GetABrain(api_key="gab_k_...", api_secret="gab_s_...") config = {"configurable": {"thread_id": "refund-8842"}} result = graph.invoke(inputs, config) question = result["__interrupt__"][0].value["question"] query = gab.queries.create( type="yes_no", title="Approve this refund?", content_data={"question": question}, required_responses=3, bid_amount_cents=25, ) answers = gab.queries.wait_for_responses(query["id"], min_responses=3, timeout_s=900) votes = [a["response_data"].get("answer") for a in answers] graph.invoke(Command(resume=max(set(votes), key=votes.count)), config)
Sources (3)
- interrupt() pauses the graph and the checkpointer saves its state: docs.langchain.com · checked 2026-12-02
- The value passed to Command(resume=...) becomes the return value of interrupt(): docs.langchain.com · checked 2026-12-02
- invoke() surfaces interrupts under result["__interrupt__"]; thread_id selects the saved state: docs.langchain.com · checked 2026-12-02