From 0bf3490d638ba9e1c21783c9162f9ef00be6da26 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Wed, 1 Oct 2025 16:16:06 +0100 Subject: [PATCH 1/9] chore: update cognee-cli to use MCP Docker image from main. Bring back deprecation warnings --- cognee-mcp/pyproject.toml | 3 ++- cognee-mcp/src/__init__.py | 22 +++++++++++++++++++++- cognee/api/v1/ui/ui.py | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cognee-mcp/pyproject.toml b/cognee-mcp/pyproject.toml index e1a3a092c..bf9ecd51f 100644 --- a/cognee-mcp/pyproject.toml +++ b/cognee-mcp/pyproject.toml @@ -36,4 +36,5 @@ dev = [ allow-direct-references = true [project.scripts] -cognee-mcp = "src:main" +cognee = "src:main" +cognee-mcp = "src:main_mcp" \ No newline at end of file diff --git a/cognee-mcp/src/__init__.py b/cognee-mcp/src/__init__.py index 1939efe9f..77d325085 100644 --- a/cognee-mcp/src/__init__.py +++ b/cognee-mcp/src/__init__.py @@ -1,8 +1,28 @@ from .server import main as server_main +import warnings +import sys def main(): - """Main entry point for the package.""" + """Deprecated main entry point for the package.""" + import asyncio + + warnings.warn( + "The 'cognee' command for cognee-mcp is deprecated and will be removed in a future version. " + "Please use 'cognee-mcp' instead to avoid conflicts with the main cognee library.", + DeprecationWarning, + stacklevel=2, + ) + + print("⚠️ DEPRECATION WARNING: Use 'cognee-mcp' command instead of 'cognee'", file=sys.stderr) + print(" This avoids conflicts with the main cognee library.", file=sys.stderr) + print(file=sys.stderr) + + asyncio.run(server_main()) + + +def main_mcp(): + """Clean main entry point for cognee-mcp command.""" import asyncio asyncio.run(server_main()) diff --git a/cognee/api/v1/ui/ui.py b/cognee/api/v1/ui/ui.py index f22a1f00b..f4df0edde 100644 --- a/cognee/api/v1/ui/ui.py +++ b/cognee/api/v1/ui/ui.py @@ -516,7 +516,7 @@ def start_ui( env_file, "-e", "TRANSPORT_MODE=sse", - "cognee/cognee-mcp:daulet-dev", + "cognee/cognee-mcp:main", ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, From dda44b0a4b0e12c8d6b172c83a1ed9387db50632 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Tue, 7 Oct 2025 19:30:25 +0100 Subject: [PATCH 2/9] chore: change `cognee-mcp` deprecation message --- cognee-mcp/src/__init__.py | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/cognee-mcp/src/__init__.py b/cognee-mcp/src/__init__.py index 77d325085..933bcd73f 100644 --- a/cognee-mcp/src/__init__.py +++ b/cognee-mcp/src/__init__.py @@ -7,6 +7,36 @@ def main(): """Deprecated main entry point for the package.""" import asyncio + deprecation_notice = """ +DEPRECATION NOTICE +The CLI entry-point used to start the Cognee MCP service has been renamed from +"cognee" to "cognee-mcp". Calling the old entry-point will stop working in a +future release. + +WHAT YOU NEED TO DO: +Locate every place where you launch the MCP process and replace the final +argument cognee → cognee-mcp. + +For the example mcpServers block from Cursor shown below the change is: +{ + "mcpServers": { + "Cognee": { + "command": "uv", + "args": [ + "--directory", + "/path/to/cognee-mcp", + "run", + "cognee" // <-- CHANGE THIS to "cognee-mcp" + ] + } + } +} + +Continuing to use the old "cognee" entry-point will result in failures once it +is removed, so please update your configuration and any shell scripts as soon +as possible. +""" + warnings.warn( "The 'cognee' command for cognee-mcp is deprecated and will be removed in a future version. " "Please use 'cognee-mcp' instead to avoid conflicts with the main cognee library.", @@ -14,9 +44,8 @@ def main(): stacklevel=2, ) - print("⚠️ DEPRECATION WARNING: Use 'cognee-mcp' command instead of 'cognee'", file=sys.stderr) - print(" This avoids conflicts with the main cognee library.", file=sys.stderr) - print(file=sys.stderr) + print("⚠️ DEPRECATION WARNING", file=sys.stderr) + print(deprecation_notice, file=sys.stderr) asyncio.run(server_main()) From 2b04a35309a9d2a9620d87a19ce833a77795cf31 Mon Sep 17 00:00:00 2001 From: Igor Ilic <30923996+dexters1@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:16:43 +0200 Subject: [PATCH 3/9] chore: Update lock files (#1511) ## Description update lock files ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Other (please specify): ## Screenshots/Videos (if applicable) ## Pre-submission Checklist - [ ] **I have tested my changes thoroughly before submitting this PR** - [ ] **This PR contains minimal changes necessary to address the issue/feature** - [ ] My code follows the project's coding standards and style guidelines - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if applicable) - [ ] All new and existing tests pass - [ ] I have searched existing PRs to ensure this change hasn't been submitted already - [ ] I have linked any relevant issues in the description - [ ] My commits have clear and descriptive messages ## 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. --- poetry.lock | 43 ++----------------------------------------- uv.lock | 46 ++++++++-------------------------------------- 2 files changed, 10 insertions(+), 79 deletions(-) diff --git a/poetry.lock b/poetry.lock index 90b0a609a..551295733 100644 --- a/poetry.lock +++ b/poetry.lock @@ -510,7 +510,7 @@ description = "Timeout context manager for asyncio programs" optional = false python-versions = ">=3.8" groups = ["main"] -markers = "extra == \"falkordb\" and python_full_version < \"3.11.3\" or python_version == \"3.10\"" +markers = "python_version == \"3.10\"" files = [ {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"}, {file = "async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3"}, @@ -2169,23 +2169,6 @@ files = [ [package.extras] tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich ; python_version >= \"3.11\""] -[[package]] -name = "falkordb" -version = "1.2.0" -description = "Python client for interacting with FalkorDB database" -optional = true -python-versions = "<4.0,>=3.8" -groups = ["main"] -markers = "extra == \"falkordb\"" -files = [ - {file = "falkordb-1.2.0-py3-none-any.whl", hash = "sha256:7572d9cc377735d22efc52fe6fe73c7a435422c827b6ea3ca223a850a77be12e"}, - {file = "falkordb-1.2.0.tar.gz", hash = "sha256:ce57365b86722d538e75aa5d438de67ecd8eb9478da612506d9812cd7f182d0b"}, -] - -[package.dependencies] -python-dateutil = ">=2.9.0,<3.0.0" -redis = ">=5.0.1,<6.0.0" - [[package]] name = "fastapi" version = "0.118.0" @@ -9646,27 +9629,6 @@ lxml = ["lxml (>=4.3,<6.0)"] networkx = ["networkx (>=2,<4)"] orjson = ["orjson (>=3.9.14,<4)"] -[[package]] -name = "redis" -version = "5.3.1" -description = "Python client for Redis database and key-value store" -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"falkordb\"" -files = [ - {file = "redis-5.3.1-py3-none-any.whl", hash = "sha256:dc1909bd24669cc31b5f67a039700b16ec30571096c5f1f0d9d2324bff31af97"}, - {file = "redis-5.3.1.tar.gz", hash = "sha256:ca49577a531ea64039b5a36db3d6cd1a0c7a60c34124d46924a45b956e8cf14c"}, -] - -[package.dependencies] -async-timeout = {version = ">=4.0.3", markers = "python_full_version < \"3.11.3\""} -PyJWT = ">=2.9.0" - -[package.extras] -hiredis = ["hiredis (>=3.0.0)"] -ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==23.2.1)", "requests (>=2.31.0)"] - [[package]] name = "referencing" version = "0.36.2" @@ -12758,7 +12720,6 @@ distributed = ["modal"] dlt = ["dlt"] docs = ["unstructured"] evals = ["gdown", "matplotlib", "pandas", "plotly", "scikit-learn"] -falkordb = ["falkordb"] graphiti = ["graphiti-core"] groq = ["groq"] huggingface = ["transformers"] @@ -12777,4 +12738,4 @@ posthog = ["posthog"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<=3.13" -content-hash = "874553043d02f0974213e040262fe0b1abf61b3c0be47c5e6d8e2db718f94ea2" +content-hash = "38353807b06e5c06caaa107979529937b978204f0f405c6b38cee283f4a49d3c" diff --git a/uv.lock b/uv.lock index 598030e12..570da9289 100644 --- a/uv.lock +++ b/uv.lock @@ -957,9 +957,6 @@ evals = [ { name = "plotly" }, { name = "scikit-learn" }, ] -falkordb = [ - { name = "falkordb" }, -] graphiti = [ { name = "graphiti-core" }, ] @@ -1025,7 +1022,6 @@ requires-dist = [ { name = "deepeval", marker = "extra == 'deepeval'", specifier = ">=3.0.1,<4" }, { name = "deptry", marker = "extra == 'dev'", specifier = ">=0.20.0,<0.21" }, { name = "dlt", extras = ["sqlalchemy"], marker = "extra == 'dlt'", specifier = ">=1.9.0,<2" }, - { name = "falkordb", marker = "extra == 'falkordb'", specifier = ">=1.0.9,<2.0.0" }, { name = "fastapi", specifier = ">=0.115.7,<1.0.0" }, { name = "fastapi-users", extras = ["sqlalchemy"], specifier = ">=14.0.1,<15.0.0" }, { name = "fastembed", specifier = "<=0.6.0" }, @@ -1102,7 +1098,7 @@ requires-dist = [ { name = "uvicorn", specifier = ">=0.34.0,<1.0.0" }, { name = "websockets", specifier = ">=15.0.1,<16.0.0" }, ] -provides-extras = ["api", "distributed", "neo4j", "neptune", "postgres", "postgres-binary", "notebook", "langchain", "llama-index", "huggingface", "ollama", "mistral", "anthropic", "deepeval", "posthog", "falkordb", "groq", "chromadb", "docs", "codegraph", "evals", "graphiti", "aws", "dlt", "baml", "dev", "debug", "monitoring"] +provides-extras = ["api", "distributed", "neo4j", "neptune", "postgres", "postgres-binary", "notebook", "langchain", "llama-index", "huggingface", "ollama", "mistral", "anthropic", "deepeval", "posthog", "groq", "chromadb", "docs", "codegraph", "evals", "graphiti", "aws", "dlt", "baml", "dev", "debug", "monitoring"] [[package]] name = "colorama" @@ -1785,19 +1781,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c1/ea/53f2148663b321f21b5a606bd5f191517cf40b7072c0497d3c92c4a13b1e/executing-2.2.1-py2.py3-none-any.whl", hash = "sha256:760643d3452b4d777d295bb167ccc74c64a81df23fb5e08eff250c425a4b2017", size = 28317, upload-time = "2025-09-01T09:48:08.5Z" }, ] -[[package]] -name = "falkordb" -version = "1.2.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "python-dateutil" }, - { name = "redis" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9e/3b/2d846e877aec104841c523e99e1c584d4aa2423a0e31afee5b8369e3c8c5/falkordb-1.2.0.tar.gz", hash = "sha256:ce57365b86722d538e75aa5d438de67ecd8eb9478da612506d9812cd7f182d0b", size = 28976, upload-time = "2025-06-30T18:03:37.829Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/39/81/1265e623c989bb8c12fe566645bad390d04e66fa62b84ca656e5bafce1f0/falkordb-1.2.0-py3-none-any.whl", hash = "sha256:7572d9cc377735d22efc52fe6fe73c7a435422c827b6ea3ca223a850a77be12e", size = 34737, upload-time = "2025-06-30T18:03:36.582Z" }, -] - [[package]] name = "fastapi" version = "0.118.0" @@ -4728,7 +4711,7 @@ name = "nvidia-cudnn-cu12" version = "9.10.2.21" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-cublas-cu12", marker = "sys_platform != 'emscripten'" }, + { name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/ba/51/e123d997aa098c61d029f76663dedbfb9bc8dcf8c60cbd6adbe42f76d049/nvidia_cudnn_cu12-9.10.2.21-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:949452be657fa16687d0930933f032835951ef0892b37d2d53824d1a84dc97a8", size = 706758467, upload-time = "2025-06-06T21:54:08.597Z" }, @@ -4739,7 +4722,7 @@ name = "nvidia-cufft-cu12" version = "11.3.3.83" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-nvjitlink-cu12", marker = "sys_platform != 'emscripten'" }, + { name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/1f/13/ee4e00f30e676b66ae65b4f08cb5bcbb8392c03f54f2d5413ea99a5d1c80/nvidia_cufft_cu12-11.3.3.83-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4d2dd21ec0b88cf61b62e6b43564355e5222e4a3fb394cac0db101f2dd0d4f74", size = 193118695, upload-time = "2025-03-07T01:45:27.821Z" }, @@ -4766,9 +4749,9 @@ name = "nvidia-cusolver-cu12" version = "11.7.3.90" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-cublas-cu12", marker = "sys_platform != 'emscripten'" }, - { name = "nvidia-cusparse-cu12", marker = "sys_platform != 'emscripten'" }, - { name = "nvidia-nvjitlink-cu12", marker = "sys_platform != 'emscripten'" }, + { name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, + { name = "nvidia-cusparse-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, + { name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/85/48/9a13d2975803e8cf2777d5ed57b87a0b6ca2cc795f9a4f59796a910bfb80/nvidia_cusolver_cu12-11.7.3.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:4376c11ad263152bd50ea295c05370360776f8c3427b30991df774f9fb26c450", size = 267506905, upload-time = "2025-03-07T01:47:16.273Z" }, @@ -4779,7 +4762,7 @@ name = "nvidia-cusparse-cu12" version = "12.5.8.93" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-nvjitlink-cu12", marker = "sys_platform != 'emscripten'" }, + { name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/c2/f5/e1854cb2f2bcd4280c44736c93550cc300ff4b8c95ebe370d0aa7d2b473d/nvidia_cusparse_cu12-12.5.8.93-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1ec05d76bbbd8b61b06a80e1eaf8cf4959c3d4ce8e711b65ebd0443bb0ebb13b", size = 288216466, upload-time = "2025-03-07T01:48:13.779Z" }, @@ -6863,19 +6846,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/31/e9b6f04288dcd3fa60cb3179260d6dad81b92aef3063d679ac7d80a827ea/rdflib-7.1.4-py3-none-any.whl", hash = "sha256:72f4adb1990fa5241abd22ddaf36d7cafa5d91d9ff2ba13f3086d339b213d997", size = 565051, upload-time = "2025-03-29T02:22:44.987Z" }, ] -[[package]] -name = "redis" -version = "5.3.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "async-timeout", marker = "python_full_version < '3.11.3'" }, - { name = "pyjwt" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/6a/cf/128b1b6d7086200c9f387bd4be9b2572a30b90745ef078bd8b235042dc9f/redis-5.3.1.tar.gz", hash = "sha256:ca49577a531ea64039b5a36db3d6cd1a0c7a60c34124d46924a45b956e8cf14c", size = 4626200, upload-time = "2025-07-25T08:06:27.778Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/26/5c5fa0e83c3621db835cfc1f1d789b37e7fa99ed54423b5f519beb931aa7/redis-5.3.1-py3-none-any.whl", hash = "sha256:dc1909bd24669cc31b5f67a039700b16ec30571096c5f1f0d9d2324bff31af97", size = 272833, upload-time = "2025-07-25T08:06:26.317Z" }, -] - [[package]] name = "referencing" version = "0.36.2" @@ -8149,7 +8119,7 @@ name = "triton" version = "3.4.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "setuptools", marker = "sys_platform != 'emscripten'" }, + { name = "setuptools", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'linux')" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/62/ee/0ee5f64a87eeda19bbad9bc54ae5ca5b98186ed00055281fd40fb4beb10e/triton-3.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7ff2785de9bc02f500e085420273bb5cc9c9bb767584a4aa28d6e360cec70128", size = 155430069, upload-time = "2025-07-30T19:58:21.715Z" }, From c9c5406acaaccf5c1bd4c5d8bd0bb3344d14271e Mon Sep 17 00:00:00 2001 From: Igor Ilic <30923996+dexters1@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:59:57 +0200 Subject: [PATCH 4/9] =?UTF-8?q?fix:=20Remove=20cognee=20endpoint=20from=20?= =?UTF-8?q?cognee=20core=20to=20allow=20MCP=20users=20to=20us=E2=80=A6=20(?= =?UTF-8?q?#1513)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …e cognee endpoint ## Description Remove cognee endpoint from core as it clashes with cognee endpoint from cognee-mcp ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Other (please specify): ## Screenshots/Videos (if applicable) ## Pre-submission Checklist - [ ] **I have tested my changes thoroughly before submitting this PR** - [ ] **This PR contains minimal changes necessary to address the issue/feature** - [ ] My code follows the project's coding standards and style guidelines - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if applicable) - [ ] All new and existing tests pass - [ ] I have searched existing PRs to ensure this change hasn't been submitted already - [ ] I have linked any relevant issues in the description - [ ] My commits have clear and descriptive messages ## 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. --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aacd07867..a6dd7d0f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,6 @@ Homepage = "https://www.cognee.ai" Repository = "https://github.com/topoteretes/cognee" [project.scripts] -cognee = "cognee.cli._cognee:main" cognee-cli = "cognee.cli._cognee:main" [build-system] From c81315d177136a2e5772b109ffbb48642a541a89 Mon Sep 17 00:00:00 2001 From: Igor Ilic <30923996+dexters1@users.noreply.github.com> Date: Tue, 7 Oct 2025 22:07:11 +0200 Subject: [PATCH 5/9] chore: Update release version (#1514) ## Description ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Other (please specify): ## Screenshots/Videos (if applicable) ## Pre-submission Checklist - [ ] **I have tested my changes thoroughly before submitting this PR** - [ ] **This PR contains minimal changes necessary to address the issue/feature** - [ ] My code follows the project's coding standards and style guidelines - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if applicable) - [ ] All new and existing tests pass - [ ] I have searched existing PRs to ensure this change hasn't been submitted already - [ ] I have linked any relevant issues in the description - [ ] My commits have clear and descriptive messages ## 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. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a6dd7d0f7..3df57e1f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "cognee" -version = "0.3.4" +version = "0.3.5" description = "Cognee - is a library for enriching LLM context with a semantic layer for better understanding and reasoning." authors = [ { name = "Vasilije Markovic" }, From ada375353402b6143d92b8be290c706f389c7580 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Tue, 7 Oct 2025 21:18:00 +0100 Subject: [PATCH 6/9] fix: fix broken check_llm_provider healthcheck method --- cognee/api/health.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cognee/api/health.py b/cognee/api/health.py index 1b1e45efa..14ebb8043 100644 --- a/cognee/api/health.py +++ b/cognee/api/health.py @@ -193,8 +193,17 @@ class HealthChecker: config = get_llm_config() - # Test actual API connection with minimal request - LLMGateway.show_prompt("test", "test.txt") + from pydantic import BaseModel + + class TestResponse(BaseModel): + status: str + + # Use a simple test to verify LLM connectivity + await LLMGateway.acreate_structured_output( + text_input="Respond with status: ok", + system_prompt="You are a test assistant. Respond with a simple status.", + response_model=TestResponse, + ) response_time = int((time.time() - start_time) * 1000) return ComponentHealth( From 405b65f85754f2a7631d3919ffe03c72e6227613 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Tue, 7 Oct 2025 21:26:22 +0100 Subject: [PATCH 7/9] refactor: Simplify health check methods by using utility functions for LLM and embedding connections --- cognee/api/health.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/cognee/api/health.py b/cognee/api/health.py index 14ebb8043..0241a0712 100644 --- a/cognee/api/health.py +++ b/cognee/api/health.py @@ -189,21 +189,12 @@ class HealthChecker: start_time = time.time() try: from cognee.infrastructure.llm.config import get_llm_config - from cognee.infrastructure.llm import LLMGateway config = get_llm_config() - from pydantic import BaseModel + from cognee.infrastructure.llm.utils import test_llm_connection - class TestResponse(BaseModel): - status: str - - # Use a simple test to verify LLM connectivity - await LLMGateway.acreate_structured_output( - text_input="Respond with status: ok", - system_prompt="You are a test assistant. Respond with a simple status.", - response_model=TestResponse, - ) + await test_llm_connection() response_time = int((time.time() - start_time) * 1000) return ComponentHealth( @@ -226,13 +217,9 @@ class HealthChecker: """Check embedding service health (non-critical).""" start_time = time.time() try: - from cognee.infrastructure.databases.vector.embeddings.get_embedding_engine import ( - get_embedding_engine, - ) + from cognee.infrastructure.llm.utils import test_embedding_connection - # Test actual embedding generation with minimal text - engine = get_embedding_engine() - await engine.embed_text(["test"]) + await test_embedding_connection() response_time = int((time.time() - start_time) * 1000) return ComponentHealth( From ee079604f41613c26c18c4a900e70f85fe70336c Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Tue, 7 Oct 2025 22:03:16 +0100 Subject: [PATCH 8/9] chore: keep exception handling changes to instructor adapters --- .github/workflows/test_s3_file_storage.yml | 4 ++++ .../litellm_instructor/llm/generic_llm_api/adapter.py | 4 ++-- .../litellm_instructor/llm/openai/adapter.py | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_s3_file_storage.yml b/.github/workflows/test_s3_file_storage.yml index a477d8933..ce50aa4f5 100644 --- a/.github/workflows/test_s3_file_storage.yml +++ b/.github/workflows/test_s3_file_storage.yml @@ -6,6 +6,10 @@ on: permissions: contents: read +env: + RUNTIME__LOG_LEVEL: ERROR + ENV: 'test' + jobs: test-gemini: name: Run S3 File Storage Test diff --git a/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/adapter.py b/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/adapter.py index 8c15a5804..917599d4d 100644 --- a/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/adapter.py +++ b/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/adapter.py @@ -118,7 +118,7 @@ class GenericAPIAdapter(LLMInterface): if not (self.fallback_model and self.fallback_api_key and self.fallback_endpoint): raise ContentPolicyFilterError( f"The provided input contains content that is not aligned with our content policy: {text_input}" - ) + ) from error try: return await self.aclient.chat.completions.create( @@ -151,4 +151,4 @@ class GenericAPIAdapter(LLMInterface): else: raise ContentPolicyFilterError( f"The provided input contains content that is not aligned with our content policy: {text_input}" - ) + ) from error diff --git a/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/adapter.py b/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/adapter.py index 989b240ac..527f64d75 100644 --- a/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/adapter.py +++ b/cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/adapter.py @@ -146,11 +146,11 @@ class OpenAIAdapter(LLMInterface): ContentFilterFinishReasonError, ContentPolicyViolationError, InstructorRetryException, - ): + ) as e: if not (self.fallback_model and self.fallback_api_key): raise ContentPolicyFilterError( f"The provided input contains content that is not aligned with our content policy: {text_input}" - ) + ) from e try: return await self.aclient.chat.completions.create( @@ -183,7 +183,7 @@ class OpenAIAdapter(LLMInterface): else: raise ContentPolicyFilterError( f"The provided input contains content that is not aligned with our content policy: {text_input}" - ) + ) from error @observe @sleep_and_retry_sync() From 978549106c81204eaaa99e44e0a0d8dc168c3512 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Tue, 7 Oct 2025 22:04:26 +0100 Subject: [PATCH 9/9] chore: use dev env in test_s3 CI --- .github/workflows/test_s3_file_storage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_s3_file_storage.yml b/.github/workflows/test_s3_file_storage.yml index ce50aa4f5..04d140513 100644 --- a/.github/workflows/test_s3_file_storage.yml +++ b/.github/workflows/test_s3_file_storage.yml @@ -8,7 +8,7 @@ permissions: env: RUNTIME__LOG_LEVEL: ERROR - ENV: 'test' + ENV: 'dev' jobs: test-gemini: