31 lines
931 B
Python
31 lines
931 B
Python
import sqlite3
|
|
from pathlib import Path
|
|
|
|
db_path = Path.home() / '.openclaw' / 'memory.db'
|
|
if db_path.exists():
|
|
conn = sqlite3.connect(str(db_path))
|
|
cursor = conn.cursor()
|
|
|
|
# Get embedding count
|
|
cursor.execute("SELECT COUNT(*) FROM memory_embeddings")
|
|
count = cursor.fetchone()[0]
|
|
print(f"[OK] Vector embeddings: {count}")
|
|
|
|
# Get recent entries
|
|
cursor.execute("SELECT COUNT(*) FROM memory_entries")
|
|
entries = cursor.fetchone()[0]
|
|
print(f"[OK] Memory entries: {entries}")
|
|
|
|
# Check DB size
|
|
size_kb = db_path.stat().st_size / 1024
|
|
print(f"[OK] DB size: {size_kb:.1f} KB")
|
|
|
|
# Show recent embeddings
|
|
cursor.execute("SELECT source_path, created_at FROM memory_embeddings ORDER BY created_at DESC LIMIT 5")
|
|
print("\nRecent embeddings:")
|
|
for row in cursor.fetchall():
|
|
print(f" - {row[0]} ({row[1]})")
|
|
|
|
conn.close()
|
|
else:
|
|
print("[ERR] Database not found") |