iamsims commited on
Commit
045fba0
·
1 Parent(s): 5ec41fc

added mcp server

Browse files
Files changed (3) hide show
  1. mcp_server.py +199 -0
  2. notebooks/1_test_pdf_reader.ipynb +49 -189
  3. requirements.txt +156 -11
mcp_server.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastmcp import FastMCP
2
+ from langchain_qdrant import QdrantVectorStore
3
+ from qdrant_client import QdrantClient
4
+ from langchain_google_vertexai import VertexAIEmbeddings
5
+ from dotenv import load_dotenv
6
+ import os
7
+
8
+ import shutil
9
+
10
+ # Load environment variables (API keys, etc.)
11
+ load_dotenv()
12
+
13
+ # Define paths to your data
14
+ # For Hugging Face Spaces (Ephemeral):
15
+ # We use a temporary directory that gets wiped on restart.
16
+ # If DATA_DIR is set (e.g., by your deployment config), use it.
17
+ DATA_DIR = os.getenv("DATA_DIR", os.path.join(os.path.dirname(os.path.abspath(__file__)), "temp_data"))
18
+ QDRANT_PATH = os.path.join(DATA_DIR, "qdrant_db")
19
+ DB_PATH = os.path.join(DATA_DIR, "money_rag.db")
20
+
21
+ # Initialize the MCP Server
22
+ mcp = FastMCP("Money RAG Financial Analyst")
23
+
24
+ import sqlite3
25
+
26
+ def get_schema_info() -> str:
27
+ """Get database schema information."""
28
+ if not os.path.exists(DB_PATH):
29
+ return "Database file does not exist yet. Please upload data."
30
+
31
+ try:
32
+ conn = sqlite3.connect(DB_PATH)
33
+ cursor = conn.cursor()
34
+
35
+ # Get all tables
36
+ cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
37
+ tables = cursor.fetchall()
38
+
39
+ schema_info = []
40
+ for (table_name,) in tables:
41
+ schema_info.append(f"\nTable: {table_name}")
42
+
43
+ # Get column info for each table
44
+ cursor.execute(f"PRAGMA table_info({table_name});")
45
+ columns = cursor.fetchall()
46
+
47
+ schema_info.append("Columns:")
48
+ for col in columns:
49
+ col_id, col_name, col_type, not_null, default_val, pk = col
50
+ schema_info.append(f" - {col_name} ({col_type})")
51
+
52
+ conn.close()
53
+ return "\n".join(schema_info)
54
+ except Exception as e:
55
+ return f"Error reading schema: {e}"
56
+
57
+
58
+ @mcp.resource("schema://database/tables")
59
+ def get_database_schema() -> str:
60
+ """Complete schema information for the money_rag database."""
61
+ return get_schema_info()
62
+
63
+
64
+ @mcp.tool()
65
+ def query_database(query: str) -> str:
66
+ """Execute a SELECT query on the money_rag SQLite database.
67
+
68
+ Args:
69
+ query: The SQL SELECT query to execute
70
+
71
+ Returns:
72
+ Query results or error message
73
+
74
+ Important Notes:
75
+ - Only SELECT queries are allowed (read-only)
76
+ - Use 'description' column for text search
77
+ - 'amount' column: positive values = spending, negative values = payments/refunds
78
+
79
+ Example queries:
80
+ - Find Walmart spending: SELECT SUM(amount) FROM transactions WHERE description LIKE '%Walmart%' AND amount > 0;
81
+ - List recent transactions: SELECT transaction_date, description, amount, category FROM transactions ORDER BY transaction_date DESC LIMIT 5;
82
+ - Spending by category: SELECT category, SUM(amount) FROM transactions WHERE amount > 0 GROUP BY category;
83
+ """
84
+ if not os.path.exists(DB_PATH):
85
+ return "Database file does not exist yet. Please upload data."
86
+
87
+ # Security: Only allow SELECT queries
88
+ query_upper = query.strip().upper()
89
+ if not query_upper.startswith("SELECT") and not query_upper.startswith("PRAGMA"):
90
+ return "Error: Only SELECT and PRAGMA queries are allowed"
91
+
92
+ # Forbidden operations
93
+ forbidden = ["INSERT", "UPDATE", "DELETE", "DROP", "ALTER", "CREATE", "REPLACE", "TRUNCATE", "ATTACH", "DETACH"]
94
+ # Check for forbidden words as standalone words to avoid false positives (e.g. "update_date" column)
95
+ # Simple check: space-surrounded or end-of-string
96
+ if any(f" {word} " in f" {query_upper} " for word in forbidden):
97
+ return f"Error: Query contains forbidden operation. Only SELECT queries allowed."
98
+
99
+ try:
100
+ conn = sqlite3.connect(DB_PATH)
101
+ cursor = conn.cursor()
102
+ cursor.execute(query)
103
+ results = cursor.fetchall()
104
+
105
+ # Get column names to make result more readable
106
+ column_names = [description[0] for description in cursor.description] if cursor.description else []
107
+
108
+ conn.close()
109
+
110
+ if not results:
111
+ return "No results found"
112
+
113
+ # Format results nicely
114
+ formatted_results = []
115
+ formatted_results.append(f"Columns: {', '.join(column_names)}")
116
+ for row in results:
117
+ formatted_results.append(str(row))
118
+
119
+ return "\n".join(formatted_results)
120
+ except sqlite3.Error as e:
121
+ return f"Error: {str(e)}"
122
+
123
+ def get_vector_store():
124
+ """Initialize connection to the Qdrant vector store"""
125
+ # Initialize Embedding Model
126
+ # Uses environment variables/default gcloud auth
127
+ embeddings = VertexAIEmbeddings(model_name="text-embedding-005")
128
+
129
+ # Connect to Qdrant (Persistent Disk Mode at specific path)
130
+ # We ensure the directory exists so Qdrant can write to it.
131
+ os.makedirs(QDRANT_PATH, exist_ok=True)
132
+
133
+ client = QdrantClient(path=QDRANT_PATH)
134
+
135
+ # Check if collection exists (it might be empty in a new ephemeral session)
136
+ collections = client.get_collections().collections
137
+ collection_names = [c.name for c in collections]
138
+
139
+ if "transactions" not in collection_names:
140
+ # In a real app, you would probably trigger ingestion here or handle the empty state
141
+ pass
142
+
143
+ return QdrantVectorStore(
144
+ client=client,
145
+ collection_name="transactions",
146
+ embedding=embeddings,
147
+ )
148
+
149
+ @mcp.tool()
150
+ def semantic_search(query: str, top_k: int = 5) -> str:
151
+ """
152
+ Search for personal financial transactions semantically.
153
+
154
+ Use this to find spending when specific merchant names are unknown or ambiguous.
155
+ Examples: "how much did I spend on fast food?", "subscriptions", "travel expenses".
156
+
157
+ Args:
158
+ query: The description or category of spending to look for.
159
+ top_k: Number of results to return (default 5).
160
+ """
161
+ try:
162
+ vector_store = get_vector_store()
163
+
164
+ # Safety check: if no data has been ingested yet
165
+ if not os.path.exists(QDRANT_PATH) or not os.listdir(QDRANT_PATH):
166
+ return "No matching transactions found (Database is empty. Please upload data first)."
167
+
168
+ results = vector_store.similarity_search(query, k=top_k)
169
+
170
+ if not results:
171
+ return "No matching transactions found."
172
+
173
+ output = []
174
+ for doc in results:
175
+ # Format the output clearly for the LLM/User
176
+ amount = doc.metadata.get('amount', 'N/A')
177
+ date = doc.metadata.get('transaction_date', 'N/A')
178
+ output.append(f"Date: {date} | Match: {doc.page_content} | Amount: {amount}")
179
+
180
+ return "\n".join(output)
181
+
182
+ except Exception as e:
183
+ return f"Error performing search: {str(e)}"
184
+
185
+ # A helper to clear data (useful for session reset)
186
+ @mcp.tool()
187
+ def clear_database() -> str:
188
+ """Clear all stored transaction data to reset the session."""
189
+ try:
190
+ if os.path.exists(DATA_DIR):
191
+ shutil.rmtree(DATA_DIR)
192
+ os.makedirs(DATA_DIR)
193
+ return "Database cleared successfully."
194
+ except Exception as e:
195
+ return f"Error clearing database: {e}"
196
+
197
+ if __name__ == "__main__":
198
+ # Runs the server over stdio
199
+ mcp.run()
notebooks/1_test_pdf_reader.ipynb CHANGED
@@ -63,7 +63,7 @@
63
  },
64
  {
65
  "cell_type": "code",
66
- "execution_count": 13,
67
  "metadata": {},
68
  "outputs": [],
69
  "source": [
@@ -202,7 +202,7 @@
202
  },
203
  {
204
  "cell_type": "code",
205
- "execution_count": 14,
206
  "metadata": {},
207
  "outputs": [
208
  {
@@ -211,150 +211,9 @@
211
  "text": [
212
  "📂 Processing /Users/sawale/Documents/learning/money_rag/demo_data/Discover-AllAvailable-20260110.csv...\n",
213
  " ✨ Enriching descriptions (Async)...\n",
214
- " 🔍 Web searching for: BACK MARKET BROOKLYN NY...\n",
215
- " 🔍 Web searching for: TEMU.COM 8884958368 DE...\n",
216
- " 🔍 Web searching for: WALMART STORE 00332 HUNTSVILLE AL...\n",
217
- " 🔍 Web searching for: $100 STATEMENT CREDIT W 1ST PU...\n",
218
- " 🔍 Web searching for: PY *KUNG-FU TEA AL HUNTSVILLE AL...\n",
219
- " 🔍 Web searching for: MADISON MONTGOMERY AL...\n",
220
- " 🔍 Web searching for: INTERNET PAYMENT - THANK YOU...\n",
221
- " 🔍 Web searching for: GRUBHUB - UNIVERSITY OF HUNTSVILLE AL...\n",
222
- " 🔍 Web searching for: MINT MOBILE 800-683-7392 CA...\n",
223
- " 🔍 Web searching for: POPEYES 2577 HUNTSVILLE AL...\n",
224
- " 🔍 Web searching for: 88 BUFFET HUNTSVILLE AL...\n",
225
- " 🔍 Web searching for: VIET HUONG VIETNAMESE RE HUNTSVILLE AL...\n",
226
- " 🔍 Web searching for: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT...\n",
227
- " 🔍 Web searching for: SPO*THECURRYMODERNINDIAN HUNTSVILLE AL...\n",
228
- " 🔍 Web searching for: H&M 0273HUNTSVILLE HUNTSVILLE ALUS0273001241222182740...\n",
229
- " 🔍 Web searching for: INDIAN BAZAAR HUNTSVILLE AL...\n",
230
- " 🔍 Web searching for: HANDELS HOMEMADE HUNTSVI HUNTSVILLE AL...\n",
231
- " 🔍 Web searching for: UAH COLLEGE 256-824-6170 AL...\n",
232
- " 🔍 Web searching for: UAH COLLEGE FSF 800-346-9252 MA...\n",
233
- " 🔍 Web searching for: CHIPOTLE 1687 NASHVILLE TN...\n",
234
- " 🔍 Web searching for: TST*PIE TOWN TACOS - F NASHVILLE TN00153526022200965677AA...\n",
235
- " 🔍 Web searching for: INDIAN BAZAAR HUNTSVILLE ALGOOGLE PAY ENDING IN 8984...\n",
236
- " 🔍 Web searching for: INDIA MART HUNTSVILLE ALGOOGLE PAY ENDING IN 8984...\n",
237
- " 🔍 Web searching for: PAYPAL *KEVDUDE1186 KEV 888-221-1161 CA...\n",
238
- " 🔍 Web searching for: LYFT *RIDE WED 10AM 8552800278 CA...\n",
239
- " 🔍 Web searching for: SKECHERS USA INC 1069 HUNTSVILLE AL...\n",
240
- " 🔍 Web searching for: STORE HUNTSVILLE AL...\n",
241
- " 🔍 Web searching for: LYFT *RIDE WED 3PM 8552800278 CA...\n",
242
- " 🔍 Web searching for: SQ *TAQUERIA LAS ADELI HUNTSVILLE AL0002305843021411201895...\n",
243
- " 🔍 Web searching for: UAH HUNTSVILLE DUNKIN HUNTSVILLE AL...\n",
244
- " 🔍 Web searching for: WALMART.COM 800-925-6278 AR...\n",
245
- " 🔍 Web searching for: WALMART.COM 8009256278 BENTONVILLE AR...\n",
246
- " 🔍 Web searching for: TOUS LES JOURS - HUNTSVI HUNTSVILLE AL...\n",
247
- " 🔍 Web searching for: MARSHALLS #422 HUNTSVILLE AL...\n",
248
- " 🔍 Web searching for: ROSS STORE #2436 HUNTSVILLE AL...\n",
249
- " 🔍 Web searching for: SPRINTAX NR TAX 8882038900 NY...\n",
250
- " 🔍 Web searching for: USPS PO 0142460804 HUNTSVILLE AL...\n",
251
- " 🔍 Web searching for: CHIPOTLE 1796 HUNTSVILLE ALGOOGLE PAY ENDING IN 8984...\n",
252
- " 🔍 Web searching for: TST*POURHOUSE HUNTSVILLE AL00031984024314246667AA...\n",
253
- " 🔍 Web searching for: TST*WOKS UP HUNTSVILLE AL00075396024313993332AA...\n",
254
- " 🔍 Web searching for: SPIRIT AIRLINES 8014012222 FL...\n",
255
- " 🔍 Web searching for: CHIPOTLE 1796 HUNTSVILLE AL...\n",
256
- " 🔍 Web searching for: UAH BURSARS OFFICE HUNTSVILLE AL...\n",
257
- " 🔍 Web searching for: STARS AND STRIKES - HUNT HUNTSVILLE AL...\n",
258
- " 🔍 Web searching for: ROSS STORES #620 HUNTSVILLE AL...\n",
259
- " 🔍 Web searching for: TST*KAMADO RAMEN - MID HUNTSVILLE AL00006963025030352515AA...\n",
260
- " 🔍 Web searching for: SQ *MOM'SCLAYCO HARVEST AL0002305843022068424398...\n",
261
- " 🔍 Web searching for: DOLLARTREE HUNTSVILLE AL...\n",
262
- " 🔍 Web searching for: SLIM & HUSKIES NASHVILLE TN...\n",
263
- " 🔍 Web searching for: CHIPOTLE 1392 SANTA MONICA CA...\n",
264
- " 🔍 Web searching for: DOLLAR TREE LAS VEGAS NV...\n",
265
- " 🔍 Web searching for: LYFT *RIDE TUE 12AM 8552800278 CA...\n",
266
- " 🔍 Web searching for: SQ *SHIKU GCM LOS ANGELES CA0001152921515467218869...\n",
267
- " 🔍 Web searching for: SQ *SHIKU GCM LOS ANGELES CA0001152921515467211997...\n",
268
- " 🔍 Web searching for: WALMART STORE 05686 BURBANK CA...\n",
269
- " 🔍 Web searching for: CAFE BELLA NEWPORT SAN DIEGO CAGOOGLE PAY ENDING IN 8984...\n",
270
- " 🔍 Web searching for: CHIPOTLE 2883 NORTH LAS VEGNVGOOGLE PAY ENDING IN 8984...\n",
271
- " 🔍 Web searching for: SHELL10006319007 HESPERIA CAGOOGLE PAY ENDING IN 8984...\n",
272
- " 🔍 Web searching for: PANDA EXPRESS #1964 LAS VEGAS NV...\n",
273
- " 🔍 Web searching for: DENNY'S #0141 QR LAS VEGAS NVGOOGLE PAY ENDING IN 8984...\n",
274
- " 🔍 Web searching for: LAS VEGAS SOUVENIRS AND LAS VEGAS NV...\n",
275
- " 🔍 Web searching for: CTLP*FIRST CLASS VENDI BELLGARDENS CA...\n",
276
- " 🔍 Web searching for: SHELL12874333011 FRANKLIN TN...\n",
277
- " 🔍 Web searching for: AMARAVATI INDIAN CUISINE BRENTWOOD TNGOOGLE PAY ENDING IN 8984...\n",
278
- " 🔍 Web searching for: CENTRAL MARKET NASHVILLE TN...\n",
279
- " 🔍 Web searching for: TST*PRINCES HOT CHICKE NASHVILLE TN00104605025320544723AA...\n",
280
- " 🔍 Web searching for: TST*PRINCES HOT CHICKE NASHVILLE TN00104605025321087148AA...\n",
281
- " 🔍 Web searching for: WALMART STORE 05616 NASHVILLE TN...\n",
282
- " 🔍 Web searching for: PY *KUNG-FU TEA AL HUNTSVILLE ALGOOGLE PAY ENDING IN 8984...\n",
283
- " 🔍 Web searching for: 2LEVY R&C CHATTANOOGA TNGOOGLE PAY ENDING IN 8984...\n",
284
  "✅ Ingested 124 rows from Discover-AllAvailable-20260110.csv. Logic: spending_is_positive\n",
285
  "📂 Processing /Users/sawale/Documents/learning/money_rag/demo_data/Chase5282_Activity20240110_20260110_20260111.CSV...\n",
286
  " ✨ Enriching descriptions (Async)...\n",
287
- " 🔍 Web searching for: TOUS LES JOURS - HUNTSVIL...\n",
288
- " 🔍 Web searching for: Payment Thank You-Mobile...\n",
289
- " 🔍 Web searching for: INDIAN BAZAAR...\n",
290
- " 🔍 Web searching for: TST*BLUE OAK BBQ-HUNTSVI...\n",
291
- " 🔍 Web searching for: AMC 4112 VAL BEND 18...\n",
292
- " 🔍 Web searching for: HANDELS HOMEMADE JONES V...\n",
293
- " 🔍 Web searching for: PAYYOURSELFBACK CREDIT...\n",
294
- " 🔍 Web searching for: TST* HYDERABAD HOUSE...\n",
295
- " 🔍 Web searching for: PATEL BROTHERS NASHVILLE...\n",
296
- " 🔍 Web searching for: CITY OF HUNTSVILLE...\n",
297
- " 🔍 Web searching for: WM SUPERCENTER #332...\n",
298
- " 🔍 Web searching for: WAL-MART #0332...\n",
299
- " 🔍 Web searching for: AMAZON MKTPL*OS1RI3LN3...\n",
300
- " 🔍 Web searching for: TST* HATTIE B'S HUNTSVILL...\n",
301
- " 🔍 Web searching for: AMAZON MKTPL*BI23Z6JR0...\n",
302
- " 🔍 Web searching for: AMAZON MKTPL*BI9IW9OS2...\n",
303
- " 🔍 Web searching for: AMAZON MKTPL*BI0296OJ2...\n",
304
- " 🔍 Web searching for: AMAZON MKTPL*BB71A2881...\n",
305
- " 🔍 Web searching for: AMAZON MKTPL*BB3FU2UQ2...\n",
306
- " 🔍 Web searching for: AMAZON MKTPL*BI03P1OX2...\n",
307
- " 🔍 Web searching for: AMAZON MKTPL*BB92U9QK2...\n",
308
- " 🔍 Web searching for: AMAZON MKTPL*BB9TA14Q0...\n",
309
- " 🔍 Web searching for: 88 BUFFET...\n",
310
- " 🔍 Web searching for: AMAZON MKTPL*BB0DC71B1...\n",
311
- " 🔍 Web searching for: AMAZON MKTPL*B20NN4ID0...\n",
312
- " 🔍 Web searching for: AMAZON MKTPL*B273C1WY2...\n",
313
- " 🔍 Web searching for: AMAZON MKTPL*B27IN41E1...\n",
314
- " 🔍 Web searching for: AMAZON MKTPL*B250Z60P1...\n",
315
- " 🔍 Web searching for: BEST BUY 00005140...\n",
316
- " 🔍 Web searching for: DAVES HOT CHICKEN 1282...\n",
317
- " 🔍 Web searching for: SQ *VIETCUISINE LLC...\n",
318
- " 🔍 Web searching for: CHICK-FIL-A #00579...\n",
319
- " 🔍 Web searching for: COSTCO WHSE #0356...\n",
320
- " 🔍 Web searching for: AMAZON MKTPL*NK4AM43Q2...\n",
321
- " 🔍 Web searching for: HUNTSVILLE FLV...\n",
322
- " 🔍 Web searching for: AMAZON MKTPL*NM1H055K0...\n",
323
- " 🔍 Web searching for: MAPCO EXPRESS #3403...\n",
324
- " 🔍 Web searching for: DUNKIN #346212 Q35...\n",
325
- " 🔍 Web searching for: CENTRAL MARKET...\n",
326
- " 🔍 Web searching for: TARA INTERNATIONAL MARKET...\n",
327
- " 🔍 Web searching for: BOTAN MARKET INC...\n",
328
- " 🔍 Web searching for: AMARAVATI INDIAN CUISINE...\n",
329
- " 🔍 Web searching for: GRUBHUB - UNIVERSITY OF A...\n",
330
- " 🔍 Web searching for: BURGER KING #4959...\n",
331
- " 🔍 Web searching for: PANDA EXPRESS #3013...\n",
332
- " 🔍 Web searching for: MCDONALD'S F2431...\n",
333
- " 🔍 Web searching for: ENDZONE COLLECTIBLES...\n",
334
- " 🔍 Web searching for: ZIMMAD EVE* ZIMMAD JOI...\n",
335
- " 🔍 Web searching for: SQ *SPILL COFFEE AND CREA...\n",
336
- " 🔍 Web searching for: 10267 CAVA WHITESBURG...\n",
337
- " 🔍 Web searching for: SPO*DRAGONSFORGECAFE...\n",
338
- " 🔍 Web searching for: UAH BURSARS OFFICE...\n",
339
- " 🔍 Web searching for: MARATHON PETRO42804...\n",
340
- " 🔍 Web searching for: TST*NOTHING BUT NOODLES...\n",
341
- " 🔍 Web searching for: VEDA INDIAN CUISINE...\n",
342
- " 🔍 Web searching for: DOLLARTREE...\n",
343
- " 🔍 Web searching for: TARGET 00013466...\n",
344
- " 🔍 Web searching for: POPEYES 2577...\n",
345
- " 🔍 Web searching for: DEORALI GROCERY...\n",
346
- " 🔍 Web searching for: HELLO ATLANTA #33...\n",
347
- " 🔍 Web searching for: SKY VIEW ATLANTA...\n",
348
- " 🔍 Web searching for: STARBUCKS 25111...\n",
349
- " 🔍 Web searching for: BP#8998205AM/PM WADE GRE...\n",
350
- " 🔍 Web searching for: Waffle House 0857...\n",
351
- " 🔍 Web searching for: CINEMARK 1131 BOXCON...\n",
352
- " 🔍 Web searching for: CINEMARK 1131 RSTBAR...\n",
353
- " 🔍 Web searching for: HOMEGOODS # 0568...\n",
354
- " 🔍 Web searching for: ASIAN MARKET...\n",
355
- " 🔍 Web searching for: PANDA EXPRESS #2005...\n",
356
- " 🔍 Web searching for: STARS AND STRIKES - HUNTS...\n",
357
- " 🔍 Web searching for: WAL-MART #332...\n",
358
  "✅ Ingested 126 rows from Chase5282_Activity20240110_20260110_20260111.CSV. Logic: spending_is_negative\n"
359
  ]
360
  }
@@ -380,7 +239,7 @@
380
  },
381
  {
382
  "cell_type": "code",
383
- "execution_count": 15,
384
  "metadata": {},
385
  "outputs": [
386
  {
@@ -416,7 +275,7 @@
416
  " <tbody>\n",
417
  " <tr>\n",
418
  " <th>0</th>\n",
419
- " <td>8ea03f61-dd51-45f9-a633-bd363154a424</td>\n",
420
  " <td>2024-10-17 00:00:00</td>\n",
421
  " <td>BACK MARKET BROOKLYN NY</td>\n",
422
  " <td>231.19</td>\n",
@@ -426,7 +285,7 @@
426
  " </tr>\n",
427
  " <tr>\n",
428
  " <th>1</th>\n",
429
- " <td>02107b64-e0bd-4a7f-b5cc-674b7767a50f</td>\n",
430
  " <td>2024-10-18 00:00:00</td>\n",
431
  " <td>TEMU.COM 8884958368 DE</td>\n",
432
  " <td>16.51</td>\n",
@@ -436,7 +295,7 @@
436
  " </tr>\n",
437
  " <tr>\n",
438
  " <th>2</th>\n",
439
- " <td>a5a7cc9f-46ab-4913-a695-290b75f590a9</td>\n",
440
  " <td>2024-10-18 00:00:00</td>\n",
441
  " <td>WALMART STORE 00332 HUNTSVILLE AL</td>\n",
442
  " <td>146.73</td>\n",
@@ -446,7 +305,7 @@
446
  " </tr>\n",
447
  " <tr>\n",
448
  " <th>3</th>\n",
449
- " <td>332c4fac-7760-4c63-992b-fd24fcdd4eee</td>\n",
450
  " <td>2024-10-18 00:00:00</td>\n",
451
  " <td>$100 STATEMENT CREDIT W 1ST PU</td>\n",
452
  " <td>-100.00</td>\n",
@@ -456,7 +315,7 @@
456
  " </tr>\n",
457
  " <tr>\n",
458
  " <th>4</th>\n",
459
- " <td>ef01b0e5-5a29-4c08-ac16-fff028cc23e6</td>\n",
460
  " <td>2024-11-02 00:00:00</td>\n",
461
  " <td>PY *KUNG-FU TEA AL HUNTSVILLE AL</td>\n",
462
  " <td>8.09</td>\n",
@@ -476,7 +335,7 @@
476
  " </tr>\n",
477
  " <tr>\n",
478
  " <th>245</th>\n",
479
- " <td>8c5d2425-5ddd-4532-8279-d6b3e733ec01</td>\n",
480
  " <td>2025-06-18 00:00:00</td>\n",
481
  " <td>PANDA EXPRESS #2005</td>\n",
482
  " <td>52.87</td>\n",
@@ -486,7 +345,7 @@
486
  " </tr>\n",
487
  " <tr>\n",
488
  " <th>246</th>\n",
489
- " <td>02578b56-f0a1-490d-8cf1-dd061a26ebf2</td>\n",
490
  " <td>2025-06-14 00:00:00</td>\n",
491
  " <td>Payment Thank You-Mobile</td>\n",
492
  " <td>-62.07</td>\n",
@@ -496,7 +355,7 @@
496
  " </tr>\n",
497
  " <tr>\n",
498
  " <th>247</th>\n",
499
- " <td>e0acc481-3baf-458b-9cdf-75bc1524a5f5</td>\n",
500
  " <td>2025-06-12 00:00:00</td>\n",
501
  " <td>STARS AND STRIKES - HUNTS</td>\n",
502
  " <td>21.80</td>\n",
@@ -506,7 +365,7 @@
506
  " </tr>\n",
507
  " <tr>\n",
508
  " <th>248</th>\n",
509
- " <td>dfc97eee-5207-464a-b6e1-a49fd80df48c</td>\n",
510
  " <td>2025-06-11 00:00:00</td>\n",
511
  " <td>WAL-MART #332</td>\n",
512
  " <td>4.47</td>\n",
@@ -516,7 +375,7 @@
516
  " </tr>\n",
517
  " <tr>\n",
518
  " <th>249</th>\n",
519
- " <td>576a6f5a-d090-4e4c-84f1-c1cc3fe8809c</td>\n",
520
  " <td>2025-06-11 00:00:00</td>\n",
521
  " <td>WAL-MART #332</td>\n",
522
  " <td>57.60</td>\n",
@@ -531,17 +390,17 @@
531
  ],
532
  "text/plain": [
533
  " id transaction_date \\\n",
534
- "0 8ea03f61-dd51-45f9-a633-bd363154a424 2024-10-17 00:00:00 \n",
535
- "1 02107b64-e0bd-4a7f-b5cc-674b7767a50f 2024-10-18 00:00:00 \n",
536
- "2 a5a7cc9f-46ab-4913-a695-290b75f590a9 2024-10-18 00:00:00 \n",
537
- "3 332c4fac-7760-4c63-992b-fd24fcdd4eee 2024-10-18 00:00:00 \n",
538
- "4 ef01b0e5-5a29-4c08-ac16-fff028cc23e6 2024-11-02 00:00:00 \n",
539
  ".. ... ... \n",
540
- "245 8c5d2425-5ddd-4532-8279-d6b3e733ec01 2025-06-18 00:00:00 \n",
541
- "246 02578b56-f0a1-490d-8cf1-dd061a26ebf2 2025-06-14 00:00:00 \n",
542
- "247 e0acc481-3baf-458b-9cdf-75bc1524a5f5 2025-06-12 00:00:00 \n",
543
- "248 dfc97eee-5207-464a-b6e1-a49fd80df48c 2025-06-11 00:00:00 \n",
544
- "249 576a6f5a-d090-4e4c-84f1-c1cc3fe8809c 2025-06-11 00:00:00 \n",
545
  "\n",
546
  " description amount category \\\n",
547
  "0 BACK MARKET BROOKLYN NY 231.19 Merchandise \n",
@@ -585,7 +444,7 @@
585
  "[250 rows x 7 columns]"
586
  ]
587
  },
588
- "execution_count": 15,
589
  "metadata": {},
590
  "output_type": "execute_result"
591
  }
@@ -619,7 +478,7 @@
619
  },
620
  {
621
  "cell_type": "code",
622
- "execution_count": null,
623
  "metadata": {},
624
  "outputs": [
625
  {
@@ -634,7 +493,7 @@
634
  "name": "stdout",
635
  "output_type": "stream",
636
  "text": [
637
- "✅ Synced 250 records to Qdrant.\n"
638
  ]
639
  }
640
  ],
@@ -699,7 +558,7 @@
699
  },
700
  {
701
  "cell_type": "code",
702
- "execution_count": 34,
703
  "metadata": {},
704
  "outputs": [],
705
  "source": [
@@ -780,16 +639,16 @@
780
  },
781
  {
782
  "cell_type": "code",
783
- "execution_count": 35,
784
  "metadata": {},
785
  "outputs": [
786
  {
787
  "name": "stdout",
788
  "output_type": "stream",
789
  "text": [
790
- "Match: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT - What is this charge? Cashback bonus redemption pymt / stmt crdt . Cash - back from mogl 858-36958. His IP address, location , Internet provider, what browser he uses and operating system? You can find out all this using \"2IP spy\".It serves two main functions. It provides the network location of the host and identifies the host or network interface. What is the purpose of an IP address? Cashback bonus redemption pymt / stmt crdt .March is the month in which I had most number of transcations. I think this is because I visited the store next to me very frequently for small purchases. Cashback bonus redemption pymt / stmt crdt . Redemption Activity This Period is the total amount of Rewards you redeemed during the statement period and includes Miles partners, gift cards, account credits, electronic deposits and charitable donations. Cashback bonus redemption pymt / stmt crdt .Question2 : What was the frequency(number of occurences) of each category in terms of expenses made over the entire time period?. | Metadata: {'id': '026ac6fc-41ce-45e4-b8d5-c109b73c1e79', 'amount': -11.32, 'category': 'Awards and Rebate Credits', 'transaction_date': '2025-03-18 00:00:00', '_id': '598fb646d8a54e10a725ea61394e176a', '_collection_name': 'transactions'}\n",
791
- "Match: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT - What is this charge? Cashback bonus redemption pymt / stmt crdt . Cash - back from mogl 858-36958. His IP address, location , Internet provider, what browser he uses and operating system? You can find out all this using \"2IP spy\".It serves two main functions. It provides the network location of the host and identifies the host or network interface. What is the purpose of an IP address? Cashback bonus redemption pymt / stmt crdt .March is the month in which I had most number of transcations. I think this is because I visited the store next to me very frequently for small purchases. Cashback bonus redemption pymt / stmt crdt . Redemption Activity This Period is the total amount of Rewards you redeemed during the statement period and includes Miles partners, gift cards, account credits, electronic deposits and charitable donations. Cashback bonus redemption pymt / stmt crdt .Question2 : What was the frequency(number of occurences) of each category in terms of expenses made over the entire time period?. | Metadata: {'id': '8dc63630-aa67-4bb0-8012-70d244a2ba51', 'amount': -9.0, 'category': 'Awards and Rebate Credits', 'transaction_date': '2025-05-15 00:00:00', '_id': 'ecd0bafc8fee44e491fec958ffe14b51', '_collection_name': 'transactions'}\n",
792
- "Match: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT - What is this charge? Cashback bonus redemption pymt / stmt crdt . Cash - back from mogl 858-36958. His IP address, location , Internet provider, what browser he uses and operating system? You can find out all this using \"2IP spy\".It serves two main functions. It provides the network location of the host and identifies the host or network interface. What is the purpose of an IP address? Cashback bonus redemption pymt / stmt crdt .March is the month in which I had most number of transcations. I think this is because I visited the store next to me very frequently for small purchases. Cashback bonus redemption pymt / stmt crdt . Redemption Activity This Period is the total amount of Rewards you redeemed during the statement period and includes Miles partners, gift cards, account credits, electronic deposits and charitable donations. Cashback bonus redemption pymt / stmt crdt .Question2 : What was the frequency(number of occurences) of each category in terms of expenses made over the entire time period?. | Metadata: {'id': 'f93f111c-91bc-46f6-8a30-d14f4fb097af', 'amount': -2.55, 'category': 'Awards and Rebate Credits', 'transaction_date': '2025-11-06 00:00:00', '_id': '40f2d5f43c6d46e683de588e0ac3e36e', '_collection_name': 'transactions'}\n"
793
  ]
794
  }
795
  ],
@@ -807,7 +666,7 @@
807
  },
808
  {
809
  "cell_type": "code",
810
- "execution_count": 36,
811
  "metadata": {},
812
  "outputs": [
813
  {
@@ -818,24 +677,15 @@
818
  "\n",
819
  "is there anything i need to be worried about in my spending over the last 2 months?\n",
820
  "==================================\u001b[1m Ai Message \u001b[0m==================================\n",
821
- "Tool Calls:\n",
822
- " execute_sql (53fdebc4-4abc-4bda-ac02-e1f2f89b8140)\n",
823
- " Call ID: 53fdebc4-4abc-4bda-ac02-e1f2f89b8140\n",
824
- " Args:\n",
825
- " query: SELECT SUM(amount) FROM transactions WHERE transaction_date >= date('now', '-2 months') AND amount > 0\n",
826
- "=================================\u001b[1m Tool Message \u001b[0m=================================\n",
827
- "Name: execute_sql\n",
828
  "\n",
829
- "[(2028.51,)]\n",
830
- "==================================\u001b[1m Ai Message \u001b[0m==================================\n",
831
  "\n",
832
- "Your total spending over the last two months is $2028.51.\n",
 
 
 
833
  "\n",
834
- "To tell you if there's anything to \"worry about,\" I need a bit more information. Would you like me to:\n",
835
- "1. Break down your spending by category?\n",
836
- "2. Identify any unusually large transactions?\n",
837
- "3. Compare your spending to previous months?\n",
838
- "4. Look for any recurring subscriptions?\n"
839
  ]
840
  }
841
  ],
@@ -862,7 +712,17 @@
862
  "name": "stdout",
863
  "output_type": "stream",
864
  "text": [
865
- "💬 Chat with your financial data! (Type 'exit' to stop)\n"
 
 
 
 
 
 
 
 
 
 
866
  ]
867
  }
868
  ],
 
63
  },
64
  {
65
  "cell_type": "code",
66
+ "execution_count": 3,
67
  "metadata": {},
68
  "outputs": [],
69
  "source": [
 
202
  },
203
  {
204
  "cell_type": "code",
205
+ "execution_count": 4,
206
  "metadata": {},
207
  "outputs": [
208
  {
 
211
  "text": [
212
  "📂 Processing /Users/sawale/Documents/learning/money_rag/demo_data/Discover-AllAvailable-20260110.csv...\n",
213
  " ✨ Enriching descriptions (Async)...\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  "✅ Ingested 124 rows from Discover-AllAvailable-20260110.csv. Logic: spending_is_positive\n",
215
  "📂 Processing /Users/sawale/Documents/learning/money_rag/demo_data/Chase5282_Activity20240110_20260110_20260111.CSV...\n",
216
  " ✨ Enriching descriptions (Async)...\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  "✅ Ingested 126 rows from Chase5282_Activity20240110_20260110_20260111.CSV. Logic: spending_is_negative\n"
218
  ]
219
  }
 
239
  },
240
  {
241
  "cell_type": "code",
242
+ "execution_count": 5,
243
  "metadata": {},
244
  "outputs": [
245
  {
 
275
  " <tbody>\n",
276
  " <tr>\n",
277
  " <th>0</th>\n",
278
+ " <td>5712be16-98a8-41d7-94de-15ecff7793da</td>\n",
279
  " <td>2024-10-17 00:00:00</td>\n",
280
  " <td>BACK MARKET BROOKLYN NY</td>\n",
281
  " <td>231.19</td>\n",
 
285
  " </tr>\n",
286
  " <tr>\n",
287
  " <th>1</th>\n",
288
+ " <td>cea08bf8-440c-4d05-b06c-5c0d2e3b2997</td>\n",
289
  " <td>2024-10-18 00:00:00</td>\n",
290
  " <td>TEMU.COM 8884958368 DE</td>\n",
291
  " <td>16.51</td>\n",
 
295
  " </tr>\n",
296
  " <tr>\n",
297
  " <th>2</th>\n",
298
+ " <td>b021b290-36fc-4667-993c-6f620da3a54a</td>\n",
299
  " <td>2024-10-18 00:00:00</td>\n",
300
  " <td>WALMART STORE 00332 HUNTSVILLE AL</td>\n",
301
  " <td>146.73</td>\n",
 
305
  " </tr>\n",
306
  " <tr>\n",
307
  " <th>3</th>\n",
308
+ " <td>d260bc87-ca63-4238-ad9e-3482273c49fb</td>\n",
309
  " <td>2024-10-18 00:00:00</td>\n",
310
  " <td>$100 STATEMENT CREDIT W 1ST PU</td>\n",
311
  " <td>-100.00</td>\n",
 
315
  " </tr>\n",
316
  " <tr>\n",
317
  " <th>4</th>\n",
318
+ " <td>2c06fe8e-8ef2-49f1-bed6-dd282effec85</td>\n",
319
  " <td>2024-11-02 00:00:00</td>\n",
320
  " <td>PY *KUNG-FU TEA AL HUNTSVILLE AL</td>\n",
321
  " <td>8.09</td>\n",
 
335
  " </tr>\n",
336
  " <tr>\n",
337
  " <th>245</th>\n",
338
+ " <td>6a6167f7-dc54-480f-8a15-0561c7b877da</td>\n",
339
  " <td>2025-06-18 00:00:00</td>\n",
340
  " <td>PANDA EXPRESS #2005</td>\n",
341
  " <td>52.87</td>\n",
 
345
  " </tr>\n",
346
  " <tr>\n",
347
  " <th>246</th>\n",
348
+ " <td>2a01f41e-8f1e-4a10-9e7f-3ac29795607b</td>\n",
349
  " <td>2025-06-14 00:00:00</td>\n",
350
  " <td>Payment Thank You-Mobile</td>\n",
351
  " <td>-62.07</td>\n",
 
355
  " </tr>\n",
356
  " <tr>\n",
357
  " <th>247</th>\n",
358
+ " <td>f7648015-85a6-4412-87d5-1499ac29fce6</td>\n",
359
  " <td>2025-06-12 00:00:00</td>\n",
360
  " <td>STARS AND STRIKES - HUNTS</td>\n",
361
  " <td>21.80</td>\n",
 
365
  " </tr>\n",
366
  " <tr>\n",
367
  " <th>248</th>\n",
368
+ " <td>2edd49e5-9f4f-46d4-b94f-f9d7661bcdab</td>\n",
369
  " <td>2025-06-11 00:00:00</td>\n",
370
  " <td>WAL-MART #332</td>\n",
371
  " <td>4.47</td>\n",
 
375
  " </tr>\n",
376
  " <tr>\n",
377
  " <th>249</th>\n",
378
+ " <td>1d2ecebf-4994-4cdd-8d09-b6751655cd3f</td>\n",
379
  " <td>2025-06-11 00:00:00</td>\n",
380
  " <td>WAL-MART #332</td>\n",
381
  " <td>57.60</td>\n",
 
390
  ],
391
  "text/plain": [
392
  " id transaction_date \\\n",
393
+ "0 5712be16-98a8-41d7-94de-15ecff7793da 2024-10-17 00:00:00 \n",
394
+ "1 cea08bf8-440c-4d05-b06c-5c0d2e3b2997 2024-10-18 00:00:00 \n",
395
+ "2 b021b290-36fc-4667-993c-6f620da3a54a 2024-10-18 00:00:00 \n",
396
+ "3 d260bc87-ca63-4238-ad9e-3482273c49fb 2024-10-18 00:00:00 \n",
397
+ "4 2c06fe8e-8ef2-49f1-bed6-dd282effec85 2024-11-02 00:00:00 \n",
398
  ".. ... ... \n",
399
+ "245 6a6167f7-dc54-480f-8a15-0561c7b877da 2025-06-18 00:00:00 \n",
400
+ "246 2a01f41e-8f1e-4a10-9e7f-3ac29795607b 2025-06-14 00:00:00 \n",
401
+ "247 f7648015-85a6-4412-87d5-1499ac29fce6 2025-06-12 00:00:00 \n",
402
+ "248 2edd49e5-9f4f-46d4-b94f-f9d7661bcdab 2025-06-11 00:00:00 \n",
403
+ "249 1d2ecebf-4994-4cdd-8d09-b6751655cd3f 2025-06-11 00:00:00 \n",
404
  "\n",
405
  " description amount category \\\n",
406
  "0 BACK MARKET BROOKLYN NY 231.19 Merchandise \n",
 
444
  "[250 rows x 7 columns]"
445
  ]
446
  },
447
+ "execution_count": 5,
448
  "metadata": {},
449
  "output_type": "execute_result"
450
  }
 
478
  },
479
  {
480
  "cell_type": "code",
481
+ "execution_count": 7,
482
  "metadata": {},
483
  "outputs": [
484
  {
 
493
  "name": "stdout",
494
  "output_type": "stream",
495
  "text": [
496
+ "✅ Synced 250 records to Qdrant at 'qdrant_db/'.\n"
497
  ]
498
  }
499
  ],
 
558
  },
559
  {
560
  "cell_type": "code",
561
+ "execution_count": 8,
562
  "metadata": {},
563
  "outputs": [],
564
  "source": [
 
639
  },
640
  {
641
  "cell_type": "code",
642
+ "execution_count": 9,
643
  "metadata": {},
644
  "outputs": [
645
  {
646
  "name": "stdout",
647
  "output_type": "stream",
648
  "text": [
649
+ "Match: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT - What is this charge? Cashback bonus redemption pymt / stmt crdt . Cash - back from mogl 858-36958. His IP address, location , Internet provider, what browser he uses and operating system? You can find out all this using \"2IP spy\".It serves two main functions. It provides the network location of the host and identifies the host or network interface. What is the purpose of an IP address? Cashback bonus redemption pymt / stmt crdt .March is the month in which I had most number of transcations. I think this is because I visited the store next to me very frequently for small purchases. Cashback bonus redemption pymt / stmt crdt . Redemption Activity This Period is the total amount of Rewards you redeemed during the statement period and includes Miles partners, gift cards, account credits, electronic deposits and charitable donations. Cashback bonus redemption pymt / stmt crdt .Question2 : What was the frequency(number of occurences) of each category in terms of expenses made over the entire time period?. | Metadata: {'id': '96dca195-03e6-4a7f-8836-fc71659a5379', 'amount': -11.32, 'category': 'Awards and Rebate Credits', 'transaction_date': '2025-03-18 00:00:00', '_id': 'ed7d701418bc4c96b42143671dc16464', '_collection_name': 'transactions'}\n",
650
+ "Match: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT - What is this charge? Cashback bonus redemption pymt / stmt crdt . Cash - back from mogl 858-36958. His IP address, location , Internet provider, what browser he uses and operating system? You can find out all this using \"2IP spy\".It serves two main functions. It provides the network location of the host and identifies the host or network interface. What is the purpose of an IP address? Cashback bonus redemption pymt / stmt crdt .March is the month in which I had most number of transcations. I think this is because I visited the store next to me very frequently for small purchases. Cashback bonus redemption pymt / stmt crdt . Redemption Activity This Period is the total amount of Rewards you redeemed during the statement period and includes Miles partners, gift cards, account credits, electronic deposits and charitable donations. Cashback bonus redemption pymt / stmt crdt .Question2 : What was the frequency(number of occurences) of each category in terms of expenses made over the entire time period?. | Metadata: {'id': '70d72fc3-f61f-4a26-982f-0a71a1c48e30', 'amount': -9.0, 'category': 'Awards and Rebate Credits', 'transaction_date': '2025-05-15 00:00:00', '_id': 'e90a36aa56ed4b50a496a0b1d468d4e6', '_collection_name': 'transactions'}\n",
651
+ "Match: CASHBACK BONUS REDEMPTION PYMT/STMT CRDT - What is this charge? Cashback bonus redemption pymt / stmt crdt . Cash - back from mogl 858-36958. His IP address, location , Internet provider, what browser he uses and operating system? You can find out all this using \"2IP spy\".It serves two main functions. It provides the network location of the host and identifies the host or network interface. What is the purpose of an IP address? Cashback bonus redemption pymt / stmt crdt .March is the month in which I had most number of transcations. I think this is because I visited the store next to me very frequently for small purchases. Cashback bonus redemption pymt / stmt crdt . Redemption Activity This Period is the total amount of Rewards you redeemed during the statement period and includes Miles partners, gift cards, account credits, electronic deposits and charitable donations. Cashback bonus redemption pymt / stmt crdt .Question2 : What was the frequency(number of occurences) of each category in terms of expenses made over the entire time period?. | Metadata: {'id': 'a4803064-dde5-48a5-be3b-34b17cbb0fbc', 'amount': -2.55, 'category': 'Awards and Rebate Credits', 'transaction_date': '2025-11-06 00:00:00', '_id': 'a10a1f901da54e0599b3578e66ff3fcb', '_collection_name': 'transactions'}\n"
652
  ]
653
  }
654
  ],
 
666
  },
667
  {
668
  "cell_type": "code",
669
+ "execution_count": 10,
670
  "metadata": {},
671
  "outputs": [
672
  {
 
677
  "\n",
678
  "is there anything i need to be worried about in my spending over the last 2 months?\n",
679
  "==================================\u001b[1m Ai Message \u001b[0m==================================\n",
 
 
 
 
 
 
 
680
  "\n",
681
+ "I can't tell you if there's anything to \"worry about\" as that's a subjective judgment. However, I can help you analyze your spending in various ways. For example, I can:\n",
 
682
  "\n",
683
+ "* Show you your total spending over the last two months.\n",
684
+ "* Break down your spending by category or merchant.\n",
685
+ "* Identify your largest transactions.\n",
686
+ "* Find transactions related to specific keywords (e.g., \"fast food,\" \"online shopping\").\n",
687
  "\n",
688
+ "What kind of spending insights would be most helpful for you?\n"
 
 
 
 
689
  ]
690
  }
691
  ],
 
712
  "name": "stdout",
713
  "output_type": "stream",
714
  "text": [
715
+ "💬 Chat with your financial data! (Type 'exit' to stop)\n",
716
+ "\n",
717
+ "--------------------------------------------------\n",
718
+ "================================\u001b[1m Human Message \u001b[0m=================================\n",
719
+ "\n",
720
+ "or db won't be in github..\n",
721
+ "==================================\u001b[1m Ai Message \u001b[0m==================================\n",
722
+ "\n",
723
+ "It seems like your last message might be incomplete or a comment about something else. Could you please let me know what you'd like me to do or if you have a question about your spending? I'm ready to help analyze your transactions.\n",
724
+ "--------------------------------------------------\n",
725
+ "\n"
726
  ]
727
  }
728
  ],
requirements.txt CHANGED
@@ -1,11 +1,156 @@
1
- python-dotenv
2
- langchain
3
- langchain-openai
4
- pandas
5
- tabulate
6
- langchain-google-vertexai
7
- mcp
8
- langchain-mcp
9
- langchain-community
10
- qdrant-client
11
- langchain-qdrant
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ddgs>=9.10.0
2
+ duckduckgo-search>=8.1.1
3
+ fastmcp>=2.14.3
4
+ google-api-core>=2.29.0
5
+ google-auth>=2.47.0
6
+ google-cloud-aiplatform>=1.133.0
7
+ google-cloud-bigquery>=3.40.0
8
+ google-cloud-core>=2.5.0
9
+ google-cloud-resource-manager>=1.15.0
10
+ google-cloud-storage>=2.19.0
11
+ google-crc32c>=1.8.0
12
+ google-genai>=1.57.0
13
+ google-resumable-media>=2.8.0
14
+ googleapis-common-protos>=1.72.0
15
+ grpc-google-iam-v1>=0.14.3
16
+ grpcio>=1.76.0
17
+ grpcio-status>=1.76.0
18
+ h11>=0.16.0
19
+ h2>=4.3.0
20
+ hpack>=4.1.0
21
+ httpcore>=1.0.9
22
+ httpx>=0.28.1
23
+ httpx-sse>=0.4.3
24
+ hyperframe>=6.1.0
25
+ idna>=3.11
26
+ importlib-metadata>=8.7.1
27
+ ipykernel>=7.1.0
28
+ ipython>=9.9.0
29
+ ipython-pygments-lexers>=1.1.1
30
+ jaraco-classes>=3.4.0
31
+ jaraco-context>=6.1.0
32
+ jaraco-functools>=4.4.0
33
+ jedi>=0.19.2
34
+ jiter>=0.12.0
35
+ jsonpatch>=1.33
36
+ jsonpointer>=3.0.0
37
+ jsonschema>=4.26.0
38
+ jsonschema-path>=0.3.4
39
+ jsonschema-specifications>=2025.9.1
40
+ jupyter-client>=8.8.0
41
+ jupyter-core>=5.9.1
42
+ keyring>=25.7.0
43
+ langchain>=1.2.3
44
+ langchain-classic>=1.0.1
45
+ langchain-community>=0.3.31
46
+ langchain-core>=1.2.7
47
+ langchain-google-vertexai>=2.1.2
48
+ langchain-mcp>=0.2.1
49
+ langchain-openai>=0.3.35
50
+ langchain-qdrant>=1.1.0
51
+ langchain-text-splitters>=0.3.11
52
+ langgraph>=1.0.5
53
+ langgraph-checkpoint>=3.0.1
54
+ langgraph-prebuilt>=1.0.5
55
+ langgraph-sdk>=0.3.2
56
+ langsmith>=0.6.2
57
+ lupa>=2.6
58
+ lxml>=6.0.2
59
+ markdown-it-py>=4.0.0
60
+ marshmallow>=3.26.2
61
+ matplotlib-inline>=0.2.1
62
+ mcp>=1.25.0
63
+ mdurl>=0.1.2
64
+ more-itertools>=10.8.0
65
+ multidict>=6.7.0
66
+ mypy-extensions>=1.1.0
67
+ nest-asyncio>=1.6.0
68
+ numexpr>=2.14.1
69
+ numpy>=2.4.1
70
+ openai>=2.15.0
71
+ openapi-pydantic>=0.5.1
72
+ opentelemetry-api>=1.39.1
73
+ opentelemetry-exporter-prometheus>=0.60b1
74
+ opentelemetry-instrumentation>=0.60b1
75
+ opentelemetry-sdk>=1.39.1
76
+ opentelemetry-semantic-conventions>=0.60b1
77
+ orjson>=3.11.5
78
+ ormsgpack>=1.12.1
79
+ packaging>=25.0
80
+ pandas>=2.3.3
81
+ parso>=0.8.5
82
+ pathable>=0.4.4
83
+ pathvalidate>=3.3.1
84
+ pexpect>=4.9.0
85
+ platformdirs>=4.5.1
86
+ portalocker>=3.2.0
87
+ primp>=0.15.0
88
+ prometheus-client>=0.24.1
89
+ prompt-toolkit>=3.0.52
90
+ propcache>=0.4.1
91
+ proto-plus>=1.27.0
92
+ protobuf>=6.33.3
93
+ psutil>=7.2.1
94
+ ptyprocess>=0.7.0
95
+ pure-eval>=0.2.3
96
+ py-key-value-aio>=0.3.0
97
+ py-key-value-shared>=0.3.0
98
+ pyarrow>=21.0.0
99
+ pyasn1>=0.6.1
100
+ pyasn1-modules>=0.4.2
101
+ pycparser>=2.23
102
+ pydantic>=2.12.5
103
+ pydantic-core>=2.41.5
104
+ pydantic-settings>=2.12.0
105
+ pydocket>=0.16.6
106
+ pygments>=2.19.2
107
+ pyjwt>=2.10.1
108
+ pyperclip>=1.11.0
109
+ python-dateutil>=2.9.0.post0
110
+ python-dotenv>=1.2.1
111
+ python-json-logger>=4.0.0
112
+ python-multipart>=0.0.21
113
+ pytz>=2025.2
114
+ pyyaml>=6.0.3
115
+ pyzmq>=27.1.0
116
+ qdrant-client>=1.16.2
117
+ redis>=7.1.0
118
+ referencing>=0.36.2
119
+ regex>=2025.11.3
120
+ requests>=2.32.5
121
+ requests-toolbelt>=1.0.0
122
+ rich>=14.2.0
123
+ rich-rst>=1.3.2
124
+ rpds-py>=0.30.0
125
+ rsa>=4.9.1
126
+ shellingham>=1.5.4
127
+ six>=1.17.0
128
+ sniffio>=1.3.1
129
+ socksio>=1.0.0
130
+ sortedcontainers>=2.4.0
131
+ sqlalchemy>=2.0.45
132
+ sse-starlette>=3.1.2
133
+ stack-data>=0.6.3
134
+ starlette>=0.51.0
135
+ tabulate>=0.9.0
136
+ tenacity>=9.1.2
137
+ tiktoken>=0.12.0
138
+ tornado>=6.5.4
139
+ tqdm>=4.67.1
140
+ traitlets>=5.14.3
141
+ typer>=0.21.1
142
+ typing-extensions>=4.15.0
143
+ typing-inspect>=0.9.0
144
+ typing-inspection>=0.4.2
145
+ tzdata>=2025.3
146
+ urllib3>=2.6.3
147
+ uuid-utils>=0.13.0
148
+ uvicorn>=0.40.0
149
+ validators>=0.35.0
150
+ wcwidth>=0.2.14
151
+ websockets>=15.0.1
152
+ wrapt>=1.17.3
153
+ xxhash>=3.6.0
154
+ yarl>=1.22.0
155
+ zipp>=3.23.0
156
+ zstandard>=0.25.0