| import sys | |
| import os | |
| import psutil | |
| from pathlib import Path | |
| # Add project root to path | |
| sys.path.append(str(Path(__file__).parent.parent)) | |
| from src.rag_engine import SatelliteRAG | |
| def check_mem(): | |
| process = psutil.Process(os.getpid()) | |
| return process.memory_info().rss / 1024 / 1024 | |
| def test_query(): | |
| print(f"1. Initial Memory: {check_mem():.2f} MB") | |
| print("\n2. Initializing Engine...") | |
| engine = SatelliteRAG() | |
| print(f" Post-Init Memory: {check_mem():.2f} MB") | |
| print("\n3. Running Query...") | |
| try: | |
| response, docs = engine.query("What is the resolution of Gaofen 1?") | |
| print(f"\n✅ Query Success!") | |
| print(f"Response snippet: {response[:100]}...") | |
| print(f"Docs retrieved: {len(docs)}") | |
| except Exception as e: | |
| print(f"\n❌ Query Failed: {e}") | |
| raise e | |
| if __name__ == "__main__": | |
| test_query() | |