簡單記憶系統
讓 Jev 判斷哪些請求和答案值得記住,再用一個小函式把 Jev 呼叫包起來,往後續呼叫里加入記憶。
每一次 Jev 請求,只能看到你發給它的那份 state。客戶上個月告訴過你應用的什麼資訊 —— 比如用的是哪個版本、哪個套餐 —— 除非你的程式碼把它放進去,否則不會出現在下一次請求裡。這裡的記憶系統用一次額外的 Jev 請求加一個 Python dict 來做這件事。
我們的例子給支援工單做路由。8 月,一個客戶說他們自託管在 Windows Server 上。9 月,他們寫道“儀表盤從今早開始一直很慢”。沒有記憶時,Jev 會把這張工單發給雲團隊,而不是自託管團隊。在下面的例子裡,加上記憶後,後面六張工單全部被送到預期的團隊。單獨給每張工單做路由,只能對兩張。
這個簡單記憶系統有兩部分:
- 每次呼叫之後,Jev 會同時看到原始請求和它的答案。一個
Noul問題 —— 我們叫它門控 —— 問的是:這個請求是否陳述了一條關於該客戶、值得記住的重要事實。如果 P(yes) 至少為 0.5,就把這張工單和 Jev 的答案存為該客戶的一條記憶。 - 一個包裝函式
ask_with_memory(),接收與ask()相同的state和questions參數(它本身就是固定了模型、並快取了呼叫的 TypeSafe Python SDKclient.system_one方法),返回 Jev 的響應。每次呼叫之前,它會把該客戶已儲存的工單以及 Jev 對它們的答案加入 state。
這個包裝函式就是一個基礎的 agent harness。harness 指的是包在模型外面、給它加上額外能力(比如工具呼叫、迴圈執行)的那層程式碼。這個基礎的小玩具只給了它記憶,存在一個普通的 Python dict 裡,每個客戶 ID 一個列表。
%%{init: {"fontFamily": "Inter, sans-serif", "flowchart": {"rankSpacing": 25, "wrappingWidth": 300, "subGraphTitleMargin": {"top": 8, "bottom": 20}}}}%%
flowchart TB
IN["ask_with_memory(state, questions)"]
subgraph R["Jev: answer the question"]
Q1["<b>Choice:</b> which support team?"]
end
subgraph G["Jev: judge the routed ticket"]
Q2["<b>Noul:</b> does the request state<br/>an important fact about the customer?"]
end
DEC{"P(yes) ≥ 0.5?<br/>your code"}
SAVE["save the memory<br/>under this customer's ID"]
OUT["handle the support ticket response in your code"]
MEM[("MEMORIES<br/>saved memories per customer")]
IN -- "state with memories<br/>+ routing question" --> R
R -- "original request + answer<br/>+ memory question" --> G
G -- "P(yes)" --> DEC
DEC -- "yes: save" --> SAVE
DEC -- "no: don't save" --> OUT
SAVE --> OUT
SAVE --> MEM
IN -. "added to the state<br/>on this customer's<br/>next support tickets" .- MEM
這個包裝函式會先後發起兩次 Jev 請求:先是路由請求,然後是門控 —— 門控把工單和 Jev 的答案放在一起判斷。無論有沒有東西被儲存,包裝函式返回的都是路由響應。
因為 ask_with_memory() 接收與 ask() 相同的參數、返回相同的響應,你可以在不改動其它程式碼的情況下把兩者互換。包裝函式自己負責找出客戶的記憶、把它們加入 state,並儲存新的記憶。
這個例子把兩個客戶的五張早期工單送進包裝函式,然後對每個客戶的三條後續訊息各做兩次路由:一次帶上存下來的記憶,一次不帶。最後用一張表把全部六條訊息的兩種答案並排列出。
Setup
pip install ipython 'cooksafe>=0.2.0,<0.3.0'
設定 TYPESAFE_API_KEY。每次 API 呼叫都快取在 json_cache.json 裡。把它下載到你執行這段程式碼的資料夾,就能復現這裡給出的數字,而不用真的呼叫 API;不下載它則會全部即時執行。
下面的數字來自 2026-09-28 的 jev-1.13.0。0.5 這個記憶閾值只是一個起點,你應該拿自己的例子來評估它。
import json
import os
from pathlib import Path
from cooksafe import JsonCache, make_playground_link
from IPython.display import Markdown, display
from typesafe_sdk import Choice, Noul, NoulCriteria, SystemOneResponse, TypeSafeClient
TYPESAFE_MODEL = "jev-1.13.0"
REMEMBER_AT = 0.5 # save when P(lasting customer fact) reaches this starting threshold
MEMORY_KEY = "earlier_tickets_from_this_customer" # where saved tickets go in the state
client = TypeSafeClient(
api_key=os.environ.get("TYPESAFE_API_KEY", "cache-only"), # keyless kernels replay the cache
base_url=os.environ.get("TYPESAFE_ENDPOINT"),
timeout=120.0,
)
json_cache = JsonCache(Path("json_cache.json"))
Define the tickets
兩個客戶、五張早期工單和三條後續訊息,都是為這個 cookbook 寫的。C-1042(Harbor Logistics)在 Enterprise 合同下把自託管版本跑在 Windows Server 上。C-2210(Fernwood Studio)用的是雲版本的自助 Team 套餐。五張早期工單裡有三張陳述了一條長期事實:一個版本、一個套餐、一份合同。另外兩張沒有:在機場用手機發的、一個公共假日。後面的訊息沒有一條提到客戶的配置,所以沒有記憶的話,Jev 只能猜。
每張工單都會變成一個包含兩部分的 state:customer(客戶是誰)和 ticket(工單會話)。ticket_state() 函式會構造一張簡化過的工單,就像工單系統發出來的那樣。在你的應用裡,state 就是工單系統發來的每張工單,ask_with_memory() 會把該客戶已儲存的工單加進去。分成早期工單和後續訊息只是為了這個例子。
DATA = {
"customers": {
"C-1042": {"id": "C-1042", "company": "Harbor Logistics"},
"C-2210": {"id": "C-2210", "company": "Fernwood Studio"},
},
"earlier_tickets": [
{"id": "T-101", "customer_id": "C-1042", "received_on": "2026-08-04",
"subject": "Adding an admin",
"text": "Hi, we run your self-hosted edition on Windows Server 2022 in our own data "
"centre. How do I add a new admin user?"},
{"id": "T-102", "customer_id": "C-2210", "received_on": "2026-08-11",
"subject": "Exporting to PDF",
"text": "We're a small design studio on your cloud edition, paying monthly on the "
"self-serve Team plan. How do I export a dashboard as a PDF?"},
{"id": "T-103", "customer_id": "C-1042", "received_on": "2026-08-19",
"subject": "Invoice download",
"text": "Sorry for the typos, typing this on my phone at the airport. Where can I "
"download last month's invoice?"},
{"id": "T-104", "customer_id": "C-2210", "received_on": "2026-09-02",
"subject": "Dark mode?",
"text": "Our whole team is out on Friday for a public holiday, so no rush on this "
"one. Is there a dark mode?"},
{"id": "T-105", "customer_id": "C-1042", "received_on": "2026-09-10",
"subject": "Sandbox environment",
"text": "For context, we signed an Enterprise contract with you in March. Can we get "
"a sandbox environment for testing?"},
],
"later_messages": [
{"subject": "Slow dashboards",
"text": "Dashboards have been really slow since this morning."},
{"subject": "Upgrade failing",
"text": "The upgrade to version 5.2 keeps failing halfway through."},
{"subject": "More seats",
"text": "We'd like to add 20 more seats before next quarter."},
],
"later_received_on": "2026-09-28",
# Labelled by hand from what each customer said in the earlier tickets.
"expected_team": {
"C-1042": {"Slow dashboards": "selfhosted_windows",
"Upgrade failing": "selfhosted_windows", "More seats": "enterprise_desk"},
"C-2210": {"Slow dashboards": "cloud_ops", "Upgrade failing": "cloud_ops",
"More seats": "billing"},
},
}
CUSTOMERS = DATA["customers"]
def ticket_state(customer_id: str, ticket_id: str, received_on: str, subject: str,
text: str) -> dict:
"""The state Jev sees for one ticket: a simplified ticket, like one from a helpdesk."""
return {
"customer": CUSTOMERS[customer_id],
"ticket": {
"id": ticket_id,
"received_on": received_on,
"subject": subject,
"messages": [{"from": "customer", "text": text}],
},
}
EARLIER = [
ticket_state(t["customer_id"], t["id"], t["received_on"], t["subject"], t["text"])
for t in DATA["earlier_tickets"]
]
print(f"{len(CUSTOMERS)} customers, {len(EARLIER)} earlier tickets, "
f"{len(DATA['later_messages'])} later messages. The first ticket as Jev sees it:\n")
print(json.dumps(EARLIER[0], indent=2))
2 customers, 5 earlier tickets, 3 later messages. The first ticket as Jev sees it:
{
"customer": {
"id": "C-1042",
"company": "Harbor Logistics"
},
"ticket": {
"id": "T-101",
"received_on": "2026-08-04",
"subject": "Adding an admin",
"messages": [
{
"from": "customer",
"text": "Hi, we run your self-hosted edition on Windows Server 2022 in our own data centre. How do I add a new admin user?"
}
]
}
}
Route a ticket
一個 Choice 問題負責挑出支援團隊。none_suitable 這個選項給 Jev 留了一個“沒有團隊合適”的答案,上下文太少的工單就可能落到那裡。
輔助函式 ask() 就是固定了模型版本、並快取了每次呼叫的 client.system_one。它接收一個 state 和一份問題 dict,返回 SDK 自己的響應物件,所以已經在讀 client.system_one 響應的程式碼可以直接配合它,不用改。
ROUTE = {
"team": Choice(
instructions="Which support team should handle `ticket`?",
criteria={
"cloud_ops": "Cloud team: problems with the hosted cloud edition, run by us",
"selfhosted_linux": "Self-hosted team, Linux: installs, upgrades and "
"performance of the self-hosted edition on Linux servers",
"selfhosted_windows": "Self-hosted team, Windows: installs, upgrades and "
"performance of the self-hosted edition on Windows Server",
"billing": "Billing: invoices, payments, seats and plan changes for "
"self-serve plans",
"enterprise_desk": "Enterprise desk: seats, contracts and account changes for "
"customers on an Enterprise contract (their technical problems go to the "
"technical teams)",
"general": "General product questions: features, how-to, settings",
"none_suitable": "None of these teams fits the ticket",
},
),
}
@json_cache
def _system_one(model: str, state: str, questions: str) -> dict:
response = client.system_one(
state=json.loads(state), questions=json.loads(questions), model=model
)
return response.model_dump(mode="json")
def ask(state: dict, questions: dict) -> SystemOneResponse:
"""client.system_one, with the model pinned and the call cached."""
as_json = {qid: q.model_dump(mode="json", exclude_none=True) for qid, q in questions.items()}
raw = _system_one(TYPESAFE_MODEL, json.dumps(state), json.dumps(as_json))
return SystemOneResponse.model_validate(raw)
def later_state(customer_id: str, message_index: int) -> dict:
"""One of the later messages, sent by this customer, with a fixed ticket ID."""
n = 201 + 3 * list(CUSTOMERS).index(customer_id) + message_index
message = DATA["later_messages"][message_index]
return ticket_state(customer_id, f"T-{n}", DATA["later_received_on"], message["subject"],
message["text"])
slow = later_state("C-1042", 0)
team = ask(slow, ROUTE).answers["team"]
print(f"C-1042: {slow['ticket']['messages'][0]['text']!r}")
print(f" plain Jev -> {team.choice} {team.probabilities[team.choice]:.2f}")
C-1042: 'Dashboards have been really slow since this morning.'
plain Jev -> cloud_ops 0.80
光靠 Jev 會把 C-1042 的慢儀表盤發給雲團隊。僅有這一張工單,它沒有理由做出別的判斷。
Ask Jev whether the ticket is worth remembering
首先,as_memory() 把原始 state 和 Jev 的答案配成一對:這就是包裝函式可能會儲存的記憶。request 鍵儲存的是記憶注入之前的 state,jev_answered 把每個問題對映到它的答案。這樣就能避免舊記憶被巢狀進每一條新記憶裡。
第二次 Jev 呼叫會讀這一對。門控問的是:這個請求是否陳述了一條關於該客戶的重要事實,比如他們的版本、作業系統、套餐或合同。Jev 的答案作為上下文也在那裡,但只出現在答案裡的事實不算數。沒有這條規則的話,像“一般產品問題”這種籠統的答案會壓過請求裡真正的事實,而一個依賴了更早記憶的答案也會被當成新的再次儲存。
GATE = {
"remember": Noul(
instructions=(
"In `request.ticket`, does the thread state a lasting fact about the customer that "
"should change how their future, unrelated tickets are handled? Count what the "
"customer or our support staff wrote in `request.ticket`. `jev_answered` shows how "
"the ticket was routed, which may rely on things learned earlier: do not count "
"anything it says or implies."
),
criteria=NoulCriteria(
true=(
"Yes: in `request.ticket` the customer or our support staff state something "
"about the customer that stays true after this ticket, such as the product "
"edition or operating system they run, their plan or contract, or a standing "
"preference."
),
false=(
"No: `request.ticket` only contains things specific to this one ticket or "
"moment, such as a one-off request, today's schedule, or the device they "
"happen to be typing on; or the lasting fact appears only in `jev_answered`."
),
),
),
}
def answer_text(question, answer):
"""The readable part of an answer: the chosen option's description, or the number."""
if answer.type == "choice":
return question.criteria[answer.choice]
return answer.noul if answer.type == "noul" else answer.score
def as_memory(state: dict, questions: dict, response: SystemOneResponse) -> dict:
return {
"request": state,
"jev_answered": {
q.instructions: answer_text(q, response.answers[qid])
for qid, q in questions.items()
},
}
def remember_probability(memory: dict) -> float:
"""P(the request states an important fact about the customer), with the answer as context."""
return ask(memory, GATE).answers["remember"].noul
Wrap the call so it remembers
包裝函式 ask_with_memory() 的參數和回傳值都和 ask() 一樣。記憶儲存就是一個普通的 dict,每個客戶 ID 一個列表。包裝函式用 state 裡的 ID 來選取該客戶的記憶。
MEMORIES: dict[str, list[dict]] = {} # customer ID -> that customer's saved memories
def customer_id(state: dict) -> str:
return state["customer"]["id"]
def ask_with_memory(state: dict, questions: dict) -> SystemOneResponse:
"""ask(), plus memory: same arguments, same return value."""
# 1. Answer the call with this customer's existing memories.
saved = MEMORIES.get(customer_id(state), [])
response = ask({**state, MEMORY_KEY: saved} if saved else state, questions)
# 2. Ask Jev whether the original request states an important fact worth keeping.
memory = as_memory(state, questions, response)
if remember_probability(memory) >= REMEMBER_AT:
MEMORIES.setdefault(customer_id(state), []).append(memory)
return response
這樣加入記憶,會給你的應用帶來四個後果:
- 每次呼叫都會發出兩次順序請求 —— 你的呼叫,然後是記憶門控。門控把工單和 Jev 的答案放在一起判斷,所以它要跑在路由請求之後。如果你的門控不看答案,那它也可以改成路由請求裡的第二個問題(見扇出)。
- 記憶只增不減。 每一條儲存下來的記憶都會進入該客戶之後的每一次呼叫。這裡沒有大小限制、沒有相關性檢查、也沒有過期時間。“下一步”一節給每一項都留了思路。
- 你的問題從不提及記憶。 記憶以
earlier_tickets_from_this_customer為鍵放進 state,Jev 會讀整個 state。ROUTE裡什麼都不用改。 - state 裡需要
customer.id。 光靠 Jev 也接受用字串作為 state,但這個包裝函式需要 ID 才能找到該客戶的列表。
Send the earlier tickets and watch the answers change
把這五張早期工單按到達順序送進 ask_with_memory()。同一個客戶會再發兩條後續訊息:慢儀表盤和加 20 個席位。這能看出每一條儲存下來的記憶如何改變 Jev 的答案。這些重複的訊息也走包裝函式,所以門控同樣會判斷它們。
PROBES = {"Slow dashboards": 0, "More seats": 2} # later messages to send after each ticket
def memory_ids(cid: str) -> str:
return ", ".join(m["request"]["ticket"]["id"] for m in MEMORIES.get(cid, [])) or "none"
def send_probes(cid: str) -> None:
for subject, i in PROBES.items():
team = ask_with_memory(later_state(cid, i), ROUTE).answers["team"]
print(f" {subject:<16} -> {team.choice:<19} {team.probabilities[team.choice]:.2f}")
for cid in CUSTOMERS:
print(f"{cid}, memories: {memory_ids(cid)}")
send_probes(cid)
for state in EARLIER:
cid = customer_id(state)
response = ask_with_memory(state, ROUTE)
p = remember_probability(as_memory(state, ROUTE, response)) # cached: the wrapper's call
verdict = "saved" if p >= REMEMBER_AT else "not saved"
text = state["ticket"]["messages"][0]["text"]
print(f"\n{cid} {state['ticket']['id']} {response.answers['team'].choice:<19} "
f"P(remember) {p:.2f} {verdict}")
print(f" {text[:84]}")
print(f"{cid}, memories: {memory_ids(cid)}")
send_probes(cid)
C-1042, memories: none
Slow dashboards -> cloud_ops 0.80
More seats -> enterprise_desk 0.62
C-2210, memories: none
Slow dashboards -> cloud_ops 0.75
More seats -> enterprise_desk 0.52
C-1042 T-101 selfhosted_windows P(remember) 0.91 saved
Hi, we run your self-hosted edition on Windows Server 2022 in our own data centre. H
C-1042, memories: T-101
Slow dashboards -> selfhosted_windows 0.99
More seats -> enterprise_desk 0.44
C-2210 T-102 general P(remember) 0.91 saved
We're a small design studio on your cloud edition, paying monthly on the self-serve
C-2210, memories: T-102
Slow dashboards -> cloud_ops 0.91
More seats -> billing 0.98
C-1042 T-103 billing P(remember) 0.07 not saved
Sorry for the typos, typing this on my phone at the airport. Where can I download la
C-1042, memories: T-101
Slow dashboards -> selfhosted_windows 0.99
More seats -> enterprise_desk 0.44
C-2210 T-104 general P(remember) 0.10 not saved
Our whole team is out on Friday for a public holiday, so no rush on this one. Is the
C-2210, memories: T-102
Slow dashboards -> cloud_ops 0.91
More seats -> billing 0.98
C-1042 T-105 enterprise_desk P(remember) 0.92 saved
For context, we signed an Enterprise contract with you in March. Can we get a sandbo
C-1042, memories: T-101, T-105
Slow dashboards -> selfhosted_windows 0.94
More seats -> enterprise_desk 0.99
那三張陳述了版本、套餐或合同的工單以 0.91 到 0.92 被儲存。T-102 雖然被 Jev 路由到了通用團隊,還是被儲存了 —— 因為門控數的是客戶的話,不是答案。機場和公共假日那兩張工單得分 0.07 和 0.10,沒有被儲存,所以它們之後的答案沒有變化。
每一條儲存下來的記憶,都會改變與它相關的答案。對 C-1042 來說,Windows 那張工單把慢儀表盤從雲團隊(0.80)挪到了 Windows 團隊(0.99)。Enterprise 合同隨後把席位定在 0.99。對 C-2210 來說,Team 套餐那張工單把雲團隊從 0.75 提到 0.91,並把席位從 Enterprise 桌臺(0.52)挪到 billing(0.98)。加入 Enterprise 記憶後,C-1042 的慢儀表盤略微下降,從 0.99 到 0.94 —— 這也正是要挑選用哪些記憶的一個原因(見“下一步”)。門控沒有儲存任何一條重複訊息。
Route the same messages for both customers
現在每個客戶都發送這三條後續訊息。每條訊息都分別進了不帶記憶的 ask() 和 ask_with_memory(),用的是同一個 state 和同一個問題。
EXPECTED = DATA["expected_team"]
plain_correct = memory_correct = total = 0
example_state = None
def cell(answer, expected: str) -> str:
mark = "✓" if answer.choice == expected else "✗"
return f"{mark} {answer.choice} {answer.probabilities[answer.choice]:.2f}"
print(f"{'customer':<9}{'message':<17}{'expected':<20}{'plain Jev':<27}{'with memory':<27}")
for cid in CUSTOMERS:
for i, message in enumerate(DATA["later_messages"]):
state = later_state(cid, i)
expected = EXPECTED[cid][message["subject"]]
plain = ask(state, ROUTE).answers["team"]
if example_state is None:
# Keep the exact state used for this call for the playground link.
saved = MEMORIES.get(cid, [])
example_state = json.loads(json.dumps({**state, MEMORY_KEY: saved} if saved else state))
response = ask_with_memory(state, ROUTE)
remembered = response.answers["team"]
plain_correct += plain.choice == expected
memory_correct += remembered.choice == expected
total += 1
print(f"{cid:<9}{message['subject']:<17}{expected:<20}{cell(plain, expected):<27}"
f"{cell(remembered, expected):<27}")
print(f"\nExpected routes: {plain_correct}/{total} without memory, "
f"{memory_correct}/{total} with memory.")
customer message expected plain Jev with memory
C-1042 Slow dashboards selfhosted_windows ✗ cloud_ops 0.80 ✓ selfhosted_windows 0.94
C-1042 Upgrade failing selfhosted_windows ✗ none_suitable 0.60 ✓ selfhosted_windows 1.00
C-1042 More seats enterprise_desk ✓ enterprise_desk 0.62 ✓ enterprise_desk 0.99
C-2210 Slow dashboards cloud_ops ✓ cloud_ops 0.75 ✓ cloud_ops 0.91
C-2210 Upgrade failing cloud_ops ✗ none_suitable 0.63 ✓ cloud_ops 0.86
C-2210 More seats billing ✗ enterprise_desk 0.52 ✓ billing 0.98
Expected routes: 2/6 without memory, 6/6 with memory.
有了記憶,六條訊息全部到達預期的團隊,而沒有記憶時只有兩條。同一條訊息現在對不同客戶去了不同的團隊:慢儀表盤對 C-1042 去了 Windows 團隊,對 C-2210 留在雲團隊;加 20 個席位對 C-1042 去了 Enterprise 桌臺,對 C-2210 去了 billing。在光靠 Jev 本來就答對的地方,記憶把機率提高了,比如 C-1042 的席位從 0.62 升到 0.99。包裝函式也判斷了這六條後續訊息,一條都沒儲存:它們沒有陳述任何重要事實。
每一行的預期團隊,都來自客戶在早期工單裡透露的配置:C-1042 是自託管版本加 Enterprise 合同,C-2210 是雲版本 Team 套餐。
Open it in the playground
這個連結儲存了 C-1042 第一次慢儀表盤呼叫所用的那份路由 state,包括它那個時點的記憶,外加路由問題。
playground_link = make_playground_link(example_state, ROUTE, models=[TYPESAFE_MODEL])
display(Markdown(
f"🔗 [Open C-1042's ticket with its memories in the TypeSafe playground]({playground_link})"
))
在 TypeSafe playground 裡開啟帶記憶的 C-1042 工單 →
Next steps
- 選擇你的應用該記住什麼。 改寫
GATE來描述你自己的任務裡什麼值得記住,並拿你標註過的例子來測REMEMBER_AT。 - 選擇加入哪些記憶。 包裝函式會把每一條儲存下來的記憶都加進去。當列表變長之後,可以用一個相關性判斷來挑出更小的一組。
- 替換過時的記憶。 判斷一條新記憶是否取代舊的一條,合適的時候在程式碼裡刪掉舊的條目。
- 讓記憶跨執行保留。 把
MEMORIES換成一個以客戶 ID 為鍵的資料庫。程序退出時,記憶體裡的 dict 就沒了。 - 對路由結果採取行動。 在程式碼裡把每個團隊對映到一個處理器,比如為 Enterprise 客戶約一通電話,或者發一篇針對其配置的文章。見意圖路由和基於置信度的路由。把你的回覆作為一條支援訊息加入工單會話,門控就能記住你做了什麼。
Appendix
Can a saved answer reinforce a mistake?
會。門控忽略只出現在 Jev 答案裡的內容,所以一個答案本身沒法讓工單被儲存。不過一旦工單被儲存,它的答案也會一起被儲存 —— 連同錯誤的推斷一起 —— 而該客戶之後的每次呼叫都會讀到它。之後的一個答案就可能重複這個錯誤。
How should I choose the threshold?
這個包裝函數里的 0.5 是一個起始值。要挑你自己的值,可以把你流量裡的“請求-答案”對標註成值得記住或不必記住,然後找出最能分開這兩組的那個機率。再拿你沒有用來挑選的那些對來驗證它。如果一條誤導性的記憶比漏掉一條代價更大,就把它調高;反過來就調低。如何選閾值、以及如何把閾值跟每類動作的風險對應起來,見置信度和置信度門控路由。