Skip to content

feat(weaviate): report crewai-tools in the Weaviate integration header - #8322

Open
Duda Nogueira (dudanogueira) wants to merge 2 commits into
crewAIInc:mainfrom
dudanogueira:feat/weaviate-integration-header
Open

Duda Nogueira (dudanogueira) wants to merge 2 commits into
crewAIInc:mainfrom
dudanogueira:feat/weaviate-integration-header

Conversation

@dudanogueira

@dudanogueira Duda Nogueira (dudanogueira) commented Oct 20, 2026 •

Copy link
Copy Markdown

Related issue

Fixes #8321

Summary

Since server 1.38.0, Weaviate reads the X-Weaviate-Client-Integration header to tell which integration sent a request. WeaviateVectorSearchTool doesn't send it, so Weaviate's telemetry can't see that CrewAI sent the traffic. MongoDBVectorSearchTool already sends the same kind of identification with DriverInfo(name="CrewAI", ...).

  • client.integrations.configure instead of headers=. A headers= argument only goes on REST requests, but hybrid search goes over gRPC. integrations.configure sets the header on both.
  • Best-effort registration. configure takes a subclass of _IntegrationConfig, which is private API in weaviate-client. The import, the subclass and the call all sit inside one try. If anything fails, it logs at debug level and the search runs as before.
  • Version from the crewai-tools package metadata. crewai_tools.__version__ would be a circular import. If the version can't be read, the value is crewai-tools/unknown.
  • Minimum weaviate-client raised from 4.10.2 to 4.23.1. The lock used to resolve 4.16.2 or 4.21.3 depending on the Python marker. It now resolves 4.23.1 everywhere and drops grpcio-health-checking. Most of the uv.lock diff comes from this. The bump isn't needed for the header, and I can drop it if you'd rather keep the old minimum.

Things to look at in review:

  • _register_integration: check that every failure path, including a failed import, is caught, and that the header is set before collections.get and the query.
  • _CrewAIIntegration: the field's serialization_alias becomes the header name.

Verification

  • Tests added or updated for the changed behavior

  • Relevant tests and quality checks pass locally

  • This tool had no tests before. The new tests/tools/test_weaviate_vector_search_tool.py has 15 fully mocked tests. They cover how the version is read, the header name and value, the header staying within Weaviate's 128-byte name/version format, skipping registration when the private API is missing or configure raises, and setting the header before the query runs.

  • The full crewai-tools suite passes (1053 passed, 9 skipped). ruff check, ruff format --check and mypy are clean on the changed files.

  • Checked by hand against Weaviate 1.39.5:

    • With the earlier client, the server received crewai-tools/<version> on both REST and gRPC.
    • With 4.23.1, the connected client sends X-Weaviate-Client-Integration: crewai-tools/1.15.28 on both REST and gRPC.

Additional context

  • If a future weaviate-client changes or removes _IntegrationConfig, registration is skipped and only attribution is lost.
  • Servers older than 1.38.0 ignore the header.

Note

Low Risk
Telemetry-only change with defensive error handling; dependency bump is the main install-time impact for consumers of the weaviate extra.

Overview
Weaviate vector search now registers CrewAI with Weaviate telemetry by setting X-Weaviate-Client-Integration: crewai-tools/<version> via client.integrations.configure (so the header applies on gRPC as well as REST), immediately after connect and before queries. Version comes from distribution metadata with an "unknown" fallback; registration is best-effort and must not break searches if the integrations API is missing or fails.

The optional weaviate-client extra minimum is raised to >=4.23.1, with uv.lock refreshed accordingly.

A new mocked test module covers version resolution, header shape, ordering, failure paths, and end-to-end _run behavior.

Reviewed by Cursor Bugbot for commit f3b92ee. Bugbot is set up for automated code reviews on this repo. Configure here.

@strix-security

strix-security Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Strix Security Review

Warning

This pull request has 220 commits after the last Strix review (316e76f). Strix has not reviewed these changes.
Automatic review on push is off for this repository. To review the latest changes, tag @strix-security in a comment, or turn on re-review on push.

No security issues found.

Review summary

Reviewed the full diff: the new Weaviate integration-header helpers in vector_search.py, the added test module, and the weaviate-client>=4.23.1 dependency bump with its lockfile re-resolution. The added code contains no attacker-controlled input path — the header value is a constant integration name plus a locally resolved package version, all failures are swallowed and logged only at debug level, the existing API-key headers handling is untouched, and no authorization or validation logic was removed. Static analysis on the changed file returned no findings, and the lockfile change only raises a minimum version while keeping all packages on the PyPI registry. No security vulnerabilities were identified in the changed code.

Updated for 316e76f.


Reviewed by Strix
Re-run review · Configure security review settings

Weaviate reads `X-Weaviate-Client-Integration` (since server 1.38.0) to attribute
traffic to the integration that produced it. The tool sent nothing, so CrewAI was
invisible in that telemetry.

Registration goes through `client.integrations.configure` rather than the `headers=`
argument, because that applies the header to the gRPC transport as well as REST --
searches travel over gRPC. It is best-effort: `_IntegrationConfig` is private API, so
a `weaviate-client` without it skips registration instead of breaking the tool.

`MongoDBVectorSearchTool` already identifies CrewAI to its database the same way, via
`DriverInfo(name="CrewAI", version=version("crewai-tools"))`.

Verified against Weaviate 1.39.5: the header arrives on both transports as
`crewai-tools/<version>`.

Adds the first tests for this tool.
Raises the floor from 4.10.2 to the current release. The lock previously resolved
two versions (4.16.2 and 4.21.3) depending on the Python marker; it now resolves
4.23.1 everywhere, which also drops the unused grpcio-health-checking.

4.23.1 still ships `weaviate.connect.integrations._IntegrationConfig`, so the
integration header registration is unchanged; checked live against Weaviate 1.39.5
(header present on REST and gRPC).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] WeaviateVectorSearchTool: identify CrewAI to Weaviate via the client-integration header

1 participant