Mastering LangGraph Tools: Error Handling Guide

Mastering LangGraph Tools: Error Handling Guide

LLMs are not perfect when calling tools. Models may attempt to call non-existent tools or fail to return parameters that match the requested schema. Strategies such as keeping the schema simple, reducing the number of tools passed at once, and using good names and descriptions can help mitigate this risk, but they are not foolproof. … Read more

Mastering LangGraph: Controllability 03

Mastering LangGraph: Controllability 03

Combining control flow (edges) and state updates (nodes) can be very useful. For instance, you might want to execute state updates and decide which node to transition to next within the same node. LangGraph provides a way to achieve this by returning an object from the Command node function: def my_node(state: State) -> Command[Literal["my_other_node"]]: return … Read more

Creating an Agent with LangGraph and Search Tools

Creating an Agent with LangGraph and Search Tools

In this tutorial, we will learn how to build an intelligent dialogue agent with memory capabilities using LangGraph and LangChain. This agent can use search tools to answer questions and maintain the continuity of conversations. 1. Obtain API Key for Search Tool Log in to the search tool website: <span>https://tavily.com/</span>, generate an API key as … Read more

Mastering LangGraph Tools: A Comprehensive Guide

Mastering LangGraph Tools: A Comprehensive Guide

Sometimes, we want the LLM that calls the tools to fill in a subset of parameters for the tool functions, while providing other values for the remaining parameters at runtime. If you are using LangChain-style tools, a simple way to handle this situation is to annotate the function parameters with InjectedArg. This annotation excludes the … Read more

Differences Between LangChain and LangGraph

Differences Between LangChain and LangGraph

In the field of large models, LangChain and LangGraph are two frameworks that have attracted considerable attention. Both aim to help developers build applications using large language models (LLMs), but they differ significantly in design philosophy, architecture, functionality, and applicable scenarios. 1. Introduction to LangChain LangChain is a framework for developing applications powered by large … Read more

Mastering LangGraph-Stream

Mastering LangGraph-Stream

LangGraph has built-in first-class stream support. Streaming output graph .stream and .astream are synchronous and asynchronous methods for streaming outputs back from the graph run. When calling these methods, several different modes can be specified (for example, `graph.stream(…, mode=”…”)`): values: This will transmit the full value of the state after each step of the graph. … Read more

Mastering LangGraph Tools Call-06

Mastering LangGraph Tools Call-06

How to Handle a Large Number of Tools The subset of tools available for invocation is typically determined by the model (although many providers also allow users to specify or limit the selection of tools). As the number of available tools increases, you may want to limit the LLM’s selection to reduce token consumption and … Read more

LangGraph Platform Business Model Overview

LangGraph Platform: Business Model Summary LangGraph is a platform for developing, deploying, and managing generative AI applications. Its core features revolve around the implementation of dynamic AI agents, including task queue management, API calls, storage and updating of conversation states and long-term memories. LangGraph supports everything from experimental applications by startup teams to enterprise-level large-scale … Read more

Mastering LangGraph: Controllability 01

Mastering LangGraph: Controllability 01

LangGraph provides a high level of control over the execution of charts. How to Create Parallel Execution Branches The parallel execution of nodes is crucial for speeding up overall graph operations. LangGraph offers native support for parallel execution of nodes, which can significantly enhance the performance of graph-based workflows. This parallelization is achieved through fan-out … Read more

Mastering LangGraph Persistence

Mastering LangGraph Persistence

LangGraph Persistence allows for easy state persistence between graph execution (thread-level persistence) and threads (cross-thread persistence). This tutorial demonstrates how to add persistence to a graph. LangGraph has a built-in persistence layer that is implemented through checkpoints. When compiling a graph with a checkpoint, the checkpoint saves a snapshot of the graph’s state at each … Read more