"""SQLite database with RAG support for chat history and embeddings. Facade for the ``vibe_bot.db`` package; re-exports the public names so imports of ``vibe_bot.database`` keep working unchanged. """ from __future__ import annotations from vibe_bot.db.bots import CustomBotManager from vibe_bot.db.messages import ChatDatabase from vibe_bot.db.timing import IMAGE_GEN_TIME_LIMIT, IMAGE_GEN_TIME_WINDOW __all__ = [ "IMAGE_GEN_TIME_LIMIT", "IMAGE_GEN_TIME_WINDOW", "ChatDatabase", "CustomBotManager", "get_database", ] # Global database instance _chat_db: ChatDatabase | None = None def get_database() -> ChatDatabase: """Get or create the global database instance.""" global _chat_db if _chat_db is None: _chat_db = ChatDatabase() return _chat_db