dotsagent.io
Lingua:Italiano
Framework · LangChain Inc.

LangGraph in breve

Libreria di basso livello di LangChain per creare agenti come grafi espliciti, con stato salvato tramite checkpoint e interruzioni come funzionalità centrali. Il metodo create_agent di LangChain v1 si basa su LangGraph quando è sufficiente un loop preconfigurato.

Ideale per: Agenti con stato e attività di lunga durata, per i quali serve controllare ogni passaggio e riprendere dopo gli errori.

Informazioni principali

Responsabile
LangChain Inc.
Linguaggi
Python, TypeScript, JavaScript
Licenza
MIT
Ultima versione
langgraph 1.2.12 / langchain 1.4.3 · 28 settembre 2026
Repository
langchain-ai/langgraph · 42.550 stelle
Opzione hosted
LangSmith Deployment (formerly LangGraph Platform)
In precedenza LangGraph Platform; Studio consente la prototipazione visiva.

Guida rapida

Installa il pacchetto, configura le credenziali, quindi esegui l'agente più semplice indicato nella documentazione ufficiale. Gli ID dei modelli sono quelli usati nella documentazione e potrebbero non essere abilitati per il tuo account.

Python (LangChain create_agent)

Installa
pip install -U langchain

Richiede Provider API key, e.g. OPENAI_API_KEY

Python (LangChain create_agent)
from langchain.agents import create_agent

def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"

agent = create_agent(
    model="openai:gpt-5.5",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "What's the weather in San Francisco?"}]}
)
print(result["messages"][-1].content_blocks)

Fonte della guida rapida

Python (raw LangGraph)

Installa
pip install -U langgraph
Python (raw LangGraph)
from langgraph.graph import StateGraph, MessagesState, START, END

def mock_llm(state: MessagesState):
    return {"messages": [{"role": "ai", "content": "hello world"}]}

graph = StateGraph(MessagesState)
graph.add_node(mock_llm)
graph.add_edge(START, "mock_llm")
graph.add_edge("mock_llm", END)
graph = graph.compile()

graph.invoke({"messages": [{"role": "user", "content": "hi!"}]})

Fonte della guida rapida

Funzionalità

Qualsiasi modelloSì
Client MCPSìTramite langchain-mcp-adapters
Server MCPNon confermato
Multi-agentSìSottografi; l'harness Deep Agents aggiunge i sub-agenti
Esecuzioni durevoliSìCheckpointer per Postgres o SQLite; ripresa dopo gli errori
Approvazione umanaSìGli interrupt consentono di esaminare e modificare lo stato durante l'esecuzione
TracingSìTramite LangSmith, con LANGSMITH_TRACING=true
ValutazioniNoLa valutazione è gestita da LangSmith, non dalla libreria open source

Modifiche recenti

  • Gli agenti di LangChain v1 (create_agent) sono ora basati su LangGraph.
  • LangGraph Platform è stato rinominato LangSmith Deployment.
  • Deep Agents, un harness basato su LangGraph, aggiunge i subagent.

Alternative nello stesso linguaggio

Fonti

  1. docs.langchain.com/oss/python/langgraph/overview
  2. docs.langchain.com/oss/python/langchain/quickstart
  3. pypi.org/pypi/langgraph/json
  4. pypi.org/pypi/langchain/json
  5. registry.npmjs.org/@langchain%2flanggraph
  6. api.github.com/repos/langchain-ai/langgraph