PHASE 1 COMPLETE: mem0 + Supabase integration tested and working
✅ PHASE 1 ACHIEVEMENTS: - Successfully migrated from Qdrant to self-hosted Supabase - Fixed mem0 Supabase integration collection naming issues - Resolved vector dimension mismatches (1536→768 for Ollama) - All containers connected to localai docker network - Comprehensive documentation updates completed ✅ TESTING COMPLETED: - Database storage verification: Data properly stored in PostgreSQL - Vector operations: 768-dimensional embeddings working perfectly - Memory operations: Add, search, retrieve, delete all functional - Multi-user support: User isolation verified - LLM integration: Ollama qwen2.5:7b + nomic-embed-text operational - Search functionality: Semantic search with relevance scores working ✅ INFRASTRUCTURE READY: - Supabase PostgreSQL with pgvector: ✅ OPERATIONAL - Neo4j graph database: ✅ READY (for Phase 2) - Ollama LLM + embeddings: ✅ WORKING - mem0 v0.1.115: ✅ FULLY FUNCTIONAL PHASE 2 READY: Core memory system and API development can begin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
95
debug_mem0migrations.py
Normal file
95
debug_mem0migrations.py
Normal file
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Debug mem0migrations table issue
|
||||
"""
|
||||
|
||||
import psycopg2
|
||||
import vecs
|
||||
|
||||
def debug_mem0migrations():
|
||||
"""Debug the mem0migrations table issue"""
|
||||
print("=" * 60)
|
||||
print("MEM0MIGRATIONS TABLE DEBUG")
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
# Connect to database directly
|
||||
conn = psycopg2.connect("postgresql://supabase_admin:CzkaYmRvc26Y@localhost:5435/postgres")
|
||||
cur = conn.cursor()
|
||||
|
||||
print("🔍 Examining mem0migrations table...")
|
||||
|
||||
# Check if table exists
|
||||
cur.execute("""
|
||||
SELECT column_name, data_type, character_maximum_length, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'vecs' AND table_name = 'mem0migrations'
|
||||
ORDER BY ordinal_position;
|
||||
""")
|
||||
columns = cur.fetchall()
|
||||
|
||||
if columns:
|
||||
print("✅ mem0migrations table exists with columns:")
|
||||
for col in columns:
|
||||
print(f" - {col[0]}: {col[1]} (nullable: {col[3]})")
|
||||
|
||||
# Check vector dimension
|
||||
cur.execute("SELECT dimension FROM vecs.mem0migrations LIMIT 1;")
|
||||
try:
|
||||
result = cur.fetchone()
|
||||
if result:
|
||||
print(f" 📏 Vector dimension appears to be configured for: {len(result[0]) if result[0] else 'unknown'}")
|
||||
else:
|
||||
print(" 📏 Table is empty")
|
||||
except Exception as e:
|
||||
print(f" ❌ Cannot determine dimension: {e}")
|
||||
|
||||
# Get record count
|
||||
cur.execute("SELECT COUNT(*) FROM vecs.mem0migrations;")
|
||||
count = cur.fetchone()[0]
|
||||
print(f" 📊 Record count: {count}")
|
||||
|
||||
else:
|
||||
print("❌ mem0migrations table does not exist in vecs schema")
|
||||
|
||||
print("\n🧹 Attempting to clean up corrupted collections...")
|
||||
|
||||
# Connect with vecs
|
||||
connection_string = "postgresql://supabase_admin:CzkaYmRvc26Y@localhost:5435/postgres"
|
||||
db = vecs.create_client(connection_string)
|
||||
|
||||
# Try to delete the problematic collections
|
||||
problematic_collections = ["mem0migrations", "mem0_vectors", "mem0_working_test"]
|
||||
|
||||
for collection_name in problematic_collections:
|
||||
try:
|
||||
print(f" 🗑️ Attempting to delete: {collection_name}")
|
||||
db.delete_collection(collection_name)
|
||||
print(f" ✅ Successfully deleted: {collection_name}")
|
||||
except Exception as e:
|
||||
print(f" ⚠️ Could not delete {collection_name}: {e}")
|
||||
|
||||
# Verify cleanup
|
||||
print("\n📋 Collections after cleanup:")
|
||||
collections = db.list_collections()
|
||||
for col in collections:
|
||||
print(f" - {col.name} (dim: {col.dimension})")
|
||||
|
||||
cur.close()
|
||||
conn.close()
|
||||
|
||||
print("\n🧪 Testing fresh collection creation...")
|
||||
test_collection = db.get_or_create_collection(name="fresh_test", dimension=1536)
|
||||
print(f"✅ Created fresh collection: {test_collection.name}")
|
||||
|
||||
# Clean up test
|
||||
db.delete_collection("fresh_test")
|
||||
print("✅ Cleaned up test collection")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Debug failed: {str(e)}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
if __name__ == "__main__":
|
||||
debug_mem0migrations()
|
||||
Reference in New Issue
Block a user