Files
microdao-daarion/services/memory-service/app/config.py
Apple 90758facae 🧠 Add Agent Memory System with PostgreSQL + Qdrant + Cohere
Features:
- Three-tier memory architecture (short/mid/long-term)
- PostgreSQL schema for conversations, events, memories
- Qdrant vector database for semantic search
- Cohere embeddings (embed-multilingual-v3.0, 1024 dims)
- FastAPI Memory Service with full CRUD
- External Secrets integration with Vault
- Kubernetes deployment manifests

Components:
- infrastructure/database/agent-memory-schema.sql
- infrastructure/kubernetes/apps/qdrant/
- infrastructure/kubernetes/apps/memory-service/
- services/memory-service/ (FastAPI app)

Also includes:
- External Secrets Operator
- Traefik Ingress Controller
- Cert-Manager with Let's Encrypt
- ArgoCD for GitOps
2026-01-10 07:52:32 -08:00

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 = "nOdOXnuepLku2ipJWpe6acWgAsJCsDhMO0RnaEJB"
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()