""" Centralized project configuration. The single place where the following are defined: artifact paths, model names, search parameters and session constants. All other modules import from here, avoiding hardcoded values scattered throughout the code. """ import os from dotenv import load_dotenv # Load environment variables from .env (API keys) load_dotenv() # --- Project Paths --- # Goes up two levels: utils/config.py → utils/ → project root PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # --- Artifact Paths --- ARTIFACTS_DIR = os.path.join(PROJECT_ROOT, "artifacts") FAISS_PRODUCT_INDEX = os.path.join(ARTIFACTS_DIR, "faiss_products") # FAISS catalog index (100k products) FAISS_ROUTER_INDEX = os.path.join(ARTIFACTS_DIR, "faiss_router") # FAISS router index (few-shot examples) RECOMMENDER_MODEL_PATH = os.path.join(ARTIFACTS_DIR, "recommender_model.pkl") # Hybrid LightFM model METADATA_PATH = os.path.join(ARTIFACTS_DIR, "metadata_cleaned.json") # Product metadata (ASIN, title, price, etc.) IMAGES_DIR = os.path.join(ARTIFACTS_DIR, "images") # Product images downloaded from Amazon FAISS_VISUAL_INDEX = os.path.join(ARTIFACTS_DIR, "faiss_visual") # FAISS visual embedding index (DinoV2 256d) # --- Models --- EMBEDDING_MODEL_NAME = "paraphrase-multilingual-MiniLM-L12-v2" # Multilingual sentence-transformer (IT/EN same vector space) LLM_MODEL_NAME = "gpt-4o-mini" # LLM for router, translation and responses LLM_TEMPERATURE = 0 # Deterministic (no variability) VISUAL_MODEL_NAME = "Trendyol/trendyol-dino-v2-ecommerce-256d" # DinoV2 fine-tuned for e-commerce (256d) # --- Response Language --- # Language of the bot's user-facing replies: "en" (default) or "it". # Input queries are accepted in ANY language and translated to English internally # for retrieval — this setting only controls the OUTPUT language. See utils/i18n.py. RESPONSE_LANG = os.getenv("RESPONSE_LANG", "en") # --- Search Parameters --- PRODUCT_SEARCH_K = 12 # How many products the Search Agent returns (3 rows of 4) RECOMMENDER_K = 8 # How many products the Recommender Agent recommends ROUTER_SEARCH_K = 15 # How many few-shot examples for distance-weighted kNN voting VISUAL_SEARCH_K = 8 # How many visually similar products the Visual Agent returns # --- Session --- DEFAULT_THREAD_ID = "memorysaver_id" # Session ID for LangGraph's MemorySaver