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

Improve performance of NeptuneAnalyticsGraph #311

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

michaelnchin
Copy link
Contributor

@michaelnchin michaelnchin commented Dec 19, 2024

Improved the graph schema retrieval performance of NeptuneAnalyticsGraph by using the pg_schema algorithm.

Before:
Screenshot 2024-12-18 at 8 59 02 PM
After:
Screenshot 2024-12-18 at 8 59 33 PM

@3coins
Copy link
Collaborator

3coins commented Dec 19, 2024

cc @krlawrence
cc @bechbd

Copy link
Collaborator

@3coins 3coins left a comment

Choose a reason for hiding this comment

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

@michaelnchin
Thanks for this performance improvement 🚀. Code looks good, but would be great if one of @krlawrence or @bechbd can review.

One small question, would users need an option within NeptuneOpenCypherQAChain and NeptuneSparqlQAChain to allow them to switch to a False in any scenario?

@michaelnchin
Copy link
Contributor Author

Yes, I think users should be able to control this from the chain level also - will add separate options there.

@bechbd
Copy link

bechbd commented Dec 19, 2024

Along the same note, is there any reason to keep around the old method for an NA graph? From the end user perspective this should still give the same (or better) result.

@michaelnchin
Copy link
Contributor Author

Discussed offline with @bechbd. While the pg_schema algorithm is a brand new feature, all Neptune Analytics graph instances are automatically upgraded to the newest version, and should therefore support it.

Since there are no concerns around backwards compatibility, we will revise this PR to always use pg_schema for graph schema retrieval.

@3coins 3coins merged commit 30c7894 into langchain-ai:main Dec 20, 2024
12 checks passed
@michaelnchin michaelnchin deleted the neptune-analytics-schema branch December 20, 2024 21:33
@krlawrence
Copy link

I took a quick and had no major comments. Thanks for making this improvement.

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.

4 participants