Files
t6_mem0/debug_vecs_naming.py
Docker Config Backup 7e3ba093c4 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>
2025-07-31 13:40:31 +02:00

79 lines
2.9 KiB
Python

#!/usr/bin/env python3
"""
Debug vecs library collection naming
"""
import vecs
import traceback
def debug_vecs_naming():
"""Debug the vecs collection naming issue"""
print("=" * 60)
print("VECS COLLECTION NAMING DEBUG")
print("=" * 60)
connection_string = "postgresql://supabase_admin:CzkaYmRvc26Y@localhost:5435/postgres"
try:
print("🔌 Connecting to database...")
db = vecs.create_client(connection_string)
print("✅ Connected successfully")
print("\n📋 Listing existing collections...")
collections = db.list_collections()
print(f"Existing collections: {collections}")
# Test different collection names
test_names = [
"mem0_vectors",
"mem0_working_test",
"simple_test",
"test123",
"debugtest"
]
for name in test_names:
print(f"\n🧪 Testing collection name: '{name}'")
try:
# Try to get or create collection
collection = db.get_or_create_collection(name=name, dimension=128)
print(f" ✅ Created/Retrieved: {collection.name}")
# Check actual table name in database
print(f" 📊 Collection info: {collection.describe()}")
# Clean up test collection
db.delete_collection(name)
print(f" 🗑️ Cleaned up collection: {name}")
except Exception as e:
print(f" ❌ Failed: {str(e)}")
print(f" Error type: {type(e).__name__}")
if "DuplicateTable" in str(e):
print(f" 🔍 Table already exists, examining error...")
# Extract the actual table name from error
error_str = str(e)
if 'relation "' in error_str:
start = error_str.find('relation "') + len('relation "')
end = error_str.find('" already exists', start)
if end > start:
actual_table = error_str[start:end]
print(f" 📋 Actual table name attempted: {actual_table}")
print("\n🔍 Checking database schema for existing tables...")
# Connect directly to check tables
import psycopg2
conn = psycopg2.connect("postgresql://supabase_admin:CzkaYmRvc26Y@localhost:5435/postgres")
cur = conn.cursor()
cur.execute("SELECT table_name FROM information_schema.tables WHERE table_schema = 'vecs';")
tables = cur.fetchall()
print(f"Tables in 'vecs' schema: {[t[0] for t in tables]}")
cur.close()
conn.close()
except Exception as e:
print(f"❌ Debug failed: {str(e)}")
traceback.print_exc()
if __name__ == "__main__":
debug_vecs_naming()