Scaffold all modules, route stubs, data models, and config. No logic implemented yet — all core methods raise NotImplementedError. Establishes the full directory layout matching the architecture in CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
"""
|
|
Memory store — SQLite-backed persistence for cross-session memory.
|
|
Only active when a session is created with memory: new or memory: inherit:<token>.
|
|
"""
|
|
|
|
import logging
|
|
from typing import Optional
|
|
|
|
import aiosqlite
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
DB_PATH = "fellowship_memory.db"
|
|
|
|
|
|
class MemoryStore:
|
|
def __init__(self, db_path: str = DB_PATH) -> None:
|
|
self.db_path = db_path
|
|
|
|
async def init(self) -> None:
|
|
"""Create tables if they don't exist. Call once at startup."""
|
|
raise NotImplementedError
|
|
|
|
async def save(self, session_token: str, memory: str) -> None:
|
|
"""Persist a memory string for the given session token."""
|
|
raise NotImplementedError
|
|
|
|
async def load(self, session_token: str) -> Optional[str]:
|
|
"""Load the stored memory for the given session token, or None if absent."""
|
|
raise NotImplementedError
|
|
|
|
async def delete(self, session_token: str) -> None:
|
|
"""Delete memory for a session."""
|
|
raise NotImplementedError
|