Skip to content

DOCSP-49240: Add LangChain semantic cache and Local RAG notebooks #17

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

davidhou17
Copy link
Collaborator

No description provided.

@davidhou17 davidhou17 force-pushed the DOCSP-49240 branch 4 times, most recently from 59e1e36 to 056011d Compare April 15, 2025 15:12
@davidhou17 davidhou17 changed the title DOCSP-49240: LangChain conversation history and semantic cache notebook DOCSP-49240: Add LangChain semantic cache and Local RAG notebooks Apr 15, 2025
Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see a little API improvement here re: creating the vector index with the integration! I've got a question on PyMongo usage in the semantic cache PR here that I'd like to coordinate on before approving.

"# Wait for the index to build (this can take around a minute)\n",
"time.sleep(60)"
" dimensions = 1536, # The dimensions of the vector embeddings to be indexed\n",
" wait_until_complete = 60 # Number of seconds to wait for the index to build (can take around a minute)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo, this is a nice improvement! 🎉

},
"outputs": [],
"source": [
"pip install --quiet --upgrade langchain langchain-community langchain-core langchain-mongodb langchain-openai pymongo"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess a general question here is should we try to specify a specific version of pymongo that complies with the langchain-mongodb integration requirements?

When I run this command, I get the following error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
langgraph-checkpoint-mongodb 0.1.0 requires pymongo<4.10.0,>=4.9.0, but you have pymongo 4.12.0 which is incompatible.

Presumably we could specify a version of PyMongo here that meets with this integration's requirements? (This error didn't actually prevent me from running the Notebook, but as a general practice, we shouldn't put up code that errors.)

Actually, in looking at this code again, I'm not seeing any imports using pymongo. Do we even need it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can safely remove, I'll run this one more time to confirm it's not necessary

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad it works without the separate PyMongo dependency! But I don't see a commit here removing it from this notebook. Does something still need to be pushed here, @davidhou17 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. facepalm. fixed now

@dacharyc

@davidhou17 davidhou17 requested a review from dacharyc April 18, 2025 15:18
@davidhou17
Copy link
Collaborator Author

Confirmed that the notebook ran without pymongo! @dacharyc

Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for removing that unneeded dependency.

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

Successfully merging this pull request may close these issues.

2 participants