davidmigloz / langchain_dart

Build LLM-powered Dart/Flutter applications.
https://langchaindart.dev
MIT License
426 stars 75 forks source link

Improve Retrieval documentation #465

Closed ScottS2017 closed 4 months ago

ScottS2017 commented 5 months ago

System Info

In the Retrieval tutorial here, in the first code block it says:

final vectorStore = Chroma(embeddings: embeddings);

Error: "The method 'Chroma' isn't defined..."

Solution: Change Chroma to MemoryVectorStore.

I would just put in a PR but it's a website issue, not a package issue.

Related Components

Reproduction

Follow the instructions in the tutorial at https://langchaindart.dev/#/expression_language/cookbook/retrieval

Expected behavior

No error saying the method (actually class) doesn't exist.

davidmigloz commented 5 months ago

Hey @ScottS2017 ,

Nice to see you here 🙂

Chroma is actually one of the vector stores we support. It's part of the langchain_chroma package (I'll update the tutorial to mention that you need to add the langchain_chroma package).

The MemoryVectorStore is mainly for prototyping, as it keeps all the vectors in memory and brute-forces similarity. If you want to use a more scalable embedded vector store, I recommend you check the ObjectBox integration.

(it's on my TODO list to create a better overview of all the integrations we currently support and in which package they are...)

Vector stores that we currently support:

davidmigloz commented 5 months ago

By the way, the langchaindart.dev documentation is also in this repo, in case you want to send some PR in the future:

(I need to spend some more time on the docs, they are not very up-to-date at the moment. So any help is really appreciated 🙂)

ScottS2017 commented 5 months ago

A quick workaround might be something like this at the start of every tutorial section page. It will tell users they might find what they need in other packages, instead of having them think the classes they need were simply deprecated and deleted:

// NOTE: Many things in langchain_dart are changing quickly. If your IDE shows an error and asks you to make a class for the error, try some of the langchain_dart packages on pub. EG: Loaders are now in the langchain_community package. There are several others, just a few of them are: // langchain // langchain_core // langchain_chroma // langchain_community // langchain_google // langchain_mistralai // langchain_ollama // langchain_openai

davidmigloz commented 4 months ago

Closing this issue in favour of https://github.com/davidmigloz/langchain_dart/issues/466