Repository navigation
Replies: 3 comments 2 replies
|
Yes, this fits well, and you can keep your workers and NATS layer as they are. The key is to treat the Deep Agent as a supervisor that is woken by events, not as a loop that waits on workers. 1. Workers as tools, not sub-agents. Deep Agents' 2. Continuation is driven by your result consumer. The graph won't wake itself up. When a result lands, your NATS consumer re-invokes the agent on the project's thread. The checkpointer restores everything, and the model decides what to do next: agent = create_deep_agent(
model=...,
tools=[read_project_state, dispatch_task, record_evaluation],
system_prompt=SUPERVISOR_PROMPT,
checkpointer=checkpointer, # e.g. Postgres
store=store, # cross-session memory
interrupt_on={"dispatch_task": True}, # optional human approval
)
config = {"configurable": {"thread_id": f"project:{project_id}"}}
async def on_result(msg):
r = json.loads(msg.data)
await agent.ainvoke(
{"messages": [{"role": "user", "content":
f"Worker finished {r['task_id']}: {r['summary']}. Evaluate it against the objective and decide the next step."}]},
config,
)
await msg.ack() # ack only after the step is checkpointedTo discover missing work when nothing is running, add a scheduled tick that invokes the same thread with "Review the objective and backlog." 3. Interruption and recovery. The checkpointer saves after every step, so after a crash you just invoke the same
4. Where state should live:
The agent should read and write project records only through tools and never treat its own memory as authoritative. Then a reset or model change can't corrupt the project. Smallest addition to what you have: one supervisor agent, those three tools, a Postgres checkpointer, and a result consumer that calls |
|
Hi John, I’d keep your NATS setup and Codex workers as they are and test one thing in Deep Agents: whether its task-list tool ( For example, a research worker might return good sources for one claim while leaving a second claim unverified. After a restart, I’d give both coordinators the same result and see whether each keeps the second claim open and assigns a focused follow-up. If Codex Goals does that just as consistently, I’d keep your current setup. If Deep Agents handles it better, that gives you a specific reason to add it without changing the workers. |
|
Hi John one additional failure scenario worth testing in your architecture is the gap between persisting a worker result, acknowledging the NATS message and scheduling the supervisor's next run. If the coordinator crashes after acknowledging the result but before publishing the wake up signal the result could remain unprocessed even though it was successfully persisted This would keep the external project records authoritative while allowing LangGraph to focus on planning, evaluation and checkpointed reasoning. The key comparison with native Codex Goals would be whether Deep Agents improves decision quality and recovery observability without duplicating your existing coordination infrastructure. Reference : https://docs.langchain.com/oss/python/deepagents/async-subagents#handle-subagents-waiting-for-input |
Uh oh!
There was an error while loading. Please reload this page.
We have a working NATS/JetStream coordination layer, Codex workers on separate machines, project checkpoints and automatic result delivery.
We’re considering how to add an agent that maintains a project objective, discovers missing work, delegates, evaluates outcomes and revises its plan across sessions. The user should not have to supply every next task.
Would Deep Agents with LangGraph persistence be an appropriate supervisor over those existing workers? What state should belong to the graph versus agent-managed memory and authoritative project records?
Could you point us to a maintained example demonstrating model-selected continuation after worker completion, including interruption and recovery? We’d value a review identifying the smallest addition and where our current infrastructure already covers the requirement.
All reactions