Spaces:
Running
Running
Add session management endpoints to health and medical routers. Implemented functionality to retrieve active sessions, clear specific sessions, and clear all sessions. Updated ask and ask_stream endpoints to support optional session IDs for improved conversation continuity.
Browse files
api/routers/__pycache__/health.cpython-313.pyc
CHANGED
|
Binary files a/api/routers/__pycache__/health.cpython-313.pyc and b/api/routers/__pycache__/health.cpython-313.pyc differ
|
|
|
api/routers/__pycache__/medical.cpython-313.pyc
CHANGED
|
Binary files a/api/routers/__pycache__/medical.cpython-313.pyc and b/api/routers/__pycache__/medical.cpython-313.pyc differ
|
|
|
api/routers/health.py
CHANGED
|
@@ -134,3 +134,95 @@ async def get_version():
|
|
| 134 |
"description": "Professional API for medical information retrieval and advisory services",
|
| 135 |
"build_date": "2024-01-01"
|
| 136 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
"description": "Professional API for medical information retrieval and advisory services",
|
| 135 |
"build_date": "2024-01-01"
|
| 136 |
}
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
@router.get("/sessions")
|
| 140 |
+
async def get_active_sessions():
|
| 141 |
+
"""
|
| 142 |
+
Get list of all active conversation sessions
|
| 143 |
+
"""
|
| 144 |
+
try:
|
| 145 |
+
from core.agent import get_active_sessions
|
| 146 |
+
sessions = get_active_sessions()
|
| 147 |
+
return {
|
| 148 |
+
"active_sessions": sessions,
|
| 149 |
+
"count": len(sessions),
|
| 150 |
+
"timestamp": datetime.now().isoformat()
|
| 151 |
+
}
|
| 152 |
+
except Exception as e:
|
| 153 |
+
return {
|
| 154 |
+
"error": str(e),
|
| 155 |
+
"active_sessions": [],
|
| 156 |
+
"count": 0
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
@router.delete("/sessions/{session_id}")
|
| 161 |
+
async def clear_session(session_id: str):
|
| 162 |
+
"""
|
| 163 |
+
Clear conversation memory for a specific session
|
| 164 |
+
|
| 165 |
+
Args:
|
| 166 |
+
session_id: The session identifier to clear
|
| 167 |
+
"""
|
| 168 |
+
try:
|
| 169 |
+
from core.agent import clear_session_memory
|
| 170 |
+
success = clear_session_memory(session_id)
|
| 171 |
+
if success:
|
| 172 |
+
return {
|
| 173 |
+
"message": f"Session '{session_id}' cleared successfully",
|
| 174 |
+
"session_id": session_id,
|
| 175 |
+
"timestamp": datetime.now().isoformat()
|
| 176 |
+
}
|
| 177 |
+
else:
|
| 178 |
+
return {
|
| 179 |
+
"message": f"Session '{session_id}' not found",
|
| 180 |
+
"session_id": session_id,
|
| 181 |
+
"timestamp": datetime.now().isoformat()
|
| 182 |
+
}
|
| 183 |
+
except Exception as e:
|
| 184 |
+
return {
|
| 185 |
+
"error": str(e),
|
| 186 |
+
"session_id": session_id
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
@router.delete("/sessions")
|
| 191 |
+
async def clear_all_sessions():
|
| 192 |
+
"""
|
| 193 |
+
Clear all conversation sessions
|
| 194 |
+
"""
|
| 195 |
+
try:
|
| 196 |
+
from core.agent import clear_memory
|
| 197 |
+
clear_memory()
|
| 198 |
+
return {
|
| 199 |
+
"message": "All sessions cleared successfully",
|
| 200 |
+
"timestamp": datetime.now().isoformat()
|
| 201 |
+
}
|
| 202 |
+
except Exception as e:
|
| 203 |
+
return {
|
| 204 |
+
"error": str(e)
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
@router.get("/sessions/{session_id}/summary")
|
| 209 |
+
async def get_session_summary(session_id: str):
|
| 210 |
+
"""
|
| 211 |
+
Get conversation history summary for a specific session
|
| 212 |
+
|
| 213 |
+
Args:
|
| 214 |
+
session_id: The session identifier
|
| 215 |
+
"""
|
| 216 |
+
try:
|
| 217 |
+
from core.agent import get_memory_summary
|
| 218 |
+
summary = get_memory_summary(session_id)
|
| 219 |
+
return {
|
| 220 |
+
"session_id": session_id,
|
| 221 |
+
"summary": summary,
|
| 222 |
+
"timestamp": datetime.now().isoformat()
|
| 223 |
+
}
|
| 224 |
+
except Exception as e:
|
| 225 |
+
return {
|
| 226 |
+
"error": str(e),
|
| 227 |
+
"session_id": session_id
|
| 228 |
+
}
|
api/routers/medical.py
CHANGED
|
@@ -16,13 +16,17 @@ router = APIRouter(tags=["medical"])
|
|
| 16 |
|
| 17 |
|
| 18 |
@router.get("/ask")
|
| 19 |
-
async def ask(query: str):
|
| 20 |
"""
|
| 21 |
Process a medical query - agent decides which tools to use
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"""
|
| 23 |
try:
|
| 24 |
-
response = await safe_run_agent(user_input=query)
|
| 25 |
-
return {"response": response}
|
| 26 |
|
| 27 |
except Exception as e:
|
| 28 |
raise HTTPException(
|
|
@@ -32,14 +36,18 @@ async def ask(query: str):
|
|
| 32 |
|
| 33 |
|
| 34 |
@router.get("/ask/stream")
|
| 35 |
-
async def ask_stream(query: str):
|
| 36 |
"""
|
| 37 |
Process a medical query with streaming response - agent decides which tools to use
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
"""
|
| 39 |
async def event_stream():
|
| 40 |
try:
|
| 41 |
chunk_buffer = ""
|
| 42 |
-
async for chunk in safe_run_agent_streaming(user_input=query):
|
| 43 |
chunk_buffer += chunk
|
| 44 |
|
| 45 |
# Send chunks in reasonable sizes for smoother streaming
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
@router.get("/ask")
|
| 19 |
+
async def ask(query: str, session_id: str = "default"):
|
| 20 |
"""
|
| 21 |
Process a medical query - agent decides which tools to use
|
| 22 |
+
|
| 23 |
+
Args:
|
| 24 |
+
query: The medical question or query
|
| 25 |
+
session_id: Optional session identifier for conversation continuity (default: "default")
|
| 26 |
"""
|
| 27 |
try:
|
| 28 |
+
response = await safe_run_agent(user_input=query, session_id=session_id)
|
| 29 |
+
return {"response": response, "session_id": session_id}
|
| 30 |
|
| 31 |
except Exception as e:
|
| 32 |
raise HTTPException(
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
@router.get("/ask/stream")
|
| 39 |
+
async def ask_stream(query: str, session_id: str = "default"):
|
| 40 |
"""
|
| 41 |
Process a medical query with streaming response - agent decides which tools to use
|
| 42 |
+
|
| 43 |
+
Args:
|
| 44 |
+
query: The medical question or query
|
| 45 |
+
session_id: Optional session identifier for conversation continuity (default: "default")
|
| 46 |
"""
|
| 47 |
async def event_stream():
|
| 48 |
try:
|
| 49 |
chunk_buffer = ""
|
| 50 |
+
async for chunk in safe_run_agent_streaming(user_input=query, session_id=session_id):
|
| 51 |
chunk_buffer += chunk
|
| 52 |
|
| 53 |
# Send chunks in reasonable sizes for smoother streaming
|
core/__pycache__/agent.cpython-313.pyc
CHANGED
|
Binary files a/core/__pycache__/agent.cpython-313.pyc and b/core/__pycache__/agent.cpython-313.pyc differ
|
|
|
core/__pycache__/tools.cpython-313.pyc
CHANGED
|
Binary files a/core/__pycache__/tools.cpython-313.pyc and b/core/__pycache__/tools.cpython-313.pyc differ
|
|
|
logs/app.log
CHANGED
|
@@ -2573,3 +2573,240 @@ Medicatio...
|
|
| 2573 |
2025-10-13 00:33:57,221 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 15
|
| 2574 |
2025-10-13 00:34:00,069 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2575 |
2025-10-13 00:34:00,070 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 15
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2573 |
2025-10-13 00:33:57,221 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 15
|
| 2574 |
2025-10-13 00:34:00,069 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2575 |
2025-10-13 00:34:00,070 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 15
|
| 2576 |
+
2025-10-13 14:42:16,274 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2577 |
+
2025-10-13 14:42:21,018 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2578 |
+
2025-10-13 14:42:21,019 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2579 |
+
2025-10-13 14:42:21,020 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2580 |
+
2025-10-13 14:42:21,020 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2581 |
+
2025-10-13 14:42:55,735 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2582 |
+
2025-10-13 14:42:55,735 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2583 |
+
2025-10-13 14:42:55,736 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2584 |
+
2025-10-13 14:42:55,736 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2585 |
+
2025-10-13 14:42:55,736 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2586 |
+
2025-10-13 14:42:56,391 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2587 |
+
2025-10-13 14:42:56,412 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2588 |
+
2025-10-13 14:42:56,412 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2589 |
+
2025-10-13 14:42:56,785 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2590 |
+
2025-10-13 14:42:56,786 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2591 |
+
2025-10-13 14:42:56,786 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2592 |
+
2025-10-13 14:42:56,786 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2593 |
+
2025-10-13 14:42:56,786 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2594 |
+
2025-10-13 14:42:58,422 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2595 |
+
2025-10-13 14:42:58,422 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2596 |
+
2025-10-13 14:42:58,422 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2597 |
+
2025-10-13 14:43:37,651 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): what is the role of durvalumab in stage III NSCLC ...
|
| 2598 |
+
2025-10-13 14:43:50,173 - AgenticMedicalRAG - INFO - Performing automatic validation for streaming response...
|
| 2599 |
+
2025-10-13 14:43:51,153 - AgenticMedicalRAG - INFO - Medical answer validator initialized successfully
|
| 2600 |
+
2025-10-13 14:43:51,154 - AgenticMedicalRAG - INFO - GitHub storage initialized for MoazEldsouky/cloud-data-store
|
| 2601 |
+
2025-10-13 14:43:51,861 - AgenticMedicalRAG - INFO - Starting validation for interaction 17
|
| 2602 |
+
2025-10-13 14:44:20,096 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 17
|
| 2603 |
+
2025-10-13 14:44:22,874 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2604 |
+
2025-10-13 14:44:22,876 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 17
|
| 2605 |
+
2025-10-13 14:44:30,302 - AgenticMedicalRAG - INFO - Successfully processed user input: what is the role of durvalumab in stage III NSCLC ...
|
| 2606 |
+
2025-10-14 15:41:24,826 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2607 |
+
2025-10-14 15:44:15,308 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2608 |
+
2025-10-14 15:44:25,960 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2609 |
+
2025-10-14 15:44:27,066 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2610 |
+
2025-10-14 15:44:27,067 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2611 |
+
2025-10-14 15:44:27,068 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2612 |
+
2025-10-14 15:44:27,068 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2613 |
+
2025-10-14 15:44:47,712 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2614 |
+
2025-10-14 15:44:47,713 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2615 |
+
2025-10-14 15:44:47,713 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2616 |
+
2025-10-14 15:44:47,714 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2617 |
+
2025-10-14 15:44:47,714 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2618 |
+
2025-10-14 15:44:48,318 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2619 |
+
2025-10-14 15:44:48,339 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2620 |
+
2025-10-14 15:44:48,339 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2621 |
+
2025-10-14 15:44:48,685 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2622 |
+
2025-10-14 15:44:48,686 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2623 |
+
2025-10-14 15:44:48,686 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2624 |
+
2025-10-14 15:44:48,686 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2625 |
+
2025-10-14 15:44:48,686 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2626 |
+
2025-10-14 15:44:50,143 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2627 |
+
2025-10-14 15:44:50,144 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2628 |
+
2025-10-14 15:44:50,144 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2629 |
+
2025-10-14 15:52:34,092 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What treatment options are available for patients ...
|
| 2630 |
+
2025-10-14 15:52:54,862 - AgenticMedicalRAG - INFO - Successfully processed user input: What treatment options are available for patients ...
|
| 2631 |
+
2025-10-14 15:52:54,864 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2632 |
+
2025-10-14 15:52:55,669 - AgenticMedicalRAG - INFO - Medical answer validator initialized successfully
|
| 2633 |
+
2025-10-14 15:52:55,670 - AgenticMedicalRAG - INFO - GitHub storage initialized for MoazEldsouky/cloud-data-store
|
| 2634 |
+
2025-10-14 15:52:56,501 - AgenticMedicalRAG - INFO - Starting validation for interaction 25
|
| 2635 |
+
2025-10-14 15:53:14,642 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 25
|
| 2636 |
+
2025-10-14 15:53:18,303 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2637 |
+
2025-10-14 15:53:18,304 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 25
|
| 2638 |
+
2025-10-14 15:57:28,040 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What is the recommended first-line treatment for a...
|
| 2639 |
+
2025-10-14 15:57:39,962 - AgenticMedicalRAG - INFO - Successfully processed user input: What is the recommended first-line treatment for a...
|
| 2640 |
+
2025-10-14 15:57:39,962 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2641 |
+
2025-10-14 15:57:41,597 - AgenticMedicalRAG - INFO - Starting validation for interaction 26
|
| 2642 |
+
2025-10-14 15:57:56,133 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 26
|
| 2643 |
+
2025-10-14 15:57:59,592 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2644 |
+
2025-10-14 15:57:59,594 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 26
|
| 2645 |
+
2025-10-14 15:58:21,176 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): what is the time and date now?...
|
| 2646 |
+
2025-10-14 15:58:24,707 - AgenticMedicalRAG - INFO - Successfully processed user input: what is the time and date now?...
|
| 2647 |
+
2025-10-14 16:46:55,870 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2648 |
+
2025-10-14 16:46:57,972 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2649 |
+
2025-10-14 16:46:57,973 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2650 |
+
2025-10-14 16:46:57,974 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2651 |
+
2025-10-14 16:46:57,974 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2652 |
+
2025-10-14 16:47:09,402 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2653 |
+
2025-10-14 16:47:09,403 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2654 |
+
2025-10-14 16:47:09,403 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2655 |
+
2025-10-14 16:47:09,404 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2656 |
+
2025-10-14 16:47:09,404 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2657 |
+
2025-10-14 16:47:09,613 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2658 |
+
2025-10-14 16:47:09,639 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2659 |
+
2025-10-14 16:47:09,640 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2660 |
+
2025-10-14 16:47:10,145 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2661 |
+
2025-10-14 16:47:10,146 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2662 |
+
2025-10-14 16:47:10,146 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2663 |
+
2025-10-14 16:47:10,147 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2664 |
+
2025-10-14 16:47:10,147 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2665 |
+
2025-10-14 16:47:11,616 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2666 |
+
2025-10-14 16:47:11,616 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2667 |
+
2025-10-14 16:47:11,616 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2668 |
+
2025-10-14 17:11:09,277 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): i found that Afinitor has these side effects fever...
|
| 2669 |
+
2025-10-14 17:11:24,127 - AgenticMedicalRAG - INFO - GitHub storage initialized for MoazEldsouky/cloud-data-store
|
| 2670 |
+
2025-10-14 17:11:25,676 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/side_effects_reports.csv to GitHub
|
| 2671 |
+
2025-10-14 17:11:30,459 - AgenticMedicalRAG - INFO - Successfully processed user input: i found that Afinitor has these side effects fever...
|
| 2672 |
+
2025-10-14 17:14:22,599 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What is the role of durvalumab in stage III NSCLC ...
|
| 2673 |
+
2025-10-14 17:14:31,615 - AgenticMedicalRAG - INFO - Successfully processed user input: What is the role of durvalumab in stage III NSCLC ...
|
| 2674 |
+
2025-10-14 17:14:31,616 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2675 |
+
2025-10-14 17:14:32,474 - AgenticMedicalRAG - INFO - Medical answer validator initialized successfully
|
| 2676 |
+
2025-10-14 17:14:33,302 - AgenticMedicalRAG - INFO - Starting validation for interaction 27
|
| 2677 |
+
2025-10-14 17:14:42,646 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 27
|
| 2678 |
+
2025-10-14 17:14:46,267 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2679 |
+
2025-10-14 17:14:46,268 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 27
|
| 2680 |
+
2025-10-14 17:15:47,430 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What is the role of durvalumab in stage III NSCLC ...
|
| 2681 |
+
2025-10-14 17:15:56,194 - AgenticMedicalRAG - INFO - Successfully processed user input: What is the role of durvalumab in stage III NSCLC ...
|
| 2682 |
+
2025-10-14 17:15:56,195 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2683 |
+
2025-10-14 17:15:56,966 - AgenticMedicalRAG - INFO - Starting validation for interaction 28
|
| 2684 |
+
2025-10-14 17:16:14,221 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 28
|
| 2685 |
+
2025-10-14 17:16:17,925 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2686 |
+
2025-10-14 17:16:17,927 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 28
|
| 2687 |
+
2025-10-14 17:17:13,852 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What is the role of durvalumab in stage III NSCLC ...
|
| 2688 |
+
2025-10-14 17:17:26,624 - AgenticMedicalRAG - INFO - Successfully processed user input: What is the role of durvalumab in stage III NSCLC ...
|
| 2689 |
+
2025-10-14 17:17:26,625 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2690 |
+
2025-10-14 17:17:27,540 - AgenticMedicalRAG - INFO - Starting validation for interaction 29
|
| 2691 |
+
2025-10-14 17:17:40,773 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 29
|
| 2692 |
+
2025-10-14 17:17:45,417 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2693 |
+
2025-10-14 17:17:45,417 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 29
|
| 2694 |
+
2025-10-14 18:07:09,416 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2695 |
+
2025-10-14 18:07:11,854 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2696 |
+
2025-10-14 18:07:11,855 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2697 |
+
2025-10-14 18:07:11,856 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2698 |
+
2025-10-14 18:07:11,856 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2699 |
+
2025-10-14 18:07:25,095 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2700 |
+
2025-10-14 18:07:25,096 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2701 |
+
2025-10-14 18:07:25,096 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2702 |
+
2025-10-14 18:07:25,096 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2703 |
+
2025-10-14 18:07:25,097 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2704 |
+
2025-10-14 18:07:25,521 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2705 |
+
2025-10-14 18:07:25,558 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2706 |
+
2025-10-14 18:07:25,559 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2707 |
+
2025-10-14 18:07:25,780 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2708 |
+
2025-10-14 18:07:25,780 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2709 |
+
2025-10-14 18:07:25,780 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2710 |
+
2025-10-14 18:07:25,781 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2711 |
+
2025-10-14 18:07:25,781 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2712 |
+
2025-10-14 18:07:26,711 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2713 |
+
2025-10-14 18:07:26,711 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2714 |
+
2025-10-14 18:07:26,711 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2715 |
+
2025-10-14 18:08:59,424 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What is the role of durvalumab in stage III NSCLC ...
|
| 2716 |
+
2025-10-14 18:09:12,456 - AgenticMedicalRAG - INFO - Successfully processed user input: What is the role of durvalumab in stage III NSCLC ...
|
| 2717 |
+
2025-10-14 18:09:12,456 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2718 |
+
2025-10-14 18:09:13,022 - AgenticMedicalRAG - INFO - Medical answer validator initialized successfully
|
| 2719 |
+
2025-10-14 18:09:13,023 - AgenticMedicalRAG - INFO - GitHub storage initialized for MoazEldsouky/cloud-data-store
|
| 2720 |
+
2025-10-14 18:09:13,856 - AgenticMedicalRAG - INFO - Starting validation for interaction 30
|
| 2721 |
+
2025-10-14 18:09:25,009 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 30
|
| 2722 |
+
2025-10-14 18:09:29,260 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2723 |
+
2025-10-14 18:09:29,261 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 30
|
| 2724 |
+
2025-10-14 18:13:13,136 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2725 |
+
2025-10-14 18:13:13,726 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2726 |
+
2025-10-14 18:13:13,727 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2727 |
+
2025-10-14 18:13:13,727 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2728 |
+
2025-10-14 18:13:13,728 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2729 |
+
2025-10-14 18:13:20,825 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2730 |
+
2025-10-14 18:13:20,826 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2731 |
+
2025-10-14 18:13:20,826 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2732 |
+
2025-10-14 18:13:20,826 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2733 |
+
2025-10-14 18:13:20,827 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2734 |
+
2025-10-14 18:13:20,942 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2735 |
+
2025-10-14 18:13:20,970 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2736 |
+
2025-10-14 18:13:20,971 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2737 |
+
2025-10-14 18:13:21,226 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2738 |
+
2025-10-14 18:13:21,229 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2739 |
+
2025-10-14 18:13:21,229 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2740 |
+
2025-10-14 18:13:21,230 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2741 |
+
2025-10-14 18:13:21,230 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2742 |
+
2025-10-14 18:13:22,021 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2743 |
+
2025-10-14 18:13:22,021 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2744 |
+
2025-10-14 18:13:22,022 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2745 |
+
2025-10-14 18:19:54,449 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi my name is moaz...
|
| 2746 |
+
2025-10-14 18:19:56,100 - AgenticMedicalRAG - INFO - Successfully processed user input: hi my name is moaz...
|
| 2747 |
+
2025-10-14 18:20:13,594 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): do you know my name...
|
| 2748 |
+
2025-10-14 18:20:33,954 - AgenticMedicalRAG - INFO - Successfully processed user input: do you know my name...
|
| 2749 |
+
2025-10-14 18:21:23,761 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi do you remember me...
|
| 2750 |
+
2025-10-14 18:21:25,571 - AgenticMedicalRAG - INFO - Successfully processed user input: hi do you remember me...
|
| 2751 |
+
2025-10-14 18:21:36,506 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi do you remember me...
|
| 2752 |
+
2025-10-14 18:21:37,983 - AgenticMedicalRAG - INFO - Successfully processed user input: hi do you remember me...
|
| 2753 |
+
2025-10-14 18:21:37,983 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2754 |
+
2025-10-14 18:21:37,983 - AgenticMedicalRAG - INFO - Skipping validation: insufficient context
|
| 2755 |
+
2025-10-14 18:21:46,097 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi do you remember me...
|
| 2756 |
+
2025-10-14 18:21:48,641 - AgenticMedicalRAG - INFO - Successfully processed user input: hi do you remember me...
|
| 2757 |
+
2025-10-14 18:21:48,642 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2758 |
+
2025-10-14 18:21:48,642 - AgenticMedicalRAG - INFO - Skipping validation: insufficient context
|
| 2759 |
+
2025-10-14 18:22:02,691 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi do you remember my name...
|
| 2760 |
+
2025-10-14 18:22:05,972 - AgenticMedicalRAG - INFO - Successfully processed user input: hi do you remember my name...
|
| 2761 |
+
2025-10-14 18:22:13,839 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi do you remember my name...
|
| 2762 |
+
2025-10-14 18:22:15,210 - AgenticMedicalRAG - INFO - Successfully processed user input: hi do you remember my name...
|
| 2763 |
+
2025-10-14 18:30:40,859 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2764 |
+
2025-10-14 18:30:41,470 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2765 |
+
2025-10-14 18:30:41,471 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2766 |
+
2025-10-14 18:30:41,471 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2767 |
+
2025-10-14 18:30:41,472 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2768 |
+
2025-10-14 18:30:47,951 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2769 |
+
2025-10-14 18:30:47,951 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2770 |
+
2025-10-14 18:30:47,952 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2771 |
+
2025-10-14 18:30:47,952 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2772 |
+
2025-10-14 18:30:47,952 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2773 |
+
2025-10-14 18:30:48,087 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2774 |
+
2025-10-14 18:30:48,130 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2775 |
+
2025-10-14 18:30:48,130 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2776 |
+
2025-10-14 18:30:48,496 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2777 |
+
2025-10-14 18:30:48,496 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2778 |
+
2025-10-14 18:30:48,497 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2779 |
+
2025-10-14 18:30:48,497 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2780 |
+
2025-10-14 18:30:48,497 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2781 |
+
2025-10-14 18:30:49,846 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2782 |
+
2025-10-14 18:30:49,847 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2783 |
+
2025-10-14 18:30:49,847 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2784 |
+
2025-10-14 19:12:36,297 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2785 |
+
2025-10-14 19:12:37,463 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2786 |
+
2025-10-14 19:12:37,464 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2787 |
+
2025-10-14 19:12:37,465 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2788 |
+
2025-10-14 19:12:37,465 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2789 |
+
2025-10-14 19:12:45,905 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2790 |
+
2025-10-14 19:12:45,906 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2791 |
+
2025-10-14 19:12:45,906 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2792 |
+
2025-10-14 19:12:45,906 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2793 |
+
2025-10-14 19:12:45,907 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2794 |
+
2025-10-14 19:12:46,025 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2795 |
+
2025-10-14 19:12:46,051 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2796 |
+
2025-10-14 19:12:46,051 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2797 |
+
2025-10-14 19:12:46,449 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2798 |
+
2025-10-14 19:12:46,450 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2799 |
+
2025-10-14 19:12:46,450 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2800 |
+
2025-10-14 19:12:46,450 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2801 |
+
2025-10-14 19:12:46,451 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2802 |
+
2025-10-14 19:12:47,787 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2803 |
+
2025-10-14 19:12:47,787 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2804 |
+
2025-10-14 19:12:47,788 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2805 |
+
2025-10-14 19:13:02,096 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi my name is moaz...
|
| 2806 |
+
2025-10-14 19:13:03,999 - AgenticMedicalRAG - INFO - Successfully processed user input: hi my name is moaz...
|
| 2807 |
+
2025-10-14 19:13:12,770 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): what is my name...
|
| 2808 |
+
2025-10-14 19:13:14,884 - AgenticMedicalRAG - INFO - Performing automatic validation for streaming response...
|
| 2809 |
+
2025-10-14 19:13:14,885 - AgenticMedicalRAG - INFO - Skipping validation: insufficient context
|
| 2810 |
+
2025-10-14 19:13:14,886 - AgenticMedicalRAG - INFO - Successfully processed user input: what is my name...
|
| 2811 |
+
2025-10-14 19:13:24,367 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): hi what is my name...
|
| 2812 |
+
2025-10-14 19:13:26,466 - AgenticMedicalRAG - INFO - Successfully processed user input: hi what is my name...
|