File size: 891 Bytes
ad06665
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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()