Skip to content

Commit 5166bea

Browse files
INTPYTHON-501 INTPYTHON-784 Create Graph Visualizations for GraphRAG (#235)
[INTPYTHON-501](https://jira.mongodb.org/browse/{INTPYTHON-501}) [INTPYTHON-784](https://jira.mongodb.org/browse/{INTPYTHON-784}) ## Summary <!-- What is this PR introducing? If context is already provided from the JIRA ticket, still place it in the Pull Request as you should not make the reviewer do digging for a basic summary. --> This PR adds graphical visualization of our MongoDBGraphStore, used for Knowledge Graphs and Graph RAG. It also adds an example notebook, and improvements to the prompting. ## Changes in this PR <!-- What changes did you make to the code? What new APIs (public or private) were added, removed, or edited to generate the desired outcome explained in the above summary? --> * New methods `view` and `to_networkx` methods to MongoDBGraphStore. * Our first example notebook in langchain-mongodb/libs/langchain-mongodb/examples/GraphRAG.ipynb. * Improvements to the prompt examples. * A new optional dependency group "viz". ## Test Plan <!-- How did you test the code? If you added unit tests, you can say that. If you didn’t introduce unit tests, explain why. All code should be tested in some way – so please list what your validation strategy was. --> Unit tests were added for the new methods. Typing tests were run. The notebooks was demonstrated numerous times to the maintainers and stakeholders. ## Checklist <!-- Do not delete the items provided on this checklist --> ### Checklist for Author - [x] Did you update the changelog (if necessary)? - [x] Is the intention of the code captured in relevant tests? - [ ] If there are new TODOs, has a related JIRA ticket been created? - [x] Has a MongoDB Employee run [the patch build of this PR](https://github.com/mongodb-labs/ai-ml-pipeline-testing?tab=readme-ov-file#running-a-patch-build-of-a-given-pr)? ### Checklist for Reviewer {@primary_reviewer} - [ ] Does the title of the PR reference a JIRA Ticket? - [ ] Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?) - [ ] Have you checked for spelling & grammar errors? - [ ] Is all relevant documentation (README or docstring) updated? ## Focus Areas for Reviewer (optional) <!-- List any complex portion of code you believe needs particular scrutiny and explain why. -->
1 parent 052e078 commit 5166bea

File tree

13 files changed

+5321
-2758
lines changed

13 files changed

+5321
-2758
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ __pycache__
66
.env
77
.venv*
88
.local_atlas_uri
9+
.ipynb_checkpoints
910
docs/langchain_mongodb
1011
docs/langgraph_checkpoint_mongodb
1112
docs/index.md

libs/langchain-mongodb/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)