File size: 1,131 Bytes
5e0532d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
import asyncio
import os
from app.services.bible import bible_service

async def main():
    print("=== ORA RAG Verification (LanceDB) ===")
    
    # Check DB Path
    db_path = "data/lancedb_storage"
    if os.path.exists(db_path):
        print(f"[OK] LanceDB storage found at: {db_path}")
    else:
        print(f"[WARN] LanceDB storage NOT found at: {db_path} (Expected if ingestion is running/incomplete)")

    print("1. Initializing Service (Connecting locally)...")
    await bible_service.initialize_index()
    
    # Search for a common term
    query = "Seth"
    print(f"\n2. Searching for '{query}'...")
    results = await bible_service.search(query)
    
    print(f"   -> Found {len(results)} results.")
    for idx, res in enumerate(results):
         print(f"   {idx+1}. {res['reference']} (Score: {res['score']:.4f})")
         print(f"      \"{res['text'][:100]}...\"")

    if results:
        print("\n[SUCCESS] RAG System is operational with LanceDB.")
    else:
        print("\n[FAIL] No results returned. Check embedding service or DB population.")

if __name__ == "__main__":
    asyncio.run(main())