Skip to content

Graph RAG notebook solution#776

Open
olex-snk wants to merge 9 commits intonew_env_testfrom
graph_rag
Open

Graph RAG notebook solution#776
olex-snk wants to merge 9 commits intonew_env_testfrom
graph_rag

Conversation

@olex-snk
Copy link
Collaborator

@olex-snk olex-snk commented Feb 6, 2026

Added Graph RAG demo solution

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@olex-snk olex-snk requested a review from takumiohym February 6, 2026 01:32
@takumiohym
Copy link
Collaborator

takumiohym commented Feb 6, 2026

Thanks for adding this.

Could you rebase this on new_env_test branch to better isolate the env?
And please merge the requirements to the asl_genai module requirements. @olex-snk

I've done the rebasing.

@takumiohym takumiohym changed the base branch from master to new_env_test February 6, 2026 04:19
@@ -0,0 +1,1075 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 6, 2026

Choose a reason for hiding this comment

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

The graph hasn't been created at this point and this returns NotFound error


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed NotFound error

@olex-snk olex-snk requested a review from takumiohym February 8, 2026 00:50
@olex-snk olex-snk marked this pull request as ready for review February 8, 2026 00:50
@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #1.    from google.cloud import spanner

Move the imports to the top.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved imports to the top

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #4.    from langchain_core.documents import Document

Move the imports to the top.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #2.    !mkdir content

Is this content directory used?


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #4.    from langchain_google_vertexai import ChatVertexAI, VertexAIEmbeddings

Move the imports to the top.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

I think it's clearer to split this cell into multiple cells and reorder a bit, splitting the definition and execution.


Reply via ReviewNB

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #4.    from langchain_google_vertexai import VertexAIEmbeddings

Move the imports to the top.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #43.    print(textwrap.fill(answer, width=80))

On my end the retrieval and output didn't pick up the battery and the answer wasn't very different from conventional RAG. Better to use another query?


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This dataset is currently too small to show meaningful improvements over vanilla RAG. We might swap this out for a more complex dataset later

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Line #5.    from langchain_text_splitters import RecursiveCharacterTextSplitter

Move the imports to the top.


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,1091 @@
{
Copy link
Collaborator

@takumiohym takumiohym Feb 9, 2026

Choose a reason for hiding this comment

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

Overall, I think it's better to add more Markdown explanations for each cell, clarifying each step.


Reply via ReviewNB

@olex-snk olex-snk self-assigned this Feb 26, 2026
@olex-snk olex-snk requested a review from takumiohym February 26, 2026 14:01
@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Description is not a complete sentence.

And the cell below is just a download, not adding graph document.


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Add description


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Add detailed description. This should be a very important cell.

Probably better to split it into multiple cells, and explain each operation one by one.


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Add more description on what kind of post-processes and clean ups are done here


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

It's saying THIS COULD REMOVE DATA FROM YOUR DATABASE !!! but what exactly the reader need to be careful?

What are the previous iterations?


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Describe what readers should take a look at in the visualization. Describe the instruction more explicitly.


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

What elements should the prompt contain? Explain it more in detail.


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

I'd move this after use_node_vector_retriever


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Explain what kind of utility method it is


Reply via ReviewNB

@@ -0,0 +1,1129 @@
{
Copy link
Collaborator

@takumiohym takumiohym Mar 3, 2026

Choose a reason for hiding this comment

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

Could you not use header syntax (#) for sentence? Please write title for each section, and use plain text for descriptions.


Reply via ReviewNB

@takumiohym
Copy link
Collaborator

takumiohym commented Mar 3, 2026

Code looks good, but please write more detailed descriptions for each cell and operation.

And please organize chapters with header syntax (#) properly. The current toc isn't easily understandable.
image

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