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

Switching Loaders / Vectors #58

Open
converseKarl opened this issue May 18, 2024 · 2 comments
Open

Switching Loaders / Vectors #58

converseKarl opened this issue May 18, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@converseKarl
Copy link

converseKarl commented May 18, 2024

If i need to switch a vector, i can switch dynamically based on the setVector and Path settingss and changing these to different values.

The question is, loaders, for example if i wanted to use a defined loader i used with a vector db, how to retrieve or remember it or reload it back when switching from one to other. I have a listLoaders api i wrote, to return me the list, types and id's but if you reload server, they all go. So it's about persisting without have to call the reloaders again such as re-adding web pages once they are in the vector db/llm cache.

If ti can be managed, this way you can potentially have multiple rags, and even build a graph type llm or a simpler router llm at the front of it later to decide which rag to to switch to.

should there be a loadVector/LoadEmbeddings function?

Any advice is appreciated. I think your doing an awesome job, I will try raise that FAISS PR this weekend!

@adhityan
Copy link
Collaborator

Switching vectors is tricky because they need to be initialized. I have been thinking myself also around adding support for multiple RAG sets. One can then set which RAG set to use for which query and can also multiple RAG sets each for a few documents.

However, this complicates the API quiet a bit making it difficult for simpler use cases. Needs more thought this one.

@adhityan adhityan added the enhancement New feature or request label May 19, 2024
@converseKarl
Copy link
Author

converseKarl commented May 19, 2024

Hi there, been thinking too about this, and wanted to share my thoughts and whether this can help and if these scenarios are possible

What I observed today it should be possible to

  1. Create loader intances and track them in memory and switch object of objects or array of objects with a unique rag key
  2. The rag can be switched based on the vector and llm cache on the fly

It's about persistence (i.e. if needed to restart server) and or load the last one that was in use

Is possiblefor the ragbuilder/app instance object state to be somehow stored in some kind of binary o other format, saved to disk, Basically a loader representation no disk

  1. saveLoaderStateToDisk(ragid)
    • saves current state of existing loader updating it
  2. removeLoaderStateFromDisk(ragid)
    • removes loader from disk
  3. switchLoaders(rag id)
    • switches loader from one to other in that current object (if no current loader, simply loads in the specifed loader if exist)
  4. removeAllLoaderStatesFromDisk();
    • removes all stored loaders
  5. getLoaderIntance(rag id) into instance of variable type ragApplication etc (useful for in memory switching) so you could load multiple rags and switch on the go or you could load multiple Rag instances into an object array of rags, This could then be fronted by a LLM router or LLM knowledge Graph to determine which sub rag to use, switch to and query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants