Missing steps in documentation #14
Replies: 11 comments 2 replies
-
And of course not a single google result for "LanceDb is not a constructor". Does anyone actually use this project or is it a thought experiment? |
Beta Was this translation helpful? Give feedback.
-
Maybe I'll try HNSWLib instead.
|
Beta Was this translation helpful? Give feedback.
-
It looks like @langchain/community is compatible with [email protected] |
Beta Was this translation helpful? Give feedback.
-
And package "@langchain/community" requires vectordb version 0.1.4 as a peer dependency, while another package "@llm-tools/embedjs" requires vectordb version 0.1.19. |
Beta Was this translation helpful? Give feedback.
-
Hello @GullyTechIO I just responded to your issue and I will try and answer your questions here as well. Here's a few things for benefit -
Note, if you need a version that an open source library does not support already, consider sending in a PR as opposed to demanding urgent updates. This is voluntary unpaid work. Again, since you created a Github account just to critique this library, I am not sure you are familair with opensource already - but, we appreciate people being polite and contributing back. If you really need help installing and getting things working, drop me a note and we can have a call where I can help you get it working. I feel you may be struggling a little bit because of your unfamiliariy with NodeJs but I am happy to help. |
Beta Was this translation helpful? Give feedback.
-
I've installed hnswlib-node Then added this to my ragApplication However I've noticed that the hnswlib-node project does not mention HNSWDb. embedJs/src/vectorDb/hnswlib-db.ts Line 7 in 37c2876 So am I wrong to Whether I do that, or add HNSWDb to the list of objects required from @llm-tools/embedjs, I am still given the same error |
Beta Was this translation helpful? Give feedback.
-
Here's how you should go about it -
I tested this with the example slack bot using Node v20.10.0 just now and everything works fine. The only difference between my setup and yours is I use the import syntax but I don't think that should be an issue as the library is compiled for both formats. |
Beta Was this translation helpful? Give feedback.
-
You should be only using exports from embedJs everywhere. No objects from |
Beta Was this translation helpful? Give feedback.
-
Thanks very much, this is where I am now:
I tried with and without putting "await" before ragApplication.query and I can see that query definitely is in embedJs/src/core/rag-application.ts Line 195 in 37c2876 Is there something else I have to add to the first line to let it recognise the functions of RagApplication objects created by RagApplicationBuilder? I tried
based on embedJs/src/core/rag-application.ts Line 14 in 37c2876 but no change. |
Beta Was this translation helpful? Give feedback.
-
Update! I ditched my efforts and copied parts of commands from examples/simple/src/index.ts
It correctly picked out 10 items from that page and rephrased the headlines. 🥳 |
Beta Was this translation helpful? Give feedback.
-
This is great to hear. Anything I can do to help more? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am following the instructions line by line.
npm i @llm-tools/embedjs
Pick an LLM
const ragApplication = await new RAGApplicationBuilder() .setModel(SIMPLE_MODELS.OPENAI_GPT3_TURBO)
Pick a vector database - ok, how about lanceDB
wow I hope none of that is important
.setVectorDb(new LanceDb({ path: path.resolve('/db') }))
4. Add a loader
.addLoader(new WebLoader({ url: 'https://en.wikipedia.org/wiki/Formula_One' }))
"That's it!"
Cool!
Alright, removed all of the "await"s because this is being run directly.
Here's the first real snag. Documentation doesn't mention this, but Node needs you to import all of the objects you're likely to use. So I try this:
const { RAGApplicationBuilder, WebLoader, YoutubeLoader, SitemapLoader, SIMPLE_MODELS } = require('@llm-tools/embedjs');
Now I need to figure out what CONST function can be used to import LanceDB. So I eventually find this:
const { LanceDb } = require('vectordb');
New error:
What does it mean PATH is not defined? ok, so I add another CONST "const { path } = require('path');"
Not a constructor?? What is it then? Right, time to look at your example scripts to see how you handle it.
Nothing. No examples for lancedb. Let's do a Google search for "setVectorDb(new LanceDb"
Conclusion: This project greatly oversells how easy it is to use.
Beta Was this translation helpful? Give feedback.
All reactions