Add PostgreSQL memory system for persistent user and conversation storage

- Add PostgreSQL database with SQLAlchemy async support
- Create models: User, UserFact, UserPreference, Conversation, Message, Guild, GuildMember
- Add custom name support so bot knows 'who is who'
- Add user facts system for remembering things about users
- Add persistent conversation history that survives restarts
- Add memory commands cog (!setname, !remember, !whatdoyouknow, !forgetme)
- Add admin commands (!setusername, !teachbot)
- Set up Alembic for database migrations
- Update docker-compose with PostgreSQL service
- Gracefully falls back to in-memory storage when DB not configured
This commit is contained in:
2026-01-12 14:00:06 +01:00
parent 853e7c9fcd
commit e00d4fd501
20 changed files with 1623 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
"""Database models."""
from .base import Base
from .conversation import Conversation, Message
from .guild import Guild, GuildMember
from .user import User, UserFact, UserPreference
__all__ = [
"Base",
"Conversation",
"Guild",
"GuildMember",
"Message",
"User",
"UserFact",
"UserPreference",
]