import faiss

index_path = "my_embeddings"  # Adjust if saved elsewhere

try:
    index = faiss.read_index(index_path)
    print(f"📊 FAISS index contains {index.ntotal} vectors.")
    
    # ✅ Check embedding dimensions
    d = index.d
    print(f"✅ Embedding dimension: {d}")
    
    # ✅ Retrieve and print a few embeddings
    if index.ntotal > 0:
        vectors = index.reconstruct_n(0, min(5, index.ntotal))  # Get first 5 embeddings
        print(f"🧐 Sample embeddings: {vectors}")
    else:
        print("⚠️ No embeddings found in FAISS index!")

except Exception as e:
    print(f"❌ ERROR: Failed to load FAISS index - {e}")