What you get
Section titled “What you get”The review-board team with one agent, the change summarizer, replaced by a LangGraph graph. Its model calls go through NuraMesh: each is policy-checked, priced, reserved against the budgets and written to the ledger, and the gates still decide whether the task is done.
Prerequisites
Section titled “Prerequisites”- NuraMesh installed with the LangGraph extra (
nuramesh[langgraph]) and on yourPATH, as in the Quickstart (install commands: Install options). - A throwaway folder to run in.
1. Create a team to adapt
Section titled “1. Create a team to adapt”nuramesh init my-team --template review-boardcreated my-team from the 'review-board' template. Next: nuramesh validate my-team/nuramesh.yaml nuramesh try my-team --fake --approve-as human:you2. Write the graph
Section titled “2. Write the graph”This adds the graph to the end of team.py. It is built once per attempt by build(model). model is NuraMesh’s chat model: use it for every model call, and give the graph no provider keys of its own.
cat >> my-team/team.py <<'EOF'
# --- a tiny LangGraph graph: one node that asks the model and returns its answer ---from typing import TypedDict
from langchain_core.messages import HumanMessage, SystemMessage
class State(TypedDict, total=False): task: str instructions: str output: str
def build(model): """Called once per attempt with NuraMesh's chat model: every call it makes is checked and recorded.""" from langgraph.graph import END, START, StateGraph
def write(state: State) -> State: reply = model.invoke( [SystemMessage(content="You support a review board. Be brief."), HumanMessage(content=state["instructions"])] ) return {"output": str(reply.content)}
graph = StateGraph(State) graph.add_node("write", write) graph.add_edge(START, "write") graph.add_edge("write", END) return graph.compile()EOF3. Use it as the agent’s worker
Section titled “3. Use it as the agent’s worker”This edit swaps the summarizer’s plain worker for langgraph_worker(build) and stops if the text it expected is not there.
python - <<'EOF'from pathlib import Path
path = Path("my-team/team.py")text = path.read_text()text = text.replace("from nuramesh.team import Team, TeamEnv", "from nuramesh.adapters.langgraph import langgraph_worker\nfrom nuramesh.team import Team, TeamEnv")text = text.replace('workers={"change-summarizer": work}', 'workers={"change-summarizer": langgraph_worker(build)}')assert "langgraph_worker(build)" in textpath.write_text(text)EOF4. Validate and run
Section titled “4. Validate and run”nuramesh validate my-team/nuramesh.yamlmy-team/nuramesh.yaml: validnuramesh try my-team --fake --approve-as human:you --run-id first-runRun first-runTasks: 2 done [done] first-run-summary (change-summarizer, attempts 1): Summarize the change for the board gate is-summary (rule): passed by gate:rule gate correctness-reviewer-review (verifier): passed by agent:correctness-reviewer gate security-reviewer-review (verifier): passed by agent:security-reviewer gate maintainability-reviewer-review (verifier): passed by agent:maintainability-reviewer [done] first-run-decision (change-summarizer, attempts 1): Record the board's decision gate is-decision (rule): passed by gate:ruleBudgets: correctness-monthly (agent correctness-reviewer): spent 0.001617 of 5.00, reserved 0.000000 maintainability-monthly (agent maintainability-reviewer): spent 0.001641 of 5.00, reserved 0.000000 rb-486e135495bd (run first-run): spent 0.005391 of 2.00, reserved 0.000000 security-monthly (agent security-reviewer): spent 0.001587 of 5.00, reserved 0.000000 summarizer-monthly (agent change-summarizer): spent 0.000546 of 5.00, reserved 0.000000Ledger: run:first-run seq 46, head ae7724e36910c78e… (verified)The summary still has to pass its three reviewers: the graph does the work, the gates decide.
Check it worked
Section titled “Check it worked”nuramesh ledger verify --team my-teamorg:my-team: 5 events, head 98ec0097e33f11bd… okrun:first-run: 46 events, head ae7724e36910c78e… ok2 streams, 0 brokenThe model calls the graph made are in the same ledger as every other call, recorded as the task’s assignee with that agent’s model and budgets.
Limits
Section titled “Limits”- A graph that pauses for a human (
interrupt()or a breakpoint) sends the task to a human; resuming is an engine call, not a command. - The adapter refuses what it cannot check: non-text content, tool-call messages and extra call arguments.
- It cannot see tools your graph runs without asking: call
authorize(...)before a tool or command, and give nodes no keys of their own. - Graphs whose nodes are all
asyncare not supported yet. - This page uses the fake model only; a real provider needs the setup in the FAQ and limits.
Next steps
Section titled “Next steps”- Autonomy policies for what an agent may do
- Budgets
- Review board template
Was this page helpful?