From 43a21342a36d0624fd4c73e2c598c340aa5e6ee9 Mon Sep 17 00:00:00 2001 From: Boris Date: Fri, 18 Jul 2025 17:56:08 +0200 Subject: [PATCH] fix: anonymous id as env var (#1106) ## Description ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --- cognee/shared/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cognee/shared/utils.py b/cognee/shared/utils.py index 709d0a0de..8b0c26949 100644 --- a/cognee/shared/utils.py +++ b/cognee/shared/utils.py @@ -54,6 +54,11 @@ def extract_pos_tags(sentence): def get_anonymous_id(): """Creates or reads a anonymous user id""" + tracking_id = os.getenv("TRACKING_ID", None) + + if tracking_id: + return tracking_id + home_dir = str(pathlib.Path(pathlib.Path(__file__).parent.parent.parent.resolve())) if not os.path.isdir(home_dir):