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

Auto generate vectorstore collection on application startup #50

Open
gregogalante opened this issue Mar 2, 2024 · 1 comment
Open

Comments

@gregogalante
Copy link

During installation, I had problems as I expected the collection in the vectorstore to be created automatically.

I would like to propose inserting the auto-generation of the vectorstore in an after_initialize.

Is this a valid solution in your opinion? I can do a PR if you think it is a good solution.

Below is a Proof of Concept of the solution:

module MyRailsApplication
  class Application < Rails::Application
    # ....
    # Run vectorsearch initialization after application is loaded.
    config.after_initialize do
      provider = LangchainrbRails.config.vectorsearch
      default_schema = provider.get_default_schema
      provider.create_default_schema if !default_schema ||  default_schema.dig('status') != 'ok'
    end
  end
end
@gregogalante gregogalante changed the title Auto generate Auto generate vectorstore collection on application startup Mar 2, 2024
@andreibondarev
Copy link
Collaborator

@gregogalante I think it would be a good idea to implement this :)

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

No branches or pull requests

2 participants