Brief IA

OpenAI and Anthropic: The Future of LLM Agents with Human Oversight

💻 Code & Dev·Tom Levy·

OpenAI and Anthropic: The Future of LLM Agents with Human Oversight

OpenAI and Anthropic: The Future of LLM Agents with Human Oversight
Key Takeaways
1OpenAI's GPT-5.4 and Anthropic's Opus 4.6 excel in complex agentic tasks.
2Human integration remains crucial to avoid errors in automated workflows.
3LangGraph uses interruptions to allow human intervention at key moments in the process.
💡Why it mattersThe balance between automation and human control is essential for the reliability of advanced AI systems.
Le brief IA que lisent les pros

Le brief IA que les pros lisent chaque soir

Les 7 actus IA du jour, décryptées en 5 min. Gratuit.

Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.

Choisis ton rythme

Gratuit · Pas de spam · Désabonnement en 1 clic

📄
Full Analysis

Introduction to LLM Agents and Human Intervention

Advanced language models, such as GPT-5.4 developed by OpenAI and Opus 4.6 from Anthropic, have proven effective in managing complex and prolonged agentic tasks. These models are increasingly integrated into personal and professional environments, where they are used for a variety of tasks ranging from financial analysis to application development, as well as in-depth research.

These agents, whether embedded in highly autonomous systems or in predefined workflows, are capable of executing multi-step tasks. They utilize various tools to achieve their objectives while requiring minimal human supervision. However, this supervision, although minimal, is essential. Indeed, due to the probabilistic nature of language models, errors can occur and propagate within the workflow, especially when many agentic components are chained together.

Workflow Example

Let’s take the example of a workflow designed to generate content for social media. Here’s how it works:

  1. The user inputs a topic of interest, such as "latest news on Anthropic."
  2. A web search node uses the Tavily tool to find online articles related to the topic.
  3. The best search result is selected and passed to a language model in the content creation node, which generates a post for social media.
  4. In the review node, two checkpoints allow for human intervention:
    • The generated content is presented for approval, rejection, or modification by a human.
    • After approval, the workflow activates the Bluesky API tool and requests final confirmation before publication.

Key Concepts

The central concept of the HITL (Human-In-The-Loop) configuration in LangGraph relies on interruptions. These interruptions, implemented via interrupt() and Command in LangGraph, allow for the suspension of workflow execution at specific moments to display information to the user and await their feedback before proceeding.

  • Command is a versatile object that allows updating the state of the graph (update), specifying the next node to execute (goto), or capturing the necessary value to resume execution (resume).

Here’s how it works:

  1. When an interrupt() function is reached, execution is paused, and relevant information is presented to the user.
  2. After the user responds, the response values are passed back to the graph to resume execution.
  3. The response value in resume is returned in the variable decision, which the node will use for the continuation of execution.

Interruptions are dynamic and can be placed anywhere in the code, unlike static breakpoints, which are fixed.

Code Walkthrough

Initial Setup

To begin, we install the necessary dependencies and generate API keys for Bluesky, OpenAI, LangChain, LangGraph, and Tavily.

# requirements.txt
langchain-openai>=1.1.9
langgraph>=1.0.8
langgraph-checkpoint-sqlite>=3.0.3
tavily-python>=0.7.21
export OPENAI_API_KEY=your_openai_api_key
export TAVILY_API_KEY=your_tavily_api_key
export BLUESKY_HANDLE=yourname.bsky.social
export BLUESKY_APP_PASSWORD=your_bluesky_app_password

Defining the State

We configure the state, which is the structured data object shared as the central memory for the graph. It includes fields that capture key information, such as the content of the post and the approval status.

Node-Level Interruption

Interruptions can occur at the node level or within tool calls. The human review node is set up to pause execution and present the preliminary content to the user for review.

Tool-Level Interruption

Interruptions can also be defined at the tool call level. This is demonstrated in the next human review checkpoint in the approval node before the content is published online on Bluesky.

Configuring the Graph with a Checkpoint

Next, we connect the nodes in a graph for compilation and introduce an SQLite checkpoint to capture snapshots of the state at each interruption.

Conclusion

We have explored the concepts of interruptions, Command, checkpoints, and threads. For a complete implementation, please refer to the GitHub repository.

Brief IA — L'actualité IA en français

L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.