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

community[minor]: add FirestoreVectorStore #5290

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

glorat
Copy link
Contributor

@glorat glorat commented May 6, 2024

Implements #5289

Copy link

vercel bot commented May 6, 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 Aug 28, 2024 6:44pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Aug 28, 2024 6:44pm

@glorat
Copy link
Contributor Author

glorat commented May 6, 2024

For a community contribution, I imagine what is also needed are

  • peer dependencies in package.json
  • documentation somewhere

I'd welcome guidance or contribution on this, as well as the code itself.

In the mean the code is working as-is when used in a local project of mine

@glorat
Copy link
Contributor Author

glorat commented May 6, 2024

For my reference mainly, #655 seems a good PR to compare against what needs to be done

@glorat
Copy link
Contributor Author

glorat commented Jun 28, 2024

Just to note, I'm using FirestoreVectorStore in production in my own project so I am maintaining the code in my local codebase. I'm going to leave this PR alone until there is other demand out there in the community. Ping if interest comes!

Copy link
Collaborator

@bracesproul bracesproul left a comment

Choose a reason for hiding this comment

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

This looks like a good start! There are a couple things this will need before I can merge though:

  • documentation. See this doc on how to generate a template
  • JSDocs. We've started adding JSDocs with examples to new integrations. See Chroma for an example
  • Formatting/lint. I can see some issues which will cause our formatter to fail this, please run yarn format && yarn lint:fix from libs/langchain-community.

Once these are in, please tag me for a review and I'll check it out again. Thank you!

* @param documents Documents to be added.
* @returns Promise that resolves when the documents have been added.
*/
async addDocuments(documents: Document[], options?: { ids?: string[] }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

For document input arguments, the type should be DocumentInterface, and for return types, Document.

Suggested change
async addDocuments(documents: Document[], options?: { ids?: string[] }) {
async addDocuments(documents: DocumentInterface[], options?: { ids?: string[] }) {

* @returns Promise that resolves to a new instance of FirestoreVectorSearch.
*/
static async fromDocuments(
docs: Document[],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
docs: Document[],
docs: DocumentInterface[],

nit, same as above

*/
async addVectors(
vectors: number[][],
documents: Document[],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
documents: Document[],
documents: DocumentInterface[],

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.

2 participants