util/convex is not exported by package "langchain"

I have this error. I use tutorial for some llm staff. i need create in folder convex - folder langchain and write this code
export * from "langchain/util/convex";
export * from "langchain/util/convex";
but i have problem - Cannot find module 'langchain/util/convex' or its corresponding type declarations.ts(2307)
23 Replies
v
v6mo ago
Do you have langchain community installed
erquhart
erquhart6mo ago
I think langchain automatically installs that should just need to npm i langchain hmm maybe not looking at the source
Yevhenii TS,React,Next js
yes. i look in folder langchain/util and dont see file this name convex
erquhart
erquhart6mo ago
it would be in your node_modules, not your project source
Yevhenii TS,React,Next js
yes, i know
erquhart
erquhart6mo ago
I think v is right, you'll need to install @langchain/community explicitly, just curious why the convex tutorial and example repo doesn't mention this
v
v6mo ago
I'm going to boot up on PC and see
Yevhenii TS,React,Next js
i install langchain and langchain/community too
"@langchain/community": "^0.2.20",
"@langchain/openai": "^0.2.4",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-slot": "^1.1.0",
"ai": "^3.2.35",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"convex": "^1.13.2",
"langchain": "^0.2.10",
"lucide-react": "^0.414.0",
"next": "14.2.4",
"react": "^18",
"react-dom": "^18",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"

"@langchain/community": "^0.2.20",
"@langchain/openai": "^0.2.4",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-slot": "^1.1.0",
"ai": "^3.2.35",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"convex": "^1.13.2",
"langchain": "^0.2.10",
"lucide-react": "^0.414.0",
"next": "14.2.4",
"react": "^18",
"react-dom": "^18",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"

v
v6mo ago
Hmmm
Michal Srb
Michal Srb6mo ago
If this is broken in recent langchain version you could downgrade to the version used in our demos: "langchain": "0.0.189", https://github.com/get-convex/convex-ai-chat-langchain
GitHub
GitHub - get-convex/convex-ai-chat-langchain: AI chat with context ...
AI chat with context retrieval using Convex and LangChain - get-convex/convex-ai-chat-langchain
erquhart
erquhart6mo ago
That's package locked directly to 0.0.189, I believe that semver range will currently resolve to latest (0.2), which has this issue. May need to pin 0.0.189. But pretty sure it's not broken, just dependencies have moved.
Yevhenii TS,React,Next js
maybe changed path
erquhart
erquhart6mo ago
@Yevhenii TS,React,Next js try export * from '@langchain/community/util/convex actually it's "utils", plural
v
v6mo ago
No description
v
v6mo ago
export * from "@langchain/community/utils/convex"; does this not work for you?
Yevhenii TS,React,Next js
yes . thx. convex should fix docs
v
v6mo ago
also langchain also erquhart said this first i was just repeating what he said, hes the goat
Yevhenii TS,React,Next js
thx for help) thanks guys, now my app working. convex and langchain fix this pls
v
v6mo ago
i made an issue on the langchain github ig i could make a pr
v
v6mo ago
Convex | 🦜️🔗 Langchain
LangChain.js supports Convex as a vector store, and supports the standard similarity search.
ian
ian6mo ago
I put up a PR to update the template repo - anyone care to see if I missed anything? https://github.com/get-convex/convex-ai-chat-langchain/pull/3
GitHub
Upgrade by ianmacartney · Pull Request #3 · get-convex/convex-ai-ch...
Seems to be working with latest langchain By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Did you find this page helpful?