Skip to content

feat: add cognee lab query tool#19331

Closed
psionic73 wants to merge 4 commits into
NousResearch:mainfrom
psionic73:feat/cognee-source-bound-answers-pr-20260503-191017
Closed

feat: add cognee lab query tool#19331
psionic73 wants to merge 4 commits into
NousResearch:mainfrom
psionic73:feat/cognee-source-bound-answers-pr-20260503-191017

Conversation

@psionic73

@psionic73 psionic73 commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an isolated Cognee lab query tool gated by config/runtime requirements
  • register the toolset wiring and tests for source-bound answers and source filename normalization
  • add regression coverage for related toolset inference and compression/browser path interactions

Tests

  • /root/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py tests/hermes_cli/test_status.py tests/hermes_cli/test_context_audit.py tests/hermes_cli/test_smoke.py tests/hermes_cli/test_subcommands_batch.py -q
  • Result: 189 passed, 3 warnings

@alt-glitch alt-glitch added type/feature New feature or request comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have labels May 3, 2026
@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from ad0c326 to 9432ec3 Compare May 7, 2026 15:17
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed against current origin/main and re-verified the Cognee lab paths.

  • Rebased the PR branch onto current origin/main (04918345ea31b1106d2ee6d4f42822f4f57616ee).
  • Branch is now 3 commits ahead / 0 behind origin/main.
  • Fork branch is in sync with local rebased HEAD (9432ec377dd1a76b5e58b0d975ebd4d5b692859c).
  • GitHub reports the PR as mergeable after recompute.
  • Checks: GitHub reports no checks for this fork branch.

Local verification:

  • pytest tests/tools/test_cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/tools/test_clipboard.py -q -o 'addopts=' — 177 passed
  • From the isolated cognee-lab profile directory: .venv/bin/python scripts/smoke_test.py — failures=0
  • Real Hermes profile smoke using the rebased worktree code and --profile cognee-lab --toolsets cognee returned: Hermes Lantern — hermes_ops_pilot.md
  • hermes config check via the rebased worktree code — config version 23 OK

No functional scope changes were made beyond rebasing the existing 3 Cognee commits over current main.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from 9432ec3 to 7a0a4d2 Compare May 12, 2026 15:17
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed against current origin/main after GitHub reported conflicts.

  • Rebased the existing 3 Cognee commits onto current origin/main (dd0923bb89ed2dd56f82cb63656a1323f6f42e6f).
  • Resolved the hermes_cli/tools_config.py conflict by preserving upstream's broader mixed-composite toolset handling and keeping the Cognee toolset/config additions.
  • Force-with-lease updated the existing fork branch from 9432ec377dd1a76b5e58b0d975ebd4d5b692859c to 7a0a4d204f502b993418e5686c99e35d526180c6.
  • Branch is now 3 commits ahead / 0 behind origin/main.
  • GitHub reports the PR as mergeable after recompute.
  • Checks: GitHub reports no checks for this fork branch.

Local verification:

  • scripts/run_tests.sh tests/tools/test_cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/tools/test_clipboard.py -q -o 'addopts=' — 181 passed
  • python -m hermes_cli.main config check — config version 23 OK

No intended functional scope changes beyond rebasing the existing Cognee PR over current main and resolving the toolset-config conflict.

@psionic73

Copy link
Copy Markdown
Contributor Author

Final pre-merge review from Hermes Agent:

  • Scope reviewed: Cognee tool registration/config plumbing, tools/cognee_query_tool.py, source-bound answer tests, and related tool-config tests.
  • The PR remains lab-scoped/read-only and does not introduce automatic memory ingestion or default production data access.
  • The earlier merge conflict was resolved against current origin/main while preserving upstream mixed-composite toolset handling.
  • Local verification after rebase: scripts/run_tests.sh tests/tools/test_cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/tools/test_clipboard.py -q -o 'addopts=' — 181 passed; config check OK.
  • GitHub reports the PR as mergeable and no checks are reported for this fork branch.

Verdict: no blockers found; ready for maintainer merge.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from 7a0a4d2 to 599f0b6 Compare May 14, 2026 10:16
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed against current origin/main after upstream moved forward again.

  • Rebased the existing 3 Cognee commits onto current origin/main (ddb8d8fa842283ef651a6e4514f8f561f736c72e).
  • New PR head: 599f0b6740c1a4b1d855ce89f48af9bf93014d76.
  • Branch state after refresh: 3 commits ahead / 0 behind origin/main.
  • Fork/local parity verified after force-with-lease push: 0 ahead / 0 behind.
  • GitHub reports mergeable: MERGEABLE.
  • GitHub reports no checks.
  • Local verification: python -m pytest tests/tools/test_cognee_query_tool.py tests/hermes_cli/test_tools_config.py -q → 76 passed.

No functional scope change intended beyond rebasing the existing Cognee tool/config/test changes onto current upstream.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from 599f0b6 to 8e3edd2 Compare May 15, 2026 14:23
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed against current main.

Current head: 8e3edd2f92c82b32eac475d8ae26277af681ba0a
Base: d5416284f11ccbc735c8357f0ab35ce5f683ccc3
GitHub reports: MERGEABLE

Local verification:

  • tests/tools/test_cognee_query_tool.py
  • tests/hermes_cli/test_tools_config.py

Result: 77 passed.

No CI checks are reported by GitHub for this PR at the moment.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from 8e3edd2 to 2851107 Compare May 19, 2026 00:03
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed against current origin/main and resolved the stale merge conflict.

  • Rebased the existing 3 Cognee commits onto current origin/main (378bca1d2ff8ffee9158016295d8b44e2cc81d59).
  • Resolved the hermes_cli/tools_config.py conflict by preserving current upstream's toolset/default-off handling, including the x_search credential auto-enable behavior, while keeping the Cognee toolset/config additions.
  • New PR head: 28511070f6daf9ef03b490b0155ff0e130e66c63.
  • Branch is now 3 commits ahead / 0 behind origin/main.
  • Fork/local parity verified after force-with-lease push: 0 ahead / 0 behind.
  • GitHub reports mergeable: MERGEABLE (mergeStateStatus: UNSTABLE).
  • GitHub reports no checks for this fork branch.

Local verification:

  • scripts/run_tests.sh tests/tools/test_cognee_query_tool.py tests/hermes_cli/test_tools_config.py -q -o 'addopts=' → 82 passed
  • /root/.hermes/hermes-agent/.venv/bin/python -m hermes_cli.main config check → config version 23 OK
  • git diff --check origin/main...HEAD → OK

No intentional functional scope change beyond rebasing the existing Cognee tool/config/test changes and resolving the upstream conflict.

@psionic73

Copy link
Copy Markdown
Contributor Author

@teknium1 quick refresh: all currently open psionic73 PRs are rebased/verified and mergeable again.

Hermes Agent:

Paperclip adapter:

GitHub reports no checks on these fork branches, so local verification is documented in the latest PR comments.
Could you please review/merge when you have a chance?

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from 2851107 to 45ca31e Compare May 19, 2026 00:19
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed again against latest origin/main after upstream advanced to include #23854.

  • Rebased onto current origin/main (2ef501e1f5a9530435b7db5e334f00747b1e7b8f).
  • New PR head: 45ca31e8f7dbccc50c8083c37eb797a732411ec1.
  • Fork/local parity verified after force-with-lease push: 0 ahead / 0 behind.

Local verification:

  • python -m pytest tests/hermes_cli/test_tools_config.py tests/tools/test_cognee_query_tool.py -q -o 'addopts=' → 82 passed
  • hermes config check → config version 23 OK

No intentional functional scope change beyond refreshing the existing Cognee/source-bound-answer PR onto current upstream.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 6 times, most recently from d9131f8 to b79a038 Compare May 25, 2026 13:31
@psionic73

Copy link
Copy Markdown
Contributor Author

Maintainer handoff / refresh status:

  • Refreshed on current main.
  • Base: 8f19485f538565630a35d992b06324f308f80630
  • Head: b79a038d66ff3d39b3ae3e5e2626cac0b83315e1
  • GitHub reports: MERGEABLE
  • GitHub checks are complete: 21 total, 18 success, 3 skipped, 0 pending, 0 failed.
  • Local targeted verification after refresh:
    • Cognee query/tooling + tools config + previously failing upstream-drift tests: 91 passed

No further action needed from my side unless main moves again before merge.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from b79a038 to f8b3cfc Compare May 26, 2026 22:24
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR onto current upstream main.

Verification:

  • Base: f05a47309ec8842387e88eab856df55c6910b57b
  • Head: f8b3cfc60cb33f560a8e4eaa577def589474cbe0
  • Local branch is 3 commits ahead / 0 behind origin/main
  • Fork/local parity after push: 0 0
  • GitHub mergeability: MERGEABLE
  • GitHub checks: 18 passed, 3 skipped, 0 pending, 0 failed
  • Local targeted tests: PYTHONPATH=$WT .venv/bin/python -m pytest -o addopts='' tests/hermes_cli/test_tools_config.py tests/tools/test_cognee_query_tool.py -q → 89 passed

No functional scope change beyond the rebase/refresh.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 4 times, most recently from ca21b79 to fffe2ee Compare June 9, 2026 15:16
@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from 47fb727 to 10691c3 Compare June 18, 2026 21:45
@psionic73

psionic73 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Refreshed this PR against current origin/main and force-pushed with lease.

  • New head: 378c9cc10f5d443c85753e77567982c415314b3f
  • Base at final refresh: 03d9a95a74b234c2d46e0b59cf6e12281f93fbf5
  • Branch divergence after refresh: 4 ahead / 0 behind origin/main
  • GitHub reports: MERGEABLE / CLEAN
  • Checks after refresh: 30 success, 5 skipped, 0 pending, 0 failed

Local verification after the final refresh:

  • git diff --check origin/main..HEAD — OK
  • python -m pytest -o 'addopts=' tests/hermes_cli/test_tools_config.py -q — 108 passed
  • python -m pytest -o 'addopts=' tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py -q — 26 passed
  • python -m ruff check hermes_cli/tools_config.py tools/cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py — OK
  • import tools.cognee_query_tool smoke — OK

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 2 times, most recently from 378c9cc to a79120a Compare June 20, 2026 06:27
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR against current origin/main and force-pushed with lease.

Current status:

  • New head: a79120a4935737f3f616a197b13aec67ee81ec20
  • Base at final refresh: c253b073809f75fefa55dcd5bbe41b5faee8ca9c
  • Branch divergence after refresh: 4 ahead / 0 behind origin/main
  • GitHub reports: MERGEABLE / CLEAN
  • Checks after refresh: 30 success, 5 skipped, 0 pending, 0 failed

Local verification after the refresh:

  • git diff --check origin/main..HEAD — OK
  • venv/bin/python -m pytest -o 'addopts=' tests/hermes_cli/test_tools_config.py -q — 108 passed, 1 warning
  • venv/bin/python -m pytest -o 'addopts=' tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py -q — 26 passed, 1 warning
  • venv/bin/python -m ruff check hermes_cli/tools_config.py tools/cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py — OK
  • hermes config check — config version 30 OK
  • import tools.cognee_query_tool smoke — OK
  • Exact CLI smoke: UPDATE_PREPARE_OK

Also refreshed the local production venv used by the gateway unit (venv/bin/python) after upstream dependency changes; hermes-agent package metadata is now 0.17.0 and core imports such as croniter/fastapi resolve.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from a79120a to 5940f21 Compare June 20, 2026 09:52
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR again against current origin/main and force-pushed with lease.

Current status:

  • New head: 5940f215179da6490fa6a96a5b4e6eb86ee607a2
  • Base at final refresh: ff50a8861703c09c0805a0b7cdb199a6b6a3eb7c
  • Branch divergence after refresh: 4 ahead / 0 behind origin/main
  • GitHub reports: MERGEABLE / CLEAN
  • Checks after refresh: 30 success, 5 skipped, 0 pending, 0 failed

Local verification after the refresh:

  • git diff --check origin/main..HEAD — OK
  • venv/bin/python -m pytest -o 'addopts=' tests/hermes_cli/test_tools_config.py -q — 108 passed, 1 warning
  • venv/bin/python -m pytest -o 'addopts=' tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py -q — 26 passed, 1 warning
  • venv/bin/python -m ruff check hermes_cli/tools_config.py tools/cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py — OK
  • hermes config check — config version 30 OK
  • import tools.cognee_query_tool smoke — OK
  • Exact CLI smoke: PR19331_REFRESH_OK

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 2 times, most recently from 4d3852f to c03643d Compare June 20, 2026 18:59
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR onto current origin/main and force-pushed with lease.

Verification:

  • New head: c03643d3fdde
  • Base: 5a53e0f0f487
  • Merge state: CLEAN
  • GitHub checks: 30 success, 5 skipped, 0 pending/failing
  • Local targeted test: python -m pytest tests/hermes_cli/test_tools_config.py -q -o 'addopts=' → 108 passed

Backup branch kept locally before refresh: backup/pr19331-refresh-20260620_183507.

@psionic73

Copy link
Copy Markdown
Contributor Author

Final refresh/review pass from my side:

  • Current PR head: c03643d3fdde4dbec8c9fe57011e163bf715b83d
  • Base checked against: 5a53e0f0f487d3d383e2a7b2eae8f260e9bf1090
  • Merge state: CLEAN / MERGEABLE
  • GitHub checks: green (30 success, 5 skipped, 0 pending/failing)

Additional local verification on a detached worktree at the PR head:

python -m pytest tests/hermes_cli/test_tools_config.py::test_cognee_query_tool_registered_and_available \
  tests/hermes_cli/test_tools_config.py::test_cognee_query_rejects_unsupported_search_type \
  tests/hermes_cli/test_tools_config.py::test_cognee_query_invokes_isolated_lab \
  tests/hermes_cli/test_tools_config.py::test_cognee_query_normalizes_source_filenames_from_envelope \
  tests/hermes_cli/test_tools_config.py::test_source_extraction_handles_nested_results \
  tests/hermes_cli/test_tools_config.py::test_fallback_source_extraction_strips_trailing_punctuation \
  tests/hermes_cli/test_tools_config.py::test_cognee_query_answer_with_sources_combines_answer_and_chunk_sources \
  tests/hermes_cli/test_tools_config.py::test_get_platform_tools_composite_plus_explicit_toolset_extends_default \
  tests/hermes_cli/test_tools_config.py::test_get_platform_tools_composite_plus_explicit_preserves_disabled_default_off \
  tests/hermes_cli/test_tools_config.py::test_get_platform_tools_composite_plus_explicit_keeps_ha_runtime_exception -q
# 10 passed

python -m pytest tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py -q
# 134 passed

python -m ruff check tools/cognee_query_tool.py hermes_cli/tools_config.py tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py
# All checks passed

I also re-read the new read-only cognee_query tool path and the toolset inference changes. The implementation stays scoped to explicit retrieval from the isolated cognee-lab profile, keeps ingestion/reset/memory writes out of scope, validates search type/input length/top_k, and includes source-file normalization/regression coverage.

Looks ready from my side.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 2 times, most recently from b1da9ef to 2f1c383 Compare June 21, 2026 11:46
@psionic73 psionic73 changed the title feat: add source-bound cognee query tool feat: add cognee lab query tool Jun 21, 2026
@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 3 times, most recently from 3d32eb2 to 6318399 Compare June 23, 2026 20:37
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR onto current origin/main and force-pushed with lease.

Current status:

  • New head: 63183991122cb95621eda1e8a99ad00fe3de4bb7
  • Base: aaa2e2cb882060b3c97d91452155c2363a5e2d30
  • Branch divergence after refresh: 4 ahead / 0 behind origin/main
  • GitHub reports: MERGEABLE / CLEAN
  • GitHub checks after refresh: 19 success, 7 skipped, 0 pending/failing

Local verification after refresh:

  • git diff --check origin/main..HEAD — OK
  • python -m pytest -o 'addopts=' tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py -q134 passed, 3 warnings
  • python -m ruff check hermes_cli/tools_config.py tools/cognee_query_tool.py tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py toolsets.py — OK
  • import tools.cognee_query_tool smoke — OK

Backup branch kept locally before the final refresh: backup/pr19331-refresh-20260623_203645.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch 2 times, most recently from 18c221a to f8fce0c Compare June 24, 2026 20:29
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR onto current origin/main and force-pushed with lease.

Current status:

  • New head: f8fce0c0dd1119caed2727c7f4e5447c0ddf5ec6
  • Base: 77d2b50751f3
  • Branch divergence after refresh: 4 ahead / 0 behind origin/main
  • GitHub reports: MERGEABLE / CLEAN
  • GitHub checks after refresh: 19 success, 7 skipped, 0 pending/failing

Local verification after refresh:

  • python -m pytest -o 'addopts=' tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py -q134 passed, 3 warnings
  • python -m ruff check hermes_cli/tools_config.py tools/cognee_query_tool.py toolsets.py tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py — OK

Backup branch kept locally before the final refresh: backup/pr19331-repeat-20260624_202910.

@psionic73
psionic73 force-pushed the feat/cognee-source-bound-answers-pr-20260503-191017 branch from f8fce0c to af60b30 Compare July 5, 2026 11:39
@psionic73

Copy link
Copy Markdown
Contributor Author

Refreshed this PR onto current origin/main.

  • New head: af60b3097acf
  • Base: 2c0820c9ff55
  • Mergeability: MERGEABLE / CLEAN
  • GitHub checks after refresh: 23 success, 7 skipped, 1 neutral, 0 pending, 0 failing
  • Local verification: PYTHONPATH="$WT" venv/bin/python -m pytest -q tests/hermes_cli/test_tools_config.py tests/agent/test_compression_concurrent_fork.py tests/tools/test_browser_homebrew_paths.py → 155 passed; ruff touched files → passed

No failing or pending checks observed after the refresh.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the careful, read-only scope and the source-bound regression coverage.

This automated hermes-sweeper review is closing this as a policy fit issue rather than a quality judgment:

  • tools/cognee_query_tool.py:488 adds a Cognee-specific built-in tool, and the PR adds it to the global _HERMES_CORE_TOOLS bundle in toolsets.py.
  • AGENTS.md:126-135 sets the standing policy that third-party product integrations do not land in the core tree, because ongoing compatibility maintenance belongs with the integration owner.
  • Please publish this as a standalone Cognee plugin repo, installed through ~/.hermes/plugins/ or a pip entry point, and promote it in #plugins-skills-and-skins. The focused retrieval logic and tests can be preserved there without adding permanent core-tool surface.

Closed as not-planned per standing maintainer policy (in-tree-provider-integration). This is a design-direction decision, not a code-quality judgment — see the Contribution Rubric in AGENTS.md for what the project is looking for. If you believe this policy was misapplied to your change, comment here and a maintainer will take a look.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants