2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Open in app
53
Search
Get unlimited access to the best of Medium for less than $1/week. Become a member
LangGraph AI agents : Building a Dynamic
Order Management System : A Step-by-Step
Tutorial
Langgraph AI代理:構建動態訂單管理系統:分
步教程
Kshitij Kutumbe · Follow
Published in AI Advances
8 min read · Jan 21, 2025
Listen Share More
AI generated illustration of LangGraph
AI生成的langgraph插圖
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 1/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
In this extremely detailed tutorial, we’ll explore LangGraph — a powerful library for
orchestrating complex, multi-step workflows with Large Language Models (LLMs) —
and apply it to a common e-commerce problem statement: deciding whether to
place or cancel an order based on a user’s query. By the end of this blog, you’ll
understand how to:
在這個極度詳細的教程中,我們將探索Langgraph - 一個功能強大的庫,用於與大型
語言模型一起精心策劃複雜的多步驟工作流(LLMs ) - 並將其應用於共享商務問題
的問題:確定是否要根據用戶查詢取消訂單。到本博客結束時,您將了解如何:
1. Set up LangGraph in a Python environment.
在Python環境中設置Langgraph 。
2. Load and manage data (e.g., inventory and customers).
加載和管理數據(例如,庫存和客戶)。
3. Define nodes (the individual tasks in your workflow).
定義節點(工作流中的單個任務)。
4. Build a graph of nodes and edges, including conditional branching.
構建節點和邊緣的圖,包括條件分支。
5. Visualize and test the workflow.
可視化和測試工作流程。
We’ll proceed step by step, explaining every concept in detail — perfect for
beginners and those looking to build dynamic or cyclical workflows using LLMs and
I have also included link to the dataset for trying this out.
我們將逐步進行,詳細解釋每個概念 - 非常適合初學者以及希望使用動態或週期性工
作流程的人LLMs我還提供了用於嘗試此功能的數據集的鏈接。
Table of Contents 目錄
What Is LangGraph? 什麼是Langgraph?
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 2/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
The Problem Statement: Order Management
問題聲明:訂單管理
Imports Explanation 進口解釋
Data Loading and State Definition
數據加載和狀態定義
Creating Tools and LLM Integration
創建工具和LLM一體化
Defining Workflow Nodes 定義工作流節點
Building the Workflow Graph
構建工作流程圖
Visualizing and Testing the Workflow
可視化和測試工作流程
Conclusion 結論
What Is LangGraph? 什麼是Langgraph?
LangGraph is a library that brings a graph-based approach to LangChain workflows.
Traditional pipelines often move linearly from one step to another, but real-world
tasks frequently require branching, conditional logic, or even loops (retrying failed
steps, clarifying user input, etc.).
Langgraph是一個庫,它為Langchain工作流提供了基於圖形的方法。傳統管道通常
會從一個步驟到另一個步驟線性移動,但是現實世界中的任務經常需要分支,條件類
似甚至循環(重試失敗的步驟,澄清用戶輸入等)。
Key features of LangGraph:
Langgraph的主要特徵:
Nodes: Individual tasks or functions (e.g., check inventory, compute shipping).
節點:單個任務或功能(例如,檢查庫存,計算運輸)。
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 3/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Edges: Define the flow of data and control between nodes. Can be conditional.
邊緣:定義數據流和節點之間的控制。可以是有條件的。
Shared State: Each node can return data that updates a global state object,
avoiding manual data passing.
共享狀態:每個節點都可以返回更新全局狀態對象的數據,避免通過手動數據傳
遞。
Tool Integration: Easily incorporate external tools or functions that an LLM can
call.
工具集成:輕鬆合併外部工具或功能LLM可以打電話。
Human-In-The-Loop (optional): Insert nodes that require human review.
人類在環(可選):插入需要人類審查的節點。
The Problem Statement: Order Management
問題聲明:訂單管理
In this scenario, a user’s query can either be about placing a new order or canceling
an existing one:
在這種情況下,用戶的查詢可能是關於下訂單或取消現有訂單:
PlaceOrder: Check item availability, compute shipping, and simulate payment.
PlaceOrder :檢查項目可用性,計算運輸和模擬付款。
CancelOrder: Extract an order_id and mark the order as canceled.
取消訂單:提取 order_id 並將訂單標記為已取消。
Because we have to branch (decide “PlaceOrder” vs. “CancelOrder”), we’ll use
LangGraph to create a conditional flow:
因為我們必須分支(決定“ Placeorder”與“ Cancelorder”),所以我們將使用
Langgraph來創建條件流:
1. Categorize query.
分類查詢。
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 4/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
2. If PlaceOrder, move to check inventory, shipping, and payment.
如果Placeorder ,請移動以檢查庫存,運輸和付款。
3. If CancelOrder, parse out order_id and call a cancellation tool.
如果取消訂單,請解析 order_id 並調用取消工具。
Imports Explanation 進口解釋
Below is the exact first part of the code you provided, showcasing the imports and
environment setup. We have added commentary after the code to explain each
segment.
以下是您提供的代碼的確切第一部分,展示了導入和環境表。我們在代碼之後添加了
評論來解釋每個細分市場。
# Import required libraries
import os
import pandas as pd
import random
from langchain_core.tools import tool
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import ToolNode
from langgraph.graph import StateGraph, MessagesState, START, END
from langchain_core.runnables.graph import MermaidDrawMethod
from IPython.display import display, Image
from typing import Literal
from langchain_core.prompts import ChatPromptTemplate
from typing import Dict, TypedDict
# Load environment variables
os.environ["OPENAI_API_KEY"] = ""
langchain_core.tools, langchain_openai, ToolNode, etc.:
langchain_core.tools,langchain_openai,toolnode等
tool (a decorator) converts Python functions into “tools” an LLM can call.
tool (裝飾器)將Python功能轉換為“工具”LLM可以打電話。
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 5/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
ChatOpenAI is our LLM client to talk to GPT models.
ChatOpenAI 是我們的LLM客戶與GPT模型交談。
ToolNode is a pre-built node from langgraph.prebuilt that handles tool
execution.
ToolNode 是從 langgraph.prebuilt 處理工具執行的預製節點。
StateGraph , MessagesState , START , END come from langgraph.graph —they’re
crucial for defining our workflow.
StateGraph , MessagesState , START , END 來自 langgraph.graph 它們對於定義
我們的工作流程至關重要。
MermaidDrawMethod helps visualize the workflow as a Mermaid.js diagram.
MermaidDrawMethod 有助於將工作流程視為Mermaid.js圖。
Data Loading and State Definition
數據加載和狀態定義
Link for data: Data
數據鏈接:數據
In the next snippet, we load CSV files (for inventory and customers) and convert
them to dictionaries. We also define our State typed dictionary.
在下一個片段中,我們加載CSV文件(用於庫存和客戶),然後將其轉換為字典。我
們還定義了狀態鍵入字典。
# Load datasets
inventory_df = pd.read_csv("inventory.csv")
customers_df = pd.read_csv("customers.csv")
# Convert datasets to dictionaries
inventory = inventory_df.set_index("item_id").T.to_dict()
customers = customers_df.set_index("customer_id").T.to_dict()
class State(TypedDict):
query: str
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 6/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
category: str
next_node: str
item_id: str
order_status: str
cost: str
payment_status: str
location: str
quantity: int
CSV to Dictionaries:
CSV到字典:
inventory and customers are dictionaries keyed by item_id or customer_id . This
makes it easy to do lookups like inventory[item_51] .
inventory 和 customers 是由 item_id 或 customer_id 鍵入的字典。這使您可以輕鬆
地進行查找,例如 inventory[item_51] 。
State:
狀態:
A typed dictionary so we know which fields to expect. For instance, query ,
category , item_id , etc.
一個打字的詞典,因此我們知道要期待哪些字段。例如, query , category ,
item_id ,等。
category is typically “PlaceOrder” or “CancelOrder.”
category 通常是“ Placeorder”或“ Cancelorder”。
next_node can store the next node name, though we rely on the graph’s edges for
transitions.
next_node 可以存儲下一個節點名稱,儘管我們依靠圖表的邊緣進行過渡。
This helps keep track of everything — inventory checks, payment status, etc. —
in a single object.
這有助於跟踪一個對像中的所有內容 - 庫存檢查,付款狀態等。
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 7/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Creating Tools and LLM Integration
創建工具和LLM一體化
Now we define our LLM and tools. The main tool here is cancel_order , which uses
the LLM to extract an order_id from the query.
現在我們定義我們的LLM和工具。這裡的主要工具是 cancel_order ,它使用LLM從查
詢中提取 order_id 。
@tool
def cancel_order(query: str) -> dict:
"""Simulate order cancelling"""
order_id = llm.with_structured_output(method='json_mode').invoke(f'Extract
#amount = query.get("amount")
if not order_id:
return {"error": "Missing 'order_id'."}
return {"order_status": "Order stands cancelled"}
# Initialize LLM and bind tools
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
tools_2 = [cancel_order]
llm_with_tools_2 = llm.bind_tools(tools_2)
tool_node_2 = ToolNode(tools_2)
@tool :
@tool :
The cancel_order function is now a tool the LLM can invoke if it decides that an
order cancellation is needed.
現在, cancel_order 函數是一個工具LLM如果決定需要取消訂單,可以調用。
Extracting order_id :
提取 order_id :
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 8/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
We call llm.with_structured_output(method='json_mode') to instruct the LLM to
return JSON. Then we parse out the 'order_id' .
我們打電話 llm.with_structured_output(method='json_mode') 指示LLM返回
JSON。然後我們解析 'order_id' 。
LLM Initialization:
LLM初始化:
model="gpt-4o-mini" is the chosen model, with temperature=0 for deterministic
responses.
model="gpt-4o-mini" 是所選模型,對於確定性響應 temperature=0 。
Binding and ToolNode :
llm.bind_tools(tools_2) connects our LLM with the cancel_order tool.
llm.bind_tools(tools_2) 連接我們的LLM使用 cancel_order 工具。
ToolNode is a specialized node that can handle these bound tools automatically.
ToolNode 是一個可以自動處理這些界限工具的專用節點。
Defining Workflow Nodes 定義工作流節點
We’ll now start defining nodes one by one.
現在,我們將開始一個一個定義節點。
Model Call Nodes 調用模型節點
These nodes have access to call models
def call_model_2(state: MessagesState):
"""Use the LLM to decide the next step."""
messages = state["messages"]
response = llm_with_tools_2.invoke(str(messages))
return {"messages": [response]}
def call_tools_2(state: MessagesState) -> Literal["tools_2", END]:
"""Route workflow based on tool calls."""
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 9/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
messages = state["messages"]
last_message = messages[-1]
if last_message.tool_calls:
return "tools_2"
return END
call_model_2 : Takes the conversation ( messages ) and passes it to the LLM with
the bound tools. If the LLM triggers a tool call, we’ll detect that in call_tools_2 .
call_tools_2 : Checks if the LLM has requested a tool call ( tool_calls ). If so, we
route to "tools_2" , which is the ToolNode ; otherwise, we end the workflow.
Categorize Query
Here, we define a node for categorizing the query:
在這裡,我們定義了用於對查詢進行分類的節點:
def categorize_query(state: MessagesState) -> MessagesState:
"""Categorize user query into PlaceOrder or CancelOrder"""
prompt = ChatPromptTemplate.from_template(
"Categorize user query into PlaceOrder or CancelOrder"
"Respond with either 'PlaceOrder', 'CancelOrder' Query: {state}"
)
chain = prompt | ChatOpenAI(temperature=0)
category = chain.invoke({"state": state}).content
return {"query":state,"category": category}
This node uses the LLM to classify the user’s query. The return value sets
"category" in the state.
此節點使用LLM為了對用戶的查詢進行分類。返回值設置狀態中的 "category" 。
Check Inventory 檢查庫存
def check_inventory(state: MessagesState) -> MessagesState:
"""Check if the requested item is in stock."""
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 10/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
item_id = llm.with_structured_output(method='json_mode').invoke(f'Extract i
quantity = llm.with_structured_output(method='json_mode').invoke(f'Extract
if not item_id or not quantity:
return {"error": "Missing 'item_id' or 'quantity'."}
if inventory.get(item_id, {}).get("stock", 0) >= quantity:
print("IN STOCK")
return {"status": "In Stock"}
return {"query":state,"order_status": "Out of Stock"}
Tries to parse item_id and quantity from the conversation.
試圖解析 item_id 和對話中的 quantity 。
Checks inventory[item_id]["stock"] to confirm availability.
Compute Shipping 計算運輸
We have defined a node for calculating shipping cost for the specific customer
我們定義了一個節點,用於計算特定客戶的運輸成本
def compute_shipping(state: MessagesState) -> MessagesState:
"""Calculate shipping costs."""
item_id = llm.with_structured_output(method='json_mode').invoke(f'Extract i
quantity = llm.with_structured_output(method='json_mode').invoke(f'Extract
customer_id = llm.with_structured_output(method='json_mode').invoke(f'Extra
location = customers[customer_id]['location']
if not item_id or not quantity or not location:
return {"error": "Missing 'item_id', 'quantity', or 'location'."}
weight_per_item = inventory[item_id]["weight"]
total_weight = weight_per_item * quantity
rates = {"local": 5, "domestic": 10, "international": 20}
cost = total_weight * rates.get(location, 10)
print(cost,location)
return {"query":state,"cost": f"${cost:.2f}"}
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 11/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Retrieves the customer_id from the user’s query, then looks up their location in
the customers dictionary.
從用戶查詢中檢索Customer_ID ,然後查找其在 customers 詞典中的位置。
Calculates shipping cost based on the item’s weight, the quantity, and the user’s
location.
根據項目的重量,數量和用戶的位置來計算運輸成本。
Process Payment 流程付款
We’ll define a node for processing payment:
我們將定義一個用於處理付款的節點:
def process_payment(state: State) -> State:
"""Simulate payment processing."""
cost = llm.with_structured_output(method='json_mode').invoke(f'Extract cost
if not cost:
return {"error": "Missing 'amount'."}
print(f"PAYMENT PROCESSED: {cost} and order successfully placed!")
payment_outcome = random.choice(["Success", "Failed"])
return {"payment_status": payment_outcome}
Uses random.choice to simulate success or failure.
In a production system, you’d integrate with a real payment gateway.
Routing Function
We now define a node for routing queries:
def route_query_1(state: State) -> str:
"""Route the query based on its category."""
print(state)
if state["category"] == "PlaceOrder":
return "PlaceOrder"
elif state["category"] == "CancelOrder":
return "CancelOrder"
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 12/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Decides which path to follow next: “PlaceOrder” or “CancelOrder.” In
LangGraph, we’ll map “PlaceOrder” to the CheckInventory node and
“CancelOrder” to the CancelOrder node.
Building the Workflow Graph
構建工作流程圖
Below, we create a StateGraph , add nodes, and define edges and conditional edges.
# Create the workflow
workflow = StateGraph(MessagesState)
#Add nodes
workflow.add_node("RouteQuery", categorize_query)
workflow.add_node("CheckInventory", check_inventory)
workflow.add_node("ComputeShipping", compute_shipping)
workflow.add_node("ProcessPayment", process_payment)
workflow.add_conditional_edges(
"RouteQuery",
route_query_1,
{
"PlaceOrder": "CheckInventory",
"CancelOrder": "CancelOrder"
}
)
workflow.add_node("CancelOrder", call_model_2)
workflow.add_node("tools_2", tool_node_2)
# Define edges
workflow.add_edge(START, "RouteQuery")
workflow.add_edge("CheckInventory", "ComputeShipping")
workflow.add_edge("ComputeShipping", "ProcessPayment")
workflow.add_conditional_edges("CancelOrder", call_tools_2)
workflow.add_edge("tools_2", "CancelOrder")
workflow.add_edge("ProcessPayment", END)
StateGraph(MessagesState) :
We specify MessagesState to hold conversation data.
Nodes:
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 13/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
RouteQuery is the entry node that categorizes the user’s intent.
RouteQuery 是對用戶意圖進行分類的條目節點。
“CheckInventory,” “ComputeShipping,” and “ProcessPayment” handle the
PlaceOrder flow.
“ CheckInventory”,“ ComputeShipping”和“ ProcessPayment”處理Plothorder
Flow。
“CancelOrder” and “tools_2” handle the CancelOrder flow.
“ cancelorder”和“ tools_2”處理取消順序。
Conditional Edges:
The call to workflow.add_conditional_edges("RouteQuery", route_query_1, ...)
ensures we move to CheckInventory if it’s a “PlaceOrder” or CancelOrder if it’s a
“CancelOrder.”
打電話 workflow.add_conditional_edges("RouteQuery", route_query_1, ...) 確保我
們轉到“ ploterdord”或“取消訂單”是否是“取消訂單”。
Looping:
When the user hits “CancelOrder,” we check if the LLM triggered a tool call
( call_tools_2 ). If it did, we go to tools_2 (the ToolNode ); after the tool is
invoked, it goes back to “CancelOrder,” giving the LLM an opportunity to
produce further actions or end.
Finish:
“ProcessPayment” leads to END , concluding the “PlaceOrder” path.
Visualizing and Testing the Workflow
可視化和測試工作流程
The next snippet compiles the workflow into an agent, renders it as a Mermaid
diagram, and tests it with sample queries.
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 14/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
# Compile the workflow
agent = workflow.compile()
# Visualize the workflow
mermaid_graph = agent.get_graph()
mermaid_png = mermaid_graph.draw_mermaid_png(draw_method=MermaidDrawMethod.API)
display(Image(mermaid_png))
# Query the workflow
user_query = "I wish to cancel order_id 223"
for chunk in agent.stream(
{"messages": [("user", user_query)]},
stream_mode="values",
):
chunk["messages"][-1].pretty_print()
auser_query = "customer_id: customer_14 : I wish to place order for item_51 wit
for chunk in agent.stream(
{"messages": [("user", auser_query)]},
stream_mode="values",
):
chunk["messages"][-1].pretty_print()
Compile:
agent = workflow.compile() transforms our node/edge definitions into an
executable agent.
Visualize:
We get a Mermaid diagram ( mermaid_png ) which we can display in a Jupyter
notebook for debugging or demonstrations.
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 15/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Test Queries:
First test: “I wish to cancel order_id 223” should route to CancelOrder .
Output of first test
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 16/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Second test: “customer_id: customer_14 : I wish to place order for item_51…”
should route to the place-order workflow.
Output of second test
Conclusion: 結論:
By leveraging LangGraph, we’ve built a dynamic, branching workflow that either
places or cancels orders based on user intent. We demonstrated:
How to categorize queries with an LLM node ( categorize_query ).
How to bind a tool ( cancel_order ) and integrate it into the workflow.
How to check inventory, compute shipping, and process payment via separate
nodes.
How to visualize the entire workflow with Mermaid.js.
This approach is scalable: you can add more steps (e.g., address verification,
promotional codes) or additional branches (e.g., update an existing order) without
rewriting a monolithic script. If you need loops for retrying failed payments or
verifying user confirmations, LangGraph can handle that as well.
AI Artificial Intelligence Data Science Ai Agent Langgraph
Follow
Published in AI Advances 在人工智能進展中發表
20K Followers · Last published just now
Democratizing access to artificial intelligence
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 17/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Follow
Written by Kshitij Kutumbe
由kshitij撰寫
235 Followers · 12 Following
Data Scientist | NLP | GenAI | RAG | AI agents | Knowledge Graph | Neo4j [email protected]
www.linkedin.com/in/kshitijkutumbe/
Responses (6) 回答(6)
What are your thoughts?
Respond
Remsy Schmilinsky he/him
Jan 23 (edited)
Thank you so much for sharing this. I implemented your tutorial and committed it to GitHub. Here's the link:
https://github.com/schmitech/ai-driven-order-management
11 3 replies Reply
SimonBG
Jan 25
Nice implementation but why would you use AI to do this? Would you not just use AI to understand the
customer need (cancel order) and then just front end a conventional inventory management system? I don't
see the advantage of LLMs in conventional… more
4 1 reply Reply
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 18/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
subhajit saha
5 days ago
Why can't we use Google Dialogflow or a similar tool to build this? This makes a simple use case more
complex.
1 reply Reply
See all responses
More from Kshitij Kutumbe and AI Advances
來自Kshiitiz和AI的更多信息
In 和 Globant by 經過 Kshitij Kutumbe Kshitij是
LangGraph AI Agents with Neo4j Knowledge Graph
langgraph ai代理Neo4J知識圖
A RAG System Built for Both Semantic Search and Structured Data Queries
用於語義搜索和結構化數據查詢的抹布系統
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 19/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Jan 14 277 5
In 和 AI Advances 人工智能進步 by 經過 Nikhil Anand 尼基爾·阿南德(Nikhil Anand)
My GPT-evaluator got 1000% better with this simple trick.
我的gpt-evaluator通過這個簡單的技巧獲得了1000%的效果。
I wish I had known this trick sooner.
我希望我早點就知道這個技巧。
Jan 9 877 16
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 20/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
In 和 AI Advances 人工智能進步 by 經過 Mahmudur R Manna Mahmurdur R Semolina
Enterprise AI Strategy: AI Agents vs AI Models
企業AI策略:AI代理與AI代理與AI模型
A blueprint for integrating workflow automation with predictive Intelligence
將工作流程自動化與預測智慧整合的藍圖
Jan 11 814 20
Kshitij Kutumbe Kshitij是
Comprehensive Guide to Chunking in LLM and RAG Systems
綜合指南LLM和抹布系統
With the increasing use of Large Language Models (LLMs) like GPT-3, GPT-4, and Retrieval-
Augmented Generation (RAG) systems, one major…
隨著大型語言模型的越來越多(LLMs )例如GPT-3,GPT-4和檢索型發電(RAG)系統,一個
主要…
Sep 5, 2024 13 1
See all from Kshitij Kutumbe
See all from AI Advances
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 21/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Recommended from Medium 推薦用於媒介
In 和 Vedcraft by 經過 Ankur Kumar
Building Intelligent Apps with Agentic AI: Top Frameworks to Watch for in
2025
使用Agesic AI:在2025年觀看的頂級框架,構建智能應用程序
Jan 24 307 17
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 22/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
Mohit Vaswani
6 AI Agents That Are So Good, They Feel Illegal
6個AI特工,他們感到非法
AI agents are the future because they can replace all the manual work with automation with
100% accuracy and fast speed.
人工智慧代理是未來,因為它們可以以 100% 的準確性和快速的自動化取代所有的手動工作。
Jan 12 2.7K 98
Lists 盧斯
Predictive Modeling w/ Python
帶Python的預測建模
20 stories · 1818 saves
ChatGPT prompts chatgpt提示
51 stories · 2549 saves
Generative AI Recommended Reading
生成式人工智慧推薦閱讀
52 stories · 1643 saves
Natural Language Processing
自然語言處理
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 23/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
1926 stories · 1581 saves
In 和 ILLUMINATION 照明 by 經過 Mr Tony Momoh 托尼·莫霍先生
Why Building Your AI Agent Could Be Your Most Valuable Investment in
2025
為什麼建立您的AI代理可能是您2025年最有價值的投資
“A friend from Hong Kong told me about this last year.”
“一位來自香港的朋友告訴我去年的有關。”
Dec 31, 2024 901 37
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 24/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
In 和 Bootcamp 訓練營 by 經過 Xinran Ma 新蘭有時
How to turn an idea into a prototype with AI
如何將一個想法變成AI的原型
A step-by-step walkthrough with tips and insights
逐步演練,帶有技巧和見解
Jan 23 737 15
Austin Starks 奧斯汀·斯塔克斯
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 25/26
2025/2/9 晚上9:37 Langgraph AI代理:建立動態訂單管理系統:分步教程| kshitij kutumbe | 2025年1月|人工智能進步 --- LangGraph AI agents : B…
You are an absolute moron for believing in the hype of “AI Agents”.
你絕對是個白痴,竟然相信「人工智慧特工」的炒作。
All of my articles are 100% free to read. Non-members can read for free by clicking my friend
link!
我的所有文章都是 100% 免費閱讀。非會員可以點擊我的好友連結免費閱讀!
Jan 11 6.3K 269
In 和 Towards AI 向 by 經過 Gao Dalie (高達烈) Gao Dalie(高達烈)
Langchain (Upgraded) + DeepSeek-R1 + RAG Just Revolutionized AI
Forever
Langchain(升級) + DeepSeek-R1 + Rag剛剛徹底改變了AI
Last week, I made a video about DeepSeek-V3, and it caused a huge stir in the global AI
community.
上週,我製作了有關DeepSeek-V3的視頻,這在全球AI社區引起了巨大轟動。
Jan 29 982 7
See more recommendations
https://ai.gopubby.com/langgraph-building-a-dynamic-order-management-system-a-step-by-step-tutorial-0be56854fc91 26/26