Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(community): add MeiliSearch as a VectorStore provider #7044

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

SrilalS
Copy link
Contributor

@SrilalS SrilalS commented Oct 22, 2024

Adding MeiliSearch as a VectorStore provider to LangchainJS. This is written to be feature-compatible with the python implementation of Meilisearch.

Compatible with Meilisearch 1.6.0 or newer.
Node-Only Implementation.

  • Build Passes.
  • Documentation Done.
  • Index Management within the library.
  • Able to run health checks.
  • Documentation to include more comprehensive use cases.

Added Meilisearch integration for LangchainJS. Made to be on par with the Meilisearch's Langchain Python integration.
…earchVectorStore

Renamed the class to MeiliSearchVectorStore, this is to be aligned with the standard.
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 22, 2024
Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Oct 29, 2024 10:19pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Oct 29, 2024 10:19pm

@dosubot dosubot bot added auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Oct 22, 2024
Added HealthCheck.
Added Index Management.
Docs updated to reflect the recent changes.
@jacoblee93 jacoblee93 changed the title feat: add MeiliSearch as a VectorStore provider feat(community): add MeiliSearch as a VectorStore provider Oct 29, 2024
@jacoblee93
Copy link
Collaborator

Thanks for your patience, having a look now!

@jacoblee93
Copy link
Collaborator

Hey @SrilalS, had a look and fixed a few small things, but yarn build in @langchain/community seems to be failing:

@langchain/community:build:internal: src/vectorstores/meilisearch.ts:132:41 - error TS2769: No overload matches this call.
@langchain/community:build:internal:   Overload 1 of 2, '(o: {}): string[]', gave the following error.
@langchain/community:build:internal:     Argument of type 'Embedders' is not assignable to parameter of type '{}'.
@langchain/community:build:internal:       Type 'null' is not assignable to type '{}'.
@langchain/community:build:internal:   Overload 2 of 2, '(o: object): string[]', gave the following error.
@langchain/community:build:internal:     Argument of type 'Embedders' is not assignable to parameter of type 'object'.
@langchain/community:build:internal:       Type 'null' is not assignable to type 'object'.
@langchain/community:build:internal: 
@langchain/community:build:internal: 132       const embedder_name = Object.keys(this.embedders)[0];
@langchain/community:build:internal:                                             ~~~~~~~~~~~~~~
@langchain/community:build:internal: 
@langchain/community:build:internal: 
@langchain/community:build:internal: src/vectorstores/meilisearch.ts:215:39 - error TS2769: No overload matches this call.
@langchain/community:build:internal:   Overload 1 of 2, '(o: {}): string[]', gave the following error.
@langchain/community:build:internal:     Argument of type 'Embedders' is not assignable to parameter of type '{}'.
@langchain/community:build:internal:       Type 'null' is not assignable to type '{}'.
@langchain/community:build:internal:   Overload 2 of 2, '(o: object): string[]', gave the following error.
@langchain/community:build:internal:     Argument of type 'Embedders' is not assignable to parameter of type 'object'.
@langchain/community:build:internal:       Type 'null' is not assignable to type 'object'.
@langchain/community:build:internal: 
@langchain/community:build:internal: 215     const embedder_name = Object.keys(this.embedders)[0];
@langchain/community:build:internal:                                           ~~~~~~~~~~~~~~
@langchain/community:build:internal: 
@langchain/community:build:internal: 
@langchain/community:build:internal: src/vectorstores/meilisearch.ts:238:11 - error TS2322: Type 'number | undefined' is not assignable to type 'number'.
@langchain/community:build:internal:   Type 'undefined' is not assignable to type 'number'.
@langchain/community:build:internal: 
@langchain/community:build:internal: 238           semantic_score,
@langchain/community:build:internal:               ~~~~~~~~~~~~~~
@langchain/community:build:internal: 
@langchain/community:build:internal: src/vectorstores/meilisearch.ts:251:5 - error TS6133: 'vectors' is declared but its value is never read.
@langchain/community:build:internal: 
@langchain/community:build:internal: 251     vectors: number[][],
@langchain/community:build:internal:         ~~~~~~~
@langchain/community:build:internal: 
@langchain/community:build:internal: src/vectorstores/meilisearch.ts:252:5 - error TS6133: 'documents' is declared but its value is never read.
@langchain/community:build:internal: 
@langchain/community:build:internal: 252     documents: DocumentInterface[],
@langchain/community:build:internal:         ~~~~~~~~~
@langchain/community:build:internal: 
@langchain/community:build:internal: src/vectorstores/meilisearch.ts:253:5 - error TS6133: 'options' is declared but its value is never read.
@langchain/community:build:internal: 
@langchain/community:build:internal: 253     options?: { [x: string]: any }
@langchain/community:build:internal:         ~~~~~~~
@langchain/community:build:internal: 
@langchain/community:build:internal: 
@langchain/community:build:internal: Found 6 errors in the same file, starting at: src/vectorstores/meilisearch.ts:132
@langchain/community:build:internal: 
@langchain/community:build:internal: Error: Command failed: tsc --outDir dist-cjs/ -p tsconfig.cjs.json
@langchain/community:build:internal:     at ChildProcess.<anonymous> (file:///Users/jacoblee/langchain/langchainjs/libs/langchain-scripts/dist/build/index.js:21:24)
@langchain/community:build:internal:     at ChildProcess.emit (node:events:519:28)
@langchain/community:build:internal:     at maybeClose (node:internal/child_process:1104:16)
@langchain/community:build:internal:     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
@langchain/community:build:internal: ERROR: command finished with error: command (/Users/jacoblee/langchain/langchainjs/libs/langchain-community) /private/var/folders/z4/1qk27d6n7w59z2h3r31hwxgr0000gn/T/xfs-fce98aea/yarn run build:internal exited (1)

@SrilalS
Copy link
Contributor Author

SrilalS commented Oct 29, 2024

Thank you for checking it out and for the changes.
The library itself works fine in our codebase, but I noticed the tsconfig is different so this must be an issue with type rules.
in the last commit have made it to follow the rules set in it.

I can't build this repo locally first as it having an issue with Windows. I'll try with WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features in progress PRs that are in progress but not ready to merge size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants