Spaces:
Running
Running
| """ | |
| Database Connection | |
| """ | |
| from pymongo import MongoClient | |
| from pymongo.server_api import ServerApi | |
| import os | |
| MONGO_URI = os.getenv("MONGO_URI", "") | |
| mongo_client = MongoClient(MONGO_URI, server_api=ServerApi("1")) | |
| mongo_db = mongo_client["neuraprompt"] | |
| # Export collections | |
| long_term_memory_col = mongo_db["long_term_memory"] | |
| chat_history_col = mongo_db["chat_history"] | |
| user_personas_col = mongo_db["user_personas"] | |
| subscriptions_col = mongo_db["subscriptions"] | |
| images_col = mongo_db["user_images"] | |
| downloads_col = mongo_db["file_downloads"] | |
| learning_paths_col = mongo_db["learning_paths"] | |
| email_notifications_col = mongo_db["email_notifications"] | |
| fs = None # GridFS if needed later |