Some checks failed
Build and Deploy Docs / build-and-deploy (push) Has been cancelled
- Видалено всі паролі та API ключі з документів - Замінено на посилання на Vault - Закрито NodePort для Memory Service (тільки internal) - Створено SECURITY-ROTATION-PLAN.md - Створено ARCHITECTURE-150-NODES.md (план для 150 нод) - Оновлено config.py (видалено hardcoded Cohere key)
57 lines
1.6 KiB
Python
57 lines
1.6 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
|
|
|
|
# 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
|
|
|
|
class Config:
|
|
env_prefix = "MEMORY_"
|
|
env_file = ".env"
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|