feat: add conversation persistence and context management layer
- SQLAlchemy async database layer (SQLite dev, PostgreSQL prod) - Conversation and Message models with UUID primary keys - Token counting utilities using litellm - Context summarization at 80% token threshold - REST API endpoints for multi-turn conversations - 19 conversation tests, 6 token tests (176 total passing) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,9 +80,15 @@ class Settings(BaseSettings):
|
||||
sandbox_enabled: bool = True
|
||||
allowed_paths: list[str] | None = None
|
||||
|
||||
# Sessions
|
||||
# Database
|
||||
database_url: str = "sqlite+aiosqlite:///./webber.db"
|
||||
|
||||
# Sessions & Context
|
||||
session_ttl_hours: int = 24
|
||||
max_context_tokens: int = 128000
|
||||
summarization_threshold: float = 0.8 # Summarize at 80% of max tokens
|
||||
summarization_target_tokens: int = 500 # Target summary size
|
||||
keep_recent_messages: int = 6 # Messages to keep unsummarized (3 turns)
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
|
||||
Reference in New Issue
Block a user