Skip to content

fix: migrate Weaviate to weaviate-client v3 for agentKnowledgeVSEmbeddings compatibility (#5991)#5993

Merged
HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom
aayushbaluni:fix/5991-weaviate-v3-client
Mar 17, 2026
Merged

fix: migrate Weaviate to weaviate-client v3 for agentKnowledgeVSEmbeddings compatibility (#5991)#5993
HenryHengZJ merged 3 commits intoFlowiseAI:mainfrom
aayushbaluni:fix/5991-weaviate-v3-client

Conversation

@aayushbaluni
Copy link
Copy Markdown
Contributor

Summary

Fixes #5991.

Root cause: Weaviate.ts used weaviate-ts-client v2 which creates a client without a collections property. @langchain/weaviate 1.0.1 expects weaviate-client v3 and calls this.client.collections.get(), causing TypeError: Cannot read properties of undefined (reading get) when using agentKnowledgeVSEmbeddings in AgentFlow V2.

Fix: Replaced weaviate-ts-client with weaviate-client v3 and updated client creation to use connectToCustom() with the correct httpHost/httpPort/httpSecure parameters.

Changes

  • packages/components/package.json: Swapped weaviate-ts-client for weaviate-client ^3.5.2
  • packages/components/nodes/vectorstores/Weaviate/Weaviate.ts: Migrated to weaviate-client v3 API (connectToCustom)
  • packages/components/nodes/vectorstores/Weaviate/weaviateClientUtils.ts: Added parseHostPort helper for host:port parsing
  • packages/components/nodes/vectorstores/Weaviate/weaviateClientUtils.test.ts: Unit tests for parseHostPort
  • packages/components/src/utils.ts: Updated defaultAllowExternalDependencies for weaviate-client
  • pnpm-lock.yaml: Updated lockfile

Testing

Made with Cursor

….0.1 compatibility (FlowiseAI#5991)

Root cause: Weaviate.ts used weaviate-ts-client v2 which creates a client without a collections property. @langchain/weaviate 1.0.1 expects weaviate-client v3 and calls this.client.collections.get(), causing TypeError: Cannot read properties of undefined (reading 'get').
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical compatibility issue within the Weaviate integration by upgrading the underlying client library. The update ensures that components relying on the Weaviate vector store can correctly initialize and interact with the database, preventing runtime errors and improving the stability of agent-based flows.

Highlights

  • Weaviate Client Migration: Upgraded the Weaviate client library from weaviate-ts-client v2 to weaviate-client v3 to resolve a TypeError encountered when using agentKnowledgeVSEmbeddings with @langchain/weaviate 1.0.1.
  • Weaviate Client Initialization Refactor: Refactored the Weaviate client creation process to utilize the new weaviate.connectToCustom() method, ensuring proper configuration with httpHost, httpPort, and httpSecure parameters for enhanced compatibility.
  • Host/Port Parsing Utility: Introduced a new utility function, parseHostPort, to accurately extract host and port information from a given string, supporting various formats including IPv6-style hosts, and added comprehensive unit tests for it.
Changelog
  • packages/components/nodes/vectorstores/Weaviate/Weaviate.ts
    • Migrated Weaviate client initialization to use weaviate.connectToCustom().
    • Incorporated the new parseHostPort utility for host and port extraction.
  • packages/components/nodes/vectorstores/Weaviate/weaviateClientUtils.test.ts
    • Added unit tests for the parseHostPort utility.
  • packages/components/nodes/vectorstores/Weaviate/weaviateClientUtils.ts
    • Added the parseHostPort helper function.
  • packages/components/package.json
    • Swapped weaviate-ts-client for weaviate-client ^3.5.2.
  • packages/components/src/utils.ts
    • Updated defaultAllowExternalDependencies to reflect the new weaviate-client package name.
  • pnpm-lock.yaml
    • Updated the lockfile to reflect dependency changes.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully migrates from weaviate-ts-client v2 to weaviate-client v3, which is a necessary update to fix compatibility issues with @langchain/weaviate. The changes are well-structured, including the addition of unit tests for the new utility function. However, I've identified a few issues in the new parseHostPort helper and its usage: a code duplication, a bug in handling IPv6 addresses, and an issue with default port selection for HTTPS connections. My review includes suggestions to address these points to make the implementation more robust and maintainable.

aayushbaluni and others added 2 commits March 17, 2026 16:13
…d HTTPS port

- Remove duplicate parseHostPort from Weaviate.ts, import from weaviateClientUtils
- Rewrite parseHostPort to handle bracketed IPv6 (e.g. [::1]:8080) correctly
- Return port as optional (undefined when not specified) instead of hardcoded 8080
- Use nullish coalescing (??) for default port so HTTPS correctly defaults to 443
- Update tests to match new return type and add IPv6 coverage
@HenryHengZJ HenryHengZJ merged commit 8d9ec99 into FlowiseAI:main Mar 17, 2026
3 checks passed
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.

agentKnowledgeVSEmbeddings with Weaviate fails in 3.1.0 — TypeError: Cannot read properties of undefined (reading 'get')

2 participants