Spaces:
Sleeping
Sleeping
Update alz_companion/agent.py
Browse files- alz_companion/agent.py +6 -6
alz_companion/agent.py
CHANGED
|
@@ -661,14 +661,14 @@ def make_rag_chain(vs_general: FAISS, vs_personal: FAISS, *, for_evaluation: boo
|
|
| 661 |
|
| 662 |
# --- NEW: DEDICATED LOGIC PATHS FOR RETRIEVAL ---
|
| 663 |
if is_personal_route:
|
|
|
|
| 664 |
# For personal queries, semantic search is unreliable. We retrieve ALL personal documents.
|
| 665 |
print("[DEBUG] Personal Memory Route Activated. Retrieving all personal documents.")
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
all_retrieved_docs.extend(
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
])
|
| 672 |
else:
|
| 673 |
# For caregiving scenarios, use our powerful Multi-Stage Retrieval algorithm.
|
| 674 |
print("[DEBUG] Using Multi-Stage Retrieval for caregiving scenario...")
|
|
|
|
| 661 |
|
| 662 |
# --- NEW: DEDICATED LOGIC PATHS FOR RETRIEVAL ---
|
| 663 |
if is_personal_route:
|
| 664 |
+
|
| 665 |
# For personal queries, semantic search is unreliable. We retrieve ALL personal documents.
|
| 666 |
print("[DEBUG] Personal Memory Route Activated. Retrieving all personal documents.")
|
| 667 |
+
# --- START: FAISS-COMPATIBLE FIX ---
|
| 668 |
+
if vs_personal and vs_personal.docstore and len(vs_personal.index_to_docstore_id) > 0:
|
| 669 |
+
all_retrieved_docs.extend(list(vs_personal.docstore._dict.values()))
|
| 670 |
+
# --- END: FAISS-COMPATIBLE FIX ---
|
| 671 |
+
|
|
|
|
| 672 |
else:
|
| 673 |
# For caregiving scenarios, use our powerful Multi-Stage Retrieval algorithm.
|
| 674 |
print("[DEBUG] Using Multi-Stage Retrieval for caregiving scenario...")
|