#!/usr/bin/env python3
"""Check what memories exist in Qdrant and their metadata"""

from qdrant_client import QdrantClient

QDRANT_HOST = "localhost"
QDRANT_PORT = 6333
COLLECTION_NAME = "episodic"

client = QdrantClient(host=QDRANT_HOST, port=QDRANT_PORT, timeout=10, prefer_grpc=False)

print("=" * 70)
print("MEMORY INSPECTION")
print("=" * 70)

# Get all memories
results, next_offset = client.scroll(
    collection_name=COLLECTION_NAME,
    limit=20,
    with_payload=True,
    with_vectors=False
)

print(f"\n📊 Total memories found: {len(results)}")

for i, point in enumerate(results, 1):
    print(f"\n--- Memory {i} ---")
    print(f"ID: {point.id}")
    print(f"Content: {point.payload.get('page_content', '')[:100]}")
    print(f"Metadata: {point.payload.get('metadata', {})}")
