Files
Apple 3b924118be fix: quarantine dead brand commands + implement Memory LLM summary
Brand commands (~290 lines):
- Code was trapped inside `if reply_to_message:` block (unreachable)
- Moved to feature flag: ENABLE_BRAND_COMMANDS=true to activate
- Zero re-indentation: 8sp code naturally fits as feature flag body
- Helper functions (_brand_*, _artifact_*) unchanged

Memory LLM Summary:
- Replace placeholder with real DeepSeek API integration
- Structured output: summary, goals, decisions, open_questions, next_steps, key_facts
- Graceful fallback if API key not set or call fails
- Added MEMORY_DEEPSEEK_API_KEY config
- Ukrainian output language

Deployed and verified on NODE1.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 09:42:44 -08:00

68 lines
2.0 KiB
Python

"""
DAARION Memory Service Configuration
"""
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Application settings"""
# Service
service_name: str = "memory-service"
debug: bool = False
# PostgreSQL
postgres_host: str = "daarion-pooler.daarion"
postgres_port: int = 5432
postgres_user: str = "daarion"
postgres_password: str = "DaarionDB2026!"
postgres_db: str = "daarion_main"
@property
def postgres_url(self) -> str:
return f"postgresql+asyncpg://{self.postgres_user}:{self.postgres_password}@{self.postgres_host}:{self.postgres_port}/{self.postgres_db}"
# Qdrant
qdrant_host: str = "qdrant.qdrant"
qdrant_port: int = 6333
qdrant_collection_memories: str = "memories"
qdrant_collection_messages: str = "messages"
# Cohere (embeddings)
cohere_api_key: str = "" # Must be set via MEMORY_COHERE_API_KEY env var or Vault
cohere_model: str = "embed-multilingual-v3.0" # 1024 dimensions
embedding_dimensions: int = 1024
# DeepSeek LLM (for summary generation)
deepseek_api_key: str = "" # Must be set via MEMORY_DEEPSEEK_API_KEY env var
deepseek_api_url: str = "https://api.deepseek.com/v1/chat/completions"
deepseek_model: str = "deepseek-chat"
summary_max_tokens: int = 800
# Memory settings
short_term_window_messages: int = 20
short_term_window_minutes: int = 60
summary_trigger_tokens: int = 4000
summary_target_tokens: int = 500
retrieval_top_k: int = 10
# Confidence thresholds
memory_min_confidence: float = 0.5
memory_confirm_boost: float = 0.1
memory_reject_penalty: float = 0.3
# JWT Auth
jwt_secret: str = "" # Must be set via MEMORY_JWT_SECRET env var or Vault
jwt_algorithm: str = "HS256"
jwt_expiration: int = 3600 # 1 година
class Config:
env_prefix = "MEMORY_"
env_file = ".env"
@lru_cache()
def get_settings() -> Settings:
return Settings()