step-6: add memory models and migration (models.py, alembic)

- User.encryption_key: per-user Fernet key generated on registration
- MemoryCore: encrypted key/value preferences
- MemoryAssociative: encrypted semantic memory + pgvector(1536) embedding
- MemoryEpisodic: encrypted session summaries
- MemoryProactive: encrypted behavioral patterns with confidence score
- Migration 004: enables pgvector extension, creates all 4 tables + ivfflat index
- auth.py register: generates Fernet key for new users
- 8 unit tests pass (SQLite in-memory, JSON embedding fallback)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 22:05:58 +01:00
parent 76c8f2bdad
commit c90ed58078
5 changed files with 449 additions and 1 deletions

View File

@@ -285,7 +285,7 @@ pytest tests/test_memory_models.py
```
**Status**:
- [ ] Step 6 complete
- [x] Step 6 complete
**Commit**: After tests pass, commit with:
```