From 460b391b03ca7f0f1982d5c432665939047f12fe Mon Sep 17 00:00:00 2001 From: Priyanka Punukollu Date: Sun, 1 Mar 2026 15:07:34 -0600 Subject: [PATCH] fix: add show me my transactions to transaction routing keywords Made-with: Cursor --- agent/graph.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/agent/graph.py b/agent/graph.py index 587e068f1..8004b4565 100644 --- a/agent/graph.py +++ b/agent/graph.py @@ -1080,14 +1080,20 @@ async def classify_node(state: AgentState) -> AgentState: "give me a full portfolio", "full portfolio summary", "full portfolio", "can i afford a house", "afford a house", "afford a home", ] + natural_transactions_kws = [ + "show me my transactions", "show my transactions", + "my transactions", "transaction history", "show transactions", + ] natural_activity_kws = [ "what have i bought", "what have i sold", - "show me my trades", "show me my transactions", + "show me my trades", "what did i buy", "what did i sell", "my purchase history", "my trading history", ] if any(kw in query for kw in natural_performance_kws): return {**state, "query_type": "performance"} + if any(kw in query for kw in natural_transactions_kws): + return {**state, "query_type": "transactions"} if any(kw in query for kw in natural_activity_kws): return {**state, "query_type": "activity"} @@ -1871,6 +1877,11 @@ async def tools_node(state: AgentState) -> AgentState: result = await transaction_query(symbol=symbol, token=tok) tool_results.append(result) + elif query_type == "transactions": + symbol = _extract_ticker(user_query) + result = await transaction_query(symbol=symbol, token=tok) + tool_results.append(result) + elif query_type == "categorize": tx_result = await transaction_query(token=tok) tool_results.append(tx_result)