お疲れさまでした!

Graph RAG with LangChain and Neo4j

Adam Cowley

Manager, Developer Education at Neo4j

第1章

テキスト ベクトル埋め込み
He's just a city boy born [0.12, -0.34, 0.56, 0.78, ..., -0.91]
born and raised in South Detroit [0.22, 0.45, -0.67, 0.11, ..., 0.33]
He took the midnight train [-0.55, 0.89, 0.12, -0.44, ..., 0.67]
going anywhere [0.78, -0.23, 0.45, 0.91, ..., -0.12]

「Don't Stop Believin'」の歌詞から抽出されたエンティティのグラフ図。スモールタウンの少年に、South DetroitへのBORNとRAISEDの関係がある

Graph RAG with LangChain and Neo4j

第1章

Bookノードと2つのWRITTEN_BY関係を含むノード図。ノードに多くの関係を持てることを示す

Graph RAG with LangChain and Neo4j

第1章

検索結果がプロンプトに挿入され、LLMに送信可能な状態

Graph RAG with LangChain and Neo4j

第2章

文書→ページ→チャンクの階層を示す図。各ページに多数のチャンクノードが紐づく

act_splitter = RecursiveCharacterTextSplitter(
    # Split text into acts
    separators=[ r"\n\nTHE PROLOGUE.",  r"\n\nACT",
                 r"\n\n\*\*\* END"],
    is_separator_regex=True
)

scene_splitter = RecursiveCharacterTextSplitter(
    # Split act into scenes
    separators=[r"\nSCENE "],
    is_separator_regex=True
)
Graph RAG with LangChain and Neo4j

第2章

ノードのテキストプロパティから埋め込みを作成

Graph RAG with LangChain and Neo4j

第2章

ドメイングラフの例。人物が会社で働き、住所に所在。人物はクレジットカードを保持し、そのカードで同一地域の会社に注文がある

Graph RAG with LangChain and Neo4j

第3章

entity_resolution5.jpg

Graph RAG with LangChain and Neo4j

第3章

 

ragas.png

 

  • Context Precision: 取得文書の中で関連チャンクの割合
  • Noise Sensitivity: 取得文書に含まれる無関係情報の量
Graph RAG with LangChain and Neo4j

第3章

Graph RAG with LangChain and Neo4j

graph_academy.png

1 https://graphacademy.neo4j.com/
Graph RAG with LangChain and Neo4j

練習しましょう!

Graph RAG with LangChain and Neo4j

Preparing Video For Download...