import{s as en,n as tn,o as nn}from"../chunks/scheduler.e0212c12.js";import{S as sn,i as Un,e as a,s,c as J,h as an,a as i,d as t,b as U,f as ln,g as M,j as p,k as Jt,l as pn,m as n,n as T,t as C,o as y,p as m}from"../chunks/index.a585a37c.js";import{C as Jn,H as Q,E as Mn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.3d07a257.js";import{D as Tn,C as V}from"../chunks/DocNotebookDropdown.7c42a056.js";function Cn(Mt){let h,Ol,vl,Al,o,_l,w,Dl,j,Gl,c,Tt='<em>작성자: <a href="https://github.com/dcarpintero" rel="nofollow">Diego Carpintero</a>, 번역: <a href="https://github.com/nuatmochoi" rel="nofollow">최성우</a></em>',Hl,f,Ct="지식 그래프는 상호 연결된 정보를 사람과 기계 모두가 이해할 수 있는 형식으로 모델링하고 저장하는 방법을 제공합니다. 이러한 그래프는 엔티티와 그들의 관계를 나타내는 <em>노드</em>와 <em>엣지</em>로 구성됩니다. 전통적인 데이터베이스와 달리, 그래프의 본질적인 표현력은 더 풍부한 의미론적 이해를 가능하게 하며, 고정된 스키마에 제약받지 않고 새로운 엔티티 유형과 관계를 수용할 수 있는 유연성을 제공합니다.",Ll,E,yt="지식 그래프를 임베딩(벡터 검색)과 결합함으로써, <em>다중 홉 연결성</em>과 <em>정보의 맥락적 이해</em>를 활용하여 LLM의 추론과 설명 가능성을 향상시킬 수 있습니다.",Wl,R,mt="이 노트북은 이 접근 방식의 실제 구현을 탐구하며, 다음과 같은 방법을 보여줍니다.",Zl,u,Vt='<li>합성 데이터셋을 사용하여 <a href="https://neo4j.com/docs/" rel="nofollow">Neo4j</a>에서 연구 출판물 관련 지식 그래프 구축</li> <li><a href="https://python.langchain.com/v0.2/docs/integrations/text_embedding/" rel="nofollow">임베딩 모델</a>을 사용하여 데이터 필드의 일부를 고차원 벡터 공간으로 투영</li> <li>유사도 검색을 가능하게 하는 임베딩에 대한 벡터 인덱스 구축</li> <li><a href="https://python.langchain.com/v0.2/docs/introduction/" rel="nofollow">LangChain</a>을 사용하여 사용자 쿼리를 <a href="https://neo4j.com/docs/cypher-manual/current/introduction/" rel="nofollow">cypher</a> 문으로 쉽게 변환하여 자연어로 그래프에서 인사이트 추출</li>',Xl,r,Qt='<img src="https://raw.githubusercontent.com/dcarpintero/generative-ai-101/main/static/knowledge-graphs.png"/>',Yl,I,Pl,g,zl,$,ql,F,ht='그래프 데이터베이스 기술을 전문으로 하는 오픈 소스 데이터베이스 관리 시스템인 <a href="https://neo4j.com/docs/" rel="nofollow">Neo4j</a>를 사용하여 지식 그래프를 생성할 것입니다.',Kl,b,rt='빠르고 쉬운 설정을 위해 <a href="https://neo4j.com/product/auradb/" rel="nofollow">Neo4j Aura</a>에서 무료 인스턴스를 시작할 수 있습니다.',le,N,ot="그런 다음 <code>.env</code> 파일을 사용하여 <code>NEO4J_URI</code>, <code>NEO4J_USERNAME</code>, 및 <code>NEO4J_PASSWORD</code>를 환경 변수로 설정할 수 있습니다.",ee,d,te,S,wt="Langchain은 Neo4j와 상호 작용하기 위한 <code>Neo4jGraph</code> 클래스를 제공합니다.",ne,k,se,B,Ue,v,jt='아래 예제는 <code>Neo4j</code> 데이터베이스와 연결을 생성하고 연구 논문과 저자로 구성된 <a href="https://github.com/dcarpintero/generative-ai-101/blob/main/dataset/synthetic_articles.csv" rel="nofollow">합성 데이터</a>로 채웁니다.',ae,x,ct="엔티티는 다음과 같습니다.",ie,O,ft="<li><em>연구원</em></li> <li><em>논문</em></li> <li><em>주제</em></li>",pe,A,Et="관계는 다음과 같습니다.",Je,_,Rt="<li><em>연구원</em> —[출판하다]—&gt; <em>논문</em></li> <li><em>논문</em> —[주제이다]—&gt; <em>주제</em></li>",Me,D,Te,G,ut="노드와 관계가 올바르게 초기화되었는지 확인해 봅시다.",Ce,H,ye,L,It=`Node properties:
논문 &#123;제목: STRING, 초록: STRING, 출판일: DATE, embedding: LIST}
연구원 &#123;이름: STRING}
주제 &#123;이름: STRING}
Relationship properties:

The relationships:
(:논문)-[:주제이다]->(:주제)
(:연구원)-[:출판하다]->(:논문)
`,me,W,gt="지식 그래프는 Neo4j 작업 공간에서 검사할 수 있습니다.",Ve,Z,$t='<img src="attachment:image.png" alt="image.png"/>',Qe,X,he,Y,Ft="이제 <em>주제, 제목, 초록</em>을 기반으로 관련 <em>논문</em>을 효율적으로 검색하기 위한 벡터 인덱스를 구축합니다. 이 과정에는 이러한 필드를 사용하여 각 논문의 임베딩을 계산하는 것이 포함됩니다. 쿼리 시, 시스템은 코사인 거리와 같은 유사도 메트릭을 사용하여 사용자 입력과 가장 유사한 논문을 찾습니다.",re,P,oe,z,bt='<strong>참고</strong>: OpenAI 임베딩 모델에 접근하려면 OpenAI 계정을 만들고 API 키를 받아 <code>OPENAI_API_KEY</code>를 환경 변수로 설정해야 합니다. 다른 <a href="https://python.langchain.com/v0.2/docs/integrations/text_embedding/" rel="nofollow">임베딩 모델</a> 통합을 실험해 보는 것도 유용할 수 있습니다.',we,q,je,K,Nt="<code>Langchain RetrievalQA</code>는 위의 벡터 인덱스를 검색기로 사용하는 질문-답변(QA) 체인을 생성합니다.",ce,ll,fe,el,dt="’<em>AI가 우리의 일상 생활에 어떤 영향을 미칠 수 있는지 논의하는 논문은 어떤 것들이 있나요?</em>‘라고 물어봅시다.",Ee,tl,Re,nl,St=`주제: AI의 영향

1. 제목: The Impact of AI on Employment: A Comprehensive Study
   - 초록: 이 연구는 AI가 다양한 직업 부문에 미칠 수 있는 잠재적 영향을 분석하고 부정적 영향을 완화하기 위한 정책 권고를 제안합니다.

2. 제목: The Societal Implications of Advanced AI: A Multidisciplinary Analysis
   - 초록: 우리의 연구는 다양한 분야의 전문가들을 모아 고급 AI가 사회, 경제, 문화에 미칠 잠재적인 장기적 영향을 분석합니다.

3. 제목: The Role of AI in Combating Climate Change: Opportunities and Challenges
   - 초록: 우리의 연구는 AI가 기후 변화 대처에 어떻게 활용될 수 있는지 탐구하며 잠재적 이점과 관련된 윤리적 고려사항을 논의합니다.

4. 제목: Ethical Considerations in AI Development
   - 초록: 우리는 고속으로 진행되고 있는 AI 발전의 윤리적 함의를 탐구하고 책임있는 개발을 위한 지침을 제안합니다.
`,ue,sl,Ie,Ul,kt="지식 그래프는 엔티티 간의 연결을 만드는 데 탁월하여 패턴을 추출하고 새로운 인사이트를 발견할 수 있게 합니다.",ge,al,Bt="이 섹션에서는 이 프로세스를 구현하고 자연어 쿼리를 사용하여 LLM 파이프라인에 결과를 통합하는 방법을 보여줍니다.",$e,il,Fe,pl,vt="표현력 있고 효율적인 쿼리를 구성하기 위해 <code>Neo4j</code>는 SQL에서 영감을 받은 선언적 쿼리 언어인 <code>Cypher</code>를 사용합니다. <code>LangChain</code>은 <code>GraphCypherQAChain</code> 래퍼를 제공하여 자연어를 사용해 그래프 데이터베이스를 쿼리할 수 있게 하는 추상화 계층을 제공하여 LLM 파이프라인에 그래프 기반 데이터 검색을 더 쉽게 통합할 수 있게 합니다.",be,Jl,xt="실제로 <code>GraphCypherQAChain</code>은:",Ne,Ml,Ot="<li>맥락 내 학습(프롬프트 엔지니어링)을 적용하여 사용자 입력(자연어)에서 Cypher 문(Neo4j와 같은 그래프 데이터베이스용 쿼리)을 생성하고,</li> <li>해당 문을 그래프 데이터베이스에 대해 실행하며,</li> <li>LLM 응답을 정확하고 최신 정보로 뒷받침하기 위해 결과를 컨텍스트로 제공합니다.</li>",de,Tl,At="<strong>참고</strong>: 이 구현에는 모델이 생성한 그래프 쿼리를 실행하는 것이 포함되어 있어, 데이터베이스의 민감한 데이터에 대한 의도하지 않은 접근이나 수정과 같은 고유한 위험이 있습니다. 이러한 위험을 완화하기 위해 데이터베이스 연결 권한을 체인/에이전트의 특정 요구 사항을 충족하는 데 필요한 최소한으로 제한해야 합니다. 이 접근 방식은 위험을 줄이지만 완전히 제거하지는 않습니다.",Se,Cl,ke,yl,Be,ml,_t="다음 예제에서 cypher 쿼리 실행 결과가 LLM에 컨텍스트로 제공되는 방식에 주목하세요.",ve,Vl,xe,Ql,Dt="이 예제에서 우리의 질문 ’<em>Emily Chen이 발표한 논문은 몇 편인가요?</em>‘는 다음과 같은 Cypher 쿼리로 변환됩니다.",Oe,hl,Ae,rl,Gt="이 쿼리는 이름이 ‘Emily Chen’인 <code>연구원</code> 레이블이 있는 노드를 매칭하고 <code>출판하다</code> 관계를 통해 <code>논문</code> 노드로 이동합니다. 그런 다음 ‘Emily Chen’과 연결된 <code>논문</code> 노드의 수를 계산합니다.",_e,ol,Ht='<img src="attachment:image.png" alt="image.png"/>',De,wl,Ge,jl,Lt=`\x1B[1m> Entering new GraphCypherQAChain chain...\x1B[0m
Generated Cypher:
\x1B[32;1m\x1B[1;3mcypher
MATCH (:연구원 &#123;이름: "Emily Chen"})-[:출판하다]->(n:논문)
RETURN COUNT(n) AS 논문_수
\x1B[0m
Full Context:
\x1B[32;1m\x1B[1;3m[&#123;'논문_수': 7}]\x1B[0m

\x1B[1m> Finished chain.\x1B[0m
`,He,cl,Le,fl,Wt="이 예제에서 ’<em>3편보다 많은 논문을 함께 발표한 연구원 쌍을 알려주세요.</em>‘라는 쿼리는 다음과 같은 Cypher 쿼리로 변환됩니다.",We,El,Ze,Rl,Zt="이 쿼리는 <code>연구원</code> 노드에서 <code>출판하다</code> 관계를 통해 연결된 <code>논문</code> 노드를 찾고, 다시 <code>연구원</code> 쌍을 찾기 위해 역으로 이동합니다.",Xe,ul,Xt='<img src="attachment:image.png" alt="image.png"/>',Ye,Il,Pe,gl,Yt=`\x1B[1m> Entering new GraphCypherQAChain chain...\x1B[0m
Generated Cypher:
\x1B[32;1m\x1B[1;3mcypher
MATCH (r1:연구원)-[:출판하다]->(p:논문)<-[:출판하다]-(r2:연구원)
WHERE r1 <> r2
WITH r1, r2, COUNT(p) AS 논문수
WHERE 논문수 > 3
RETURN r1.이름 AS 연구원1, r2.이름 AS 연구원2, 논문수
\x1B[0m
Full Context:
\x1B[32;1m\x1B[1;3m[&#123;'연구원1': 'David Johnson', '연구원2': 'Emily Chen', '논문수': 4}, &#123;'연구원1': 'Robert Taylor', '연구원2': 'Emily Chen', '논문수': 4}, &#123;'연구원1': 'Emily Chen', '연구원2': 'David Johnson', '논문수': 4}, &#123;'연구원1': 'Emily Chen', '연구원2': 'Robert Taylor', '논문수': 4}]\x1B[0m

\x1B[1m> Finished chain.\x1B[0m
`,ze,$l,qe,Fl,Pt="가장 많은 동료와 협업한 연구자를 찾아봅시다. 우리의 쿼리 ’<em>가장 많은 동료와 협업한 연구원은 누구인가요?</em>‘는 이제 다음과 같은 Cypher 쿼리로 변환됩니다.",Ke,bl,lt,Nl,zt="여기서는 모든 <code>연구원</code> 노드에서 시작하여 그들의 <code>출판하다</code> 관계를 통해 연결된 <code>논문</code> 노드를 찾습니다. 각 <code>논문</code> 노드에 대해 Neo4j는 다시 동일한 논문을 발표한 다른 <code>연구원</code> 노드를 찾기 위해 역으로 이동합니다.",et,dl,qt='<img src="attachment:image.png" alt="image.png"/>',tt,Sl,nt,kl,Kt=`\x1B[1m> Entering new GraphCypherQAChain chain...\x1B[0m
Generated Cypher:
\x1B[32;1m\x1B[1;3mcypher
MATCH (r:연구원)-[:출판하다]->(:논문)<-[:출판하다]-(coauthor:연구원)
WHERE r <> coauthor
RETURN r.이름 AS 연구원, COUNT(DISTINCT coauthor) AS 동료수
ORDER BY 동료수 DESC
LIMIT 1
\x1B[0m
Full Context:
\x1B[32;1m\x1B[1;3m[&#123;'연구원': 'David Johnson', '동료수': 6}]\x1B[0m

\x1B[1m> Finished chain.\x1B[0m
`,st,Ut,at,Bl,it,xl,pt;return o=new Tn({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/ko/ko_rag_with_knowledge_graphs_neo4j.ipynb"}]}}),w=new Jn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),j=new Q({props:{title:"지식 그래프를 활용한 RAG 추론 향상",local:"지식-그래프를-활용한-rag-추론-향상",headingTag:"h1"}}),I=new Q({props:{title:"초기화",local:"초기화",headingTag:"h2"}}),g=new V({props:{code:"JTI1cGlwJTIwaW5zdGFsbCUyMG5lbzRqJTIwbGFuZ2NoYWluJTIwbGFuZ2NoYWluX29wZW5haSUyMGxhbmdjaGFpbi1jb21tdW5pdHklMjBweXRob24tZG90ZW52JTIwLS1xdWlldA==",highlighted:"%pip install neo4j langchain langchain_openai langchain-community python-dotenv --quiet",wrap:!1}}),$=new Q({props:{title:"Neo4j 인스턴스 설정",local:"neo4j-인스턴스-설정",headingTag:"h3"}}),d=new V({props:{code:"aW1wb3J0JTIwZG90ZW52JTBBZG90ZW52LmxvYWRfZG90ZW52KCcuZW52JyUyQyUyMG92ZXJyaWRlJTNEVHJ1ZSk=",highlighted:`<span class="hljs-keyword">import</span> dotenv
dotenv.load_dotenv(<span class="hljs-string">&#x27;.env&#x27;</span>, override=<span class="hljs-literal">True</span>)`,wrap:!1}}),k=new V({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwbGFuZ2NoYWluX2NvbW11bml0eS5ncmFwaHMlMjBpbXBvcnQlMjBOZW80akdyYXBoJTBBJTBBZ3JhcGglMjAlM0QlMjBOZW80akdyYXBoKCUwQSUyMCUyMCUyMCUyMHVybCUzRG9zLmVudmlyb24lNUInTkVPNEpfVVJJJyU1RCUyQyUyMCUwQSUyMCUyMCUyMCUyMHVzZXJuYW1lJTNEb3MuZW52aXJvbiU1QidORU80Sl9VU0VSTkFNRSclNUQlMkMlMEElMjAlMjAlMjAlMjBwYXNzd29yZCUzRG9zLmVudmlyb24lNUInTkVPNEpfUEFTU1dPUkQnJTVEJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> langchain_community.graphs <span class="hljs-keyword">import</span> Neo4jGraph

graph = Neo4jGraph(
    url=os.environ[<span class="hljs-string">&#x27;NEO4J_URI&#x27;</span>], 
    username=os.environ[<span class="hljs-string">&#x27;NEO4J_USERNAME&#x27;</span>],
    password=os.environ[<span class="hljs-string">&#x27;NEO4J_PASSWORD&#x27;</span>],
)`,wrap:!1}}),B=new Q({props:{title:"데이터셋을 그래프로 로딩",local:"데이터셋을-그래프로-로딩",headingTag:"h3"}}),D=new V({props:{code:"ZnJvbSUyMGxhbmdjaGFpbl9jb21tdW5pdHkuZ3JhcGhzJTIwaW1wb3J0JTIwTmVvNGpHcmFwaCUwQSUwQWdyYXBoJTIwJTNEJTIwTmVvNGpHcmFwaCgpJTBBJTBBcV9sb2FkX2FydGljbGVzJTIwJTNEJTIwJTIyJTIyJTIyJTBBTE9BRCUyMENTViUyMFdJVEglMjBIRUFERVJTJTBBRlJPTSUyMCdodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZkY2FycGludGVybyUyRmdlbmVyYXRpdmUtYWktMTAxJTJGbWFpbiUyRmRhdGFzZXQlMkZzeW50aGV0aWNfYXJ0aWNsZXMuY3N2JyUyMCUwQUFTJTIwJUVEJTk2JTg5JTIwJTBBRklFTERURVJNSU5BVE9SJTIwJyUzQiclMEFNRVJHRSUyMChhJTNBJUVCJTg1JUJDJUVCJUFDJUI4JTIwJTdCJUVDJUEwJTlDJUVCJUFBJUE5JTNBJUVEJTk2JTg5LlRpdGxlJTdEKSUwQVNFVCUyMGEuJUVDJUI0JTg4JUVCJUExJTlEJTIwJTNEJTIwJUVEJTk2JTg5LkFic3RyYWN0JTJDJTBBJTIwJTIwJTIwJTIwYS4lRUMlQjYlOUMlRUQlOEMlOTAlRUMlOUQlQkMlMjAlM0QlMjBkYXRlKCVFRCU5NiU4OS5QdWJsaWNhdGlvbl9EYXRlKSUwQUZPUkVBQ0glMjAoJUVDJTk3JUIwJUVBJUI1JUFDJUVDJTlFJTkwJTIwaW4lMjBzcGxpdCglRUQlOTYlODkuQXV0aG9ycyUyQyUyMCclMkMnKSUyMCU3QyUyMCUwQSUyMCUyMCUyMCUyME1FUkdFJTIwKHAlM0ElRUMlOTclQjAlRUElQjUlQUMlRUMlOUIlOTAlMjAlN0IlRUMlOUQlQjQlRUIlQTYlODQlM0F0cmltKCVFQyU5NyVCMCVFQSVCNSVBQyVFQyU5RSU5MCklN0QpJTBBJTIwJTIwJTIwJTIwTUVSR0UlMjAocCktJTVCJTNBJUVDJUI2JTlDJUVEJThDJTkwJUVEJTk1JTk4JUVCJThCJUE0JTVELSUzRShhKSklMEFGT1JFQUNIJTIwKCVFQyVBMyVCQyVFQyVBMCU5QyUyMGluJTIwJTVCJUVEJTk2JTg5LlRvcGljJTVEJTIwJTdDJTIwJTBBJTIwJTIwJTIwJTIwTUVSR0UlMjAodCUzQSVFQyVBMyVCQyVFQyVBMCU5QyUyMCU3QiVFQyU5RCVCNCVFQiVBNiU4NCUzQXRyaW0oJUVDJUEzJUJDJUVDJUEwJTlDKSU3RCklMEElMjAlMjAlMjAlMjBNRVJHRSUyMChhKS0lNUIlM0ElRUMlQTMlQkMlRUMlQTAlOUMlRUMlOUQlQjQlRUIlOEIlQTQlNUQtJTNFKHQpKSUwQSUyMiUyMiUyMiUwQSUwQWdyYXBoLnF1ZXJ5KHFfbG9hZF9hcnRpY2xlcyk=",highlighted:`<span class="hljs-keyword">from</span> langchain_community.graphs <span class="hljs-keyword">import</span> Neo4jGraph

graph = Neo4jGraph()

q_load_articles = <span class="hljs-string">&quot;&quot;&quot;
LOAD CSV WITH HEADERS
FROM &#x27;https://raw.githubusercontent.com/dcarpintero/generative-ai-101/main/dataset/synthetic_articles.csv&#x27; 
AS 행 
FIELDTERMINATOR &#x27;;&#x27;
MERGE (a:논문 {제목:행.Title})
SET a.초록 = 행.Abstract,
    a.출판일 = date(행.Publication_Date)
FOREACH (연구자 in split(행.Authors, &#x27;,&#x27;) | 
    MERGE (p:연구원 {이름:trim(연구자)})
    MERGE (p)-[:출판하다]-&gt;(a))
FOREACH (주제 in [행.Topic] | 
    MERGE (t:주제 {이름:trim(주제)})
    MERGE (a)-[:주제이다]-&gt;(t))
&quot;&quot;&quot;</span>

graph.query(q_load_articles)`,wrap:!1}}),H=new V({props:{code:"Z3JhcGgucmVmcmVzaF9zY2hlbWEoKSUwQXByaW50KGdyYXBoLmdldF9zY2hlbWEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>graph.refresh_schema()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(graph.get_schema)`,wrap:!1}}),X=new Q({props:{title:"벡터 인덱스 구축",local:"벡터-인덱스-구축",headingTag:"h3"}}),P=new V({props:{code:"ZnJvbSUyMGxhbmdjaGFpbl9jb21tdW5pdHkudmVjdG9yc3RvcmVzJTIwaW1wb3J0JTIwTmVvNGpWZWN0b3IlMEFmcm9tJTIwbGFuZ2NoYWluX29wZW5haSUyMGltcG9ydCUyME9wZW5BSUVtYmVkZGluZ3MlMEElMEF2ZWN0b3JfaW5kZXglMjAlM0QlMjBOZW80alZlY3Rvci5mcm9tX2V4aXN0aW5nX2dyYXBoKCUwQSUyMCUyMCUyMCUyME9wZW5BSUVtYmVkZGluZ3MoKSUyQyUwQSUyMCUyMCUyMCUyMHVybCUzRG9zLmVudmlyb24lNUInTkVPNEpfVVJJJyU1RCUyQyUwQSUyMCUyMCUyMCUyMHVzZXJuYW1lJTNEb3MuZW52aXJvbiU1QidORU80Sl9VU0VSTkFNRSclNUQlMkMlMEElMjAlMjAlMjAlMjBwYXNzd29yZCUzRG9zLmVudmlyb24lNUInTkVPNEpfUEFTU1dPUkQnJTVEJTJDJTBBJTIwJTIwJTIwJTIwaW5kZXhfbmFtZSUzRCclRUIlODUlQkMlRUIlQUMlQjgnJTJDJTBBJTIwJTIwJTIwJTIwbm9kZV9sYWJlbCUzRCUyMiVFQiU4NSVCQyVFQiVBQyVCOCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRleHRfbm9kZV9wcm9wZXJ0aWVzJTNEJTVCJyVFQyVBMyVCQyVFQyVBMCU5QyclMkMlMjAnJUVDJUEwJTlDJUVCJUFBJUE5JyUyQyUyMCclRUMlQjQlODglRUIlQTElOUQnJTVEJTJDJTBBJTIwJTIwJTIwJTIwZW1iZWRkaW5nX25vZGVfcHJvcGVydHklM0QnZW1iZWRkaW5nJyUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> langchain_community.vectorstores <span class="hljs-keyword">import</span> Neo4jVector
<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> OpenAIEmbeddings

vector_index = Neo4jVector.from_existing_graph(
    OpenAIEmbeddings(),
    url=os.environ[<span class="hljs-string">&#x27;NEO4J_URI&#x27;</span>],
    username=os.environ[<span class="hljs-string">&#x27;NEO4J_USERNAME&#x27;</span>],
    password=os.environ[<span class="hljs-string">&#x27;NEO4J_PASSWORD&#x27;</span>],
    index_name=<span class="hljs-string">&#x27;논문&#x27;</span>,
    node_label=<span class="hljs-string">&quot;논문&quot;</span>,
    text_node_properties=[<span class="hljs-string">&#x27;주제&#x27;</span>, <span class="hljs-string">&#x27;제목&#x27;</span>, <span class="hljs-string">&#x27;초록&#x27;</span>],
    embedding_node_property=<span class="hljs-string">&#x27;embedding&#x27;</span>,
)`,wrap:!1}}),q=new Q({props:{title:"유사도 기반 Q&A",local:"유사도-기반-qa",headingTag:"h2"}}),ll=new V({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi5jaGFpbnMlMjBpbXBvcnQlMjBSZXRyaWV2YWxRQSUwQWZyb20lMjBsYW5nY2hhaW5fb3BlbmFpJTIwaW1wb3J0JTIwQ2hhdE9wZW5BSSUwQSUwQXZlY3Rvcl9xYSUyMCUzRCUyMFJldHJpZXZhbFFBLmZyb21fY2hhaW5fdHlwZSglMEElMjAlMjAlMjAlMjBsbG0lM0RDaGF0T3BlbkFJKCklMkMlMEElMjAlMjAlMjAlMjBjaGFpbl90eXBlJTNEJTIyc3R1ZmYlMjIlMkMlMEElMjAlMjAlMjAlMjByZXRyaWV2ZXIlM0R2ZWN0b3JfaW5kZXguYXNfcmV0cmlldmVyKCklMEEp",highlighted:`<span class="hljs-keyword">from</span> langchain.chains <span class="hljs-keyword">import</span> RetrievalQA
<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAI

vector_qa = RetrievalQA.from_chain_type(
    llm=ChatOpenAI(),
    chain_type=<span class="hljs-string">&quot;stuff&quot;</span>,
    retriever=vector_index.as_retriever()
)`,wrap:!1}}),tl=new V({props:{code:"ciUyMCUzRCUyMHZlY3Rvcl9xYS5pbnZva2UoJTBBJTIwJTIwJTIwJTIwJTdCJTIycXVlcnklMjIlM0ElMjAlMjJBSSVFQSVCMCU4MCUyMCVFQyU5QSVCMCVFQiVBNiVBQyVFQyU5RCU5OCUyMCVFQyU5RCVCQyVFQyU4MyU4MSUyMCVFQyU4MyU5RCVFRCU5OSU5QyVFQyU5NyU5MCUyMCVFQyU5NiVCNCVFQiU5NiVBNCUyMCVFQyU5OCU4MSVFRCU5NiVBNSVFQyU5RCU4NCUyMCVFQiVBRiVCOCVFQyVCOSVBMCUyMCVFQyU4OCU5OCUyMCVFQyU5RSU4OCVFQiU4QSU5NCVFQyVBNyU4MCUyMCVFQiU4NSVCQyVFQyU5RCU5OCVFRCU5NSU5OCVFQiU4QSU5NCUyMCVFQiU4NSVCQyVFQiVBQyVCOCVFQyU5RCU4MCUyMCVFQyU5NiVCNCVFQiU5NiVBNCUyMCVFQSVCMiU4MyVFQiU5MyVBNCVFQyU5RCVCNCUyMCVFQyU5RSU4OCVFQiU4MiU5OCVFQyU5QSU5NCUzRiUyMCVFQiU4NSVCQyVFQiVBQyVCOCUyMCVFQyVBMCU5QyVFQiVBQSVBOSVFQSVCMyVCQyUyMCVFQyVCNCU4OCVFQiVBMSU5RCVFQyU5RCU4NCUyMCVFRCU4RiVBQyVFRCU5NSVBOCVFRCU5NSVCNCVFQyU4NCU5QyUyMCVFQiVBNyU5MCVFRCU5NSVCNCVFQyVBMyVCQyVFQyU4NCVCOCVFQyU5QSU5NC4lMjIlN0QlMEEpJTBBcHJpbnQociU1QidyZXN1bHQnJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>r = vector_qa.invoke(
<span class="hljs-meta">... </span>    {<span class="hljs-string">&quot;query&quot;</span>: <span class="hljs-string">&quot;AI가 우리의 일상 생활에 어떤 영향을 미칠 수 있는지 논의하는 논문은 어떤 것들이 있나요? 논문 제목과 초록을 포함해서 말해주세요.&quot;</span>}
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(r[<span class="hljs-string">&#x27;result&#x27;</span>])`,wrap:!1}}),sl=new Q({props:{title:"추론을 위한 지식 그래프 탐색",local:"추론을-위한-지식-그래프-탐색",headingTag:"h2"}}),il=new Q({props:{title:"LangChain을 사용한 그래프 Cypher 체인",local:"langchain을-사용한-그래프-cypher-체인",headingTag:"h3"}}),Cl=new V({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi5jaGFpbnMlMjBpbXBvcnQlMjBHcmFwaEN5cGhlclFBQ2hhaW4lMEFmcm9tJTIwbGFuZ2NoYWluX29wZW5haSUyMGltcG9ydCUyMENoYXRPcGVuQUklMEElMEFncmFwaC5yZWZyZXNoX3NjaGVtYSgpJTBBJTBBY3lwaGVyX2NoYWluJTIwJTNEJTIwR3JhcGhDeXBoZXJRQUNoYWluLmZyb21fbGxtKCUwQSUyMCUyMCUyMCUyMGN5cGhlcl9sbG0lMjAlM0QlMjBDaGF0T3BlbkFJKHRlbXBlcmF0dXJlJTNEMCUyQyUyMG1vZGVsX25hbWUlM0QnZ3B0LTRvJyklMkMlMEElMjAlMjAlMjAlMjBxYV9sbG0lMjAlM0QlMjBDaGF0T3BlbkFJKHRlbXBlcmF0dXJlJTNEMCUyQyUyMG1vZGVsX25hbWUlM0QnZ3B0LTRvJyklMkMlMjAlMEElMjAlMjAlMjAlMjBncmFwaCUzRGdyYXBoJTJDJTBBJTIwJTIwJTIwJTIwdmVyYm9zZSUzRFRydWUlMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> langchain.chains <span class="hljs-keyword">import</span> GraphCypherQAChain
<span class="hljs-keyword">from</span> langchain_openai <span class="hljs-keyword">import</span> ChatOpenAI

graph.refresh_schema()

cypher_chain = GraphCypherQAChain.from_llm(
    cypher_llm = ChatOpenAI(temperature=<span class="hljs-number">0</span>, model_name=<span class="hljs-string">&#x27;gpt-4o&#x27;</span>),
    qa_llm = ChatOpenAI(temperature=<span class="hljs-number">0</span>, model_name=<span class="hljs-string">&#x27;gpt-4o&#x27;</span>), 
    graph=graph,
    verbose=<span class="hljs-literal">True</span>,
)`,wrap:!1}}),yl=new Q({props:{title:"자연어를 사용한 쿼리 예시",local:"자연어를-사용한-쿼리-예시",headingTag:"h3"}}),Vl=new Q({props:{title:"” Emily Chen이 발표한 논문은 몇 편인가요? ”",local:"-emily-chen이-발표한-논문은-몇-편인가요-",headingTag:"h4"}}),hl=new V({props:{code:"TUFUQ0glMjAoJTNBJUVDJTk3JUIwJUVBJUI1JUFDJUVDJTlCJTkwJTIwJTdCJUVDJTlEJUI0JUVCJUE2JTg0JTNBJTIwJTIyRW1pbHklMjBDaGVuJTIyJTdEKS0lNUIlM0ElRUMlQjYlOUMlRUQlOEMlOTAlRUQlOTUlOTglRUIlOEIlQTQlNUQtJTNFKG4lM0ElRUIlODUlQkMlRUIlQUMlQjgpJTBBUkVUVVJOJTIwQ09VTlQobiklMjBBUyUyMCVFQiU4NSVCQyVFQiVBQyVCOF8lRUMlODglOTg=",highlighted:`MATCH (:연구원 {이름: <span class="hljs-string">&quot;Emily Chen&quot;</span>})-<span class="hljs-selector-attr">[:출판하다]</span>-&gt;(n:논문)
RETURN <span class="hljs-built_in">COUNT</span>(n) AS 논문_수`,wrap:!1}}),wl=new V({props:{code:"JTIzJTIwJUVCJThCJUI1JUVDJTlEJTgwJTIwJzcnJUVDJTlEJUI0JUVDJTk2JUI0JUVDJTk1JUJDJTIwJUVEJTk1JUE5JUVCJThCJTg4JUVCJThCJUE0LiUwQWN5cGhlcl9jaGFpbi5pbnZva2UoJTBBJTIwJTIwJTIwJTIwJTdCJTIycXVlcnklMjIlM0ElMjAlMjJFbWlseSUyMENoZW4lRUMlOUQlQjQlMjAlRUIlQjAlOUMlRUQlOTElOUMlRUQlOTUlOUMlMjAlRUIlODUlQkMlRUIlQUMlQjglRUMlOUQlODAlMjAlRUIlQUElODclMjAlRUQlOEUlQjglRUMlOUQlQjglRUElQjAlODAlRUMlOUElOTQlM0YlMjIlN0QlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># 답은 &#x27;7&#x27;이어야 합니다.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cypher_chain.invoke(
<span class="hljs-meta">... </span>    {<span class="hljs-string">&quot;query&quot;</span>: <span class="hljs-string">&quot;Emily Chen이 발표한 논문은 몇 편인가요?&quot;</span>}
<span class="hljs-meta">... </span>)`,wrap:!1}}),cl=new Q({props:{title:"” 3편보다 많은 논문을 함께 발표한 연구원 쌍을 알려주세요. ”",local:"-3편보다-많은-논문을-함께-발표한-연구원-쌍을-알려주세요-",headingTag:"h4"}}),El=new V({props:{code:"TUFUQ0glMjAocjElM0ElRUMlOTclQjAlRUElQjUlQUMlRUMlOUIlOTApLSU1QiUzQSVFQyVCNiU5QyVFRCU4QyU5MCVFRCU5NSU5OCVFQiU4QiVBNCU1RC0lM0UocCUzQSVFQiU4NSVCQyVFQiVBQyVCOCklM0MtJTVCJTNBJUVDJUI2JTlDJUVEJThDJTkwJUVEJTk1JTk4JUVCJThCJUE0JTVELShyMiUzQSVFQyU5NyVCMCVFQSVCNSVBQyVFQyU5QiU5MCklMEFXSEVSRSUyMHIxJTIwJTNDJTNFJTIwcjIlMEFXSVRIJTIwcjElMkMlMjByMiUyQyUyMENPVU5UKHApJTIwQVMlMjAlRUIlODUlQkMlRUIlQUMlQjglRUMlODglOTglMEFXSEVSRSUyMCVFQiU4NSVCQyVFQiVBQyVCOCVFQyU4OCU5OCUyMCUzRSUyMDMlMEFSRVRVUk4lMjByMS4lRUMlOUQlQjQlRUIlQTYlODQlMjBBUyUyMCVFQyU5NyVCMCVFQSVCNSVBQyVFQyU5QiU5MDElMkMlMjByMi4lRUMlOUQlQjQlRUIlQTYlODQlMjBBUyUyMCVFQyU5NyVCMCVFQSVCNSVBQyVFQyU5QiU5MDIlMkMlMjAlRUIlODUlQkMlRUIlQUMlQjglRUMlODglOTg=",highlighted:`<span class="hljs-symbol">MATCH</span> (<span class="hljs-built_in">r1</span>:연구원)-[:출판하다]-&gt;(p:논문)&lt;-[:출판하다]-(<span class="hljs-built_in">r2</span>:연구원)
<span class="hljs-symbol">WHERE</span> <span class="hljs-built_in">r1</span> &lt;&gt; <span class="hljs-built_in">r2</span>
<span class="hljs-symbol">WITH</span> <span class="hljs-built_in">r1</span>, <span class="hljs-built_in">r2</span>, COUNT(p) AS 논문수
<span class="hljs-symbol">WHERE</span> 논문수 &gt; <span class="hljs-number">3</span>
<span class="hljs-symbol">RETURN</span> <span class="hljs-built_in">r1</span>.이름 AS 연구원<span class="hljs-number">1</span>, <span class="hljs-built_in">r2</span>.이름 AS 연구원<span class="hljs-number">2</span>, 논문수`,wrap:!1}}),Il=new V({props:{code:"JTIzJTIwJUVCJThCJUI1JUVDJTlEJTgwJTIwRGF2aWQlMjBKb2huc29uJTIwJTI2JTIwRW1pbHklMjBDaGVuJTJDJTIwUm9iZXJ0JTIwVGF5bG9yJTIwJTI2JTIwRW1pbHklMjBDaGVuJUVDJTlEJUI0JUVDJTk2JUI0JUVDJTk1JUJDJTIwJUVEJTk1JUE5JUVCJThCJTg4JUVCJThCJUE0LiUwQWN5cGhlcl9jaGFpbi5pbnZva2UoJTBBJTIwJTIwJTIwJTIwJTdCJTIycXVlcnklMjIlM0ElMjAlMjIzJUVEJThFJUI4JUVCJUIzJUI0JUVCJThCJUE0JTIwJUVCJUE3JThFJUVDJTlEJTgwJTIwJUVCJTg1JUJDJUVCJUFDJUI4JUVDJTlEJTg0JTIwJUVEJTk1JUE4JUVBJUJCJTk4JTIwJUVCJUIwJTlDJUVEJTkxJTlDJUVEJTk1JTlDJTIwJUVDJTk3JUIwJUVBJUI1JUFDJUVDJTlCJTkwJTIwJUVDJThDJThEJUVDJTlEJTg0JTIwJUVDJTk1JThDJUVCJUEwJUE0JUVDJUEzJUJDJUVDJTg0JUI4JUVDJTlBJTk0LiUyMiU3RCUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># 답은 David Johnson &amp; Emily Chen, Robert Taylor &amp; Emily Chen이어야 합니다.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cypher_chain.invoke(
<span class="hljs-meta">... </span>    {<span class="hljs-string">&quot;query&quot;</span>: <span class="hljs-string">&quot;3편보다 많은 논문을 함께 발표한 연구원 쌍을 알려주세요.&quot;</span>}
<span class="hljs-meta">... </span>)`,wrap:!1}}),$l=new Q({props:{title:"” 가장 많은 동료와 협업한 연구원은 누구인가요? ”",local:"-가장-많은-동료와-협업한-연구원은-누구인가요-",headingTag:"h4"}}),bl=new V({props:{code:"TUFUQ0glMjAociUzQSVFQyU5NyVCMCVFQSVCNSVBQyVFQyU5QiU5MCktJTVCJTNBJUVDJUI2JTlDJUVEJThDJTkwJUVEJTk1JTk4JUVCJThCJUE0JTVELSUzRSglM0ElRUIlODUlQkMlRUIlQUMlQjgpJTNDLSU1QiUzQSVFQyVCNiU5QyVFRCU4QyU5MCVFRCU5NSU5OCVFQiU4QiVBNCU1RC0oY29hdXRob3IlM0ElRUMlOTclQjAlRUElQjUlQUMlRUMlOUIlOTApJTBBV0hFUkUlMjByJTIwJTNDJTNFJTIwY29hdXRob3IlMEFSRVRVUk4lMjByLiVFQyU5RCVCNCVFQiVBNiU4NCUyMEFTJTIwJUVDJTk3JUIwJUVBJUI1JUFDJUVDJTlCJTkwJTJDJTIwQ09VTlQoRElTVElOQ1QlMjBjb2F1dGhvciklMjBBUyUyMCVFQiU4RiU5OSVFQiVBMyU4QyVFQyU4OCU5OCUwQU9SREVSJTIwQlklMjAlRUIlOEYlOTklRUIlQTMlOEMlRUMlODglOTglMjBERVNDJTBBTElNSVQlMjAx",highlighted:`MATCH (r:연구원)-[:출판하다]-&gt;(:논문)&lt;-[:출판하다]-(coauthor:연구원)
<span class="hljs-keyword">WHERE</span> r &lt;&gt; coauthor
<span class="hljs-keyword">RETURN</span> r.이름 <span class="hljs-keyword">AS</span> 연구원, COUNT(<span class="hljs-keyword">DISTINCT</span> coauthor) <span class="hljs-keyword">AS</span> 동료수
<span class="hljs-keyword">ORDER</span> <span class="hljs-keyword">BY</span> 동료수 <span class="hljs-keyword">DESC</span>
<span class="hljs-keyword">LIMIT</span> <span class="hljs-number">1</span>`,wrap:!1}}),Sl=new V({props:{code:"JTIzJTIwJUVCJThCJUI1JUVDJTlEJTgwJTIwJ0RhdmlkJTIwSm9obnNvbiclRUMlOUQlQjQlRUMlOTYlQjQlRUMlOTUlQkMlMjAlRUQlOTUlQTklRUIlOEIlODglRUIlOEIlQTQuJTBBY3lwaGVyX2NoYWluLmludm9rZSglMEElMjAlMjAlMjAlMjAlN0IlMjJxdWVyeSUyMiUzQSUyMCUyMiVFQSVCMCU4MCVFQyU5RSVBNSUyMCVFQiVBNyU4RSVFQyU5RCU4MCUyMCVFQiU4RiU5OSVFQiVBMyU4QyVFQyU5OSU4MCUyMCVFRCU5OCU5MSVFQyU5NyU4NSVFRCU5NSU5QyUyMCVFQyU5NyVCMCVFQSVCNSVBQyVFQyU5QiU5MCVFQyU5RCU4MCUyMCVFQiU4OCU4NCVFQSVCNSVBQyVFQyU5RCVCOCVFQSVCMCU4MCVFQyU5QSU5NCUzRiUyMiU3RCUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># 답은 &#x27;David Johnson&#x27;이어야 합니다.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>cypher_chain.invoke(
<span class="hljs-meta">... </span>    {<span class="hljs-string">&quot;query&quot;</span>: <span class="hljs-string">&quot;가장 많은 동료와 협업한 연구원은 누구인가요?&quot;</span>}
<span class="hljs-meta">... </span>)`,wrap:!1}}),Bl=new Mn({props:{source:"https://github.com/huggingface/cookbook/blob/main/notebooks/ko/ko_rag_with_knowledge_graphs_neo4j.md"}}),{c(){h=a("meta"),Ol=s(),vl=a("p"),Al=s(),J(o.$$.fragment),_l=s(),J(w.$$.fragment),Dl=s(),J(j.$$.fragment),Gl=s(),c=a("p"),c.innerHTML=Tt,Hl=s(),f=a("p"),f.innerHTML=Ct,Ll=s(),E=a("p"),E.innerHTML=yt,Wl=s(),R=a("p"),R.textContent=mt,Zl=s(),u=a("ul"),u.innerHTML=Vt,Xl=s(),r=a("p"),r.innerHTML=Qt,Yl=s(),J(I.$$.fragment),Pl=s(),J(g.$$.fragment),zl=s(),J($.$$.fragment),ql=s(),F=a("p"),F.innerHTML=ht,Kl=s(),b=a("p"),b.innerHTML=rt,le=s(),N=a("p"),N.innerHTML=ot,ee=s(),J(d.$$.fragment),te=s(),S=a("p"),S.innerHTML=wt,ne=s(),J(k.$$.fragment),se=s(),J(B.$$.fragment),Ue=s(),v=a("p"),v.innerHTML=jt,ae=s(),x=a("p"),x.textContent=ct,ie=s(),O=a("ul"),O.innerHTML=ft,pe=s(),A=a("p"),A.textContent=Et,Je=s(),_=a("ul"),_.innerHTML=Rt,Me=s(),J(D.$$.fragment),Te=s(),G=a("p"),G.textContent=ut,Ce=s(),J(H.$$.fragment),ye=s(),L=a("pre"),L.textContent=It,me=s(),W=a("p"),W.textContent=gt,Ve=s(),Z=a("p"),Z.innerHTML=$t,Qe=s(),J(X.$$.fragment),he=s(),Y=a("p"),Y.innerHTML=Ft,re=s(),J(P.$$.fragment),oe=s(),z=a("p"),z.innerHTML=bt,we=s(),J(q.$$.fragment),je=s(),K=a("p"),K.innerHTML=Nt,ce=s(),J(ll.$$.fragment),fe=s(),el=a("p"),el.innerHTML=dt,Ee=s(),J(tl.$$.fragment),Re=s(),nl=a("pre"),nl.textContent=St,ue=s(),J(sl.$$.fragment),Ie=s(),Ul=a("p"),Ul.textContent=kt,ge=s(),al=a("p"),al.textContent=Bt,$e=s(),J(il.$$.fragment),Fe=s(),pl=a("p"),pl.innerHTML=vt,be=s(),Jl=a("p"),Jl.innerHTML=xt,Ne=s(),Ml=a("ul"),Ml.innerHTML=Ot,de=s(),Tl=a("p"),Tl.innerHTML=At,Se=s(),J(Cl.$$.fragment),ke=s(),J(yl.$$.fragment),Be=s(),ml=a("p"),ml.textContent=_t,ve=s(),J(Vl.$$.fragment),xe=s(),Ql=a("p"),Ql.innerHTML=Dt,Oe=s(),J(hl.$$.fragment),Ae=s(),rl=a("p"),rl.innerHTML=Gt,_e=s(),ol=a("p"),ol.innerHTML=Ht,De=s(),J(wl.$$.fragment),Ge=s(),jl=a("pre"),jl.textContent=Lt,He=s(),J(cl.$$.fragment),Le=s(),fl=a("p"),fl.innerHTML=Wt,We=s(),J(El.$$.fragment),Ze=s(),Rl=a("p"),Rl.innerHTML=Zt,Xe=s(),ul=a("p"),ul.innerHTML=Xt,Ye=s(),J(Il.$$.fragment),Pe=s(),gl=a("pre"),gl.textContent=Yt,ze=s(),J($l.$$.fragment),qe=s(),Fl=a("p"),Fl.innerHTML=Pt,Ke=s(),J(bl.$$.fragment),lt=s(),Nl=a("p"),Nl.innerHTML=zt,et=s(),dl=a("p"),dl.innerHTML=qt,tt=s(),J(Sl.$$.fragment),nt=s(),kl=a("pre"),kl.textContent=Kt,st=s(),Ut=a("hr"),at=s(),J(Bl.$$.fragment),it=s(),xl=a("p"),this.h()},l(l){const e=an("svelte-u9bgzb",document.head);h=i(e,"META",{name:!0,content:!0}),e.forEach(t),Ol=U(l),vl=i(l,"P",{}),ln(vl).forEach(t),Al=U(l),M(o.$$.fragment,l),_l=U(l),M(w.$$.fragment,l),Dl=U(l),M(j.$$.fragment,l),Gl=U(l),c=i(l,"P",{"data-svelte-h":!0}),p(c)!=="svelte-19sq6n0"&&(c.innerHTML=Tt),Hl=U(l),f=i(l,"P",{"data-svelte-h":!0}),p(f)!=="svelte-136agf"&&(f.innerHTML=Ct),Ll=U(l),E=i(l,"P",{"data-svelte-h":!0}),p(E)!=="svelte-9vk653"&&(E.innerHTML=yt),Wl=U(l),R=i(l,"P",{"data-svelte-h":!0}),p(R)!=="svelte-5b9ee2"&&(R.textContent=mt),Zl=U(l),u=i(l,"UL",{"data-svelte-h":!0}),p(u)!=="svelte-1af23ed"&&(u.innerHTML=Vt),Xl=U(l),r=i(l,"P",{align:!0,"data-svelte-h":!0}),p(r)!=="svelte-xuaq4q"&&(r.innerHTML=Qt),Yl=U(l),M(I.$$.fragment,l),Pl=U(l),M(g.$$.fragment,l),zl=U(l),M($.$$.fragment,l),ql=U(l),F=i(l,"P",{"data-svelte-h":!0}),p(F)!=="svelte-1n1vtxi"&&(F.innerHTML=ht),Kl=U(l),b=i(l,"P",{"data-svelte-h":!0}),p(b)!=="svelte-b16ai"&&(b.innerHTML=rt),le=U(l),N=i(l,"P",{"data-svelte-h":!0}),p(N)!=="svelte-8vyk00"&&(N.innerHTML=ot),ee=U(l),M(d.$$.fragment,l),te=U(l),S=i(l,"P",{"data-svelte-h":!0}),p(S)!=="svelte-17rpj77"&&(S.innerHTML=wt),ne=U(l),M(k.$$.fragment,l),se=U(l),M(B.$$.fragment,l),Ue=U(l),v=i(l,"P",{"data-svelte-h":!0}),p(v)!=="svelte-cwyvrv"&&(v.innerHTML=jt),ae=U(l),x=i(l,"P",{"data-svelte-h":!0}),p(x)!=="svelte-1sfhb6o"&&(x.textContent=ct),ie=U(l),O=i(l,"UL",{"data-svelte-h":!0}),p(O)!=="svelte-35segy"&&(O.innerHTML=ft),pe=U(l),A=i(l,"P",{"data-svelte-h":!0}),p(A)!=="svelte-13blb8s"&&(A.textContent=Et),Je=U(l),_=i(l,"UL",{"data-svelte-h":!0}),p(_)!=="svelte-13zen22"&&(_.innerHTML=Rt),Me=U(l),M(D.$$.fragment,l),Te=U(l),G=i(l,"P",{"data-svelte-h":!0}),p(G)!=="svelte-u2rz1i"&&(G.textContent=ut),Ce=U(l),M(H.$$.fragment,l),ye=U(l),L=i(l,"PRE",{"data-svelte-h":!0}),p(L)!=="svelte-1l50klh"&&(L.textContent=It),me=U(l),W=i(l,"P",{"data-svelte-h":!0}),p(W)!=="svelte-ty1yjp"&&(W.textContent=gt),Ve=U(l),Z=i(l,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-1v560wd"&&(Z.innerHTML=$t),Qe=U(l),M(X.$$.fragment,l),he=U(l),Y=i(l,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-63px2c"&&(Y.innerHTML=Ft),re=U(l),M(P.$$.fragment,l),oe=U(l),z=i(l,"P",{"data-svelte-h":!0}),p(z)!=="svelte-1qfkpjm"&&(z.innerHTML=bt),we=U(l),M(q.$$.fragment,l),je=U(l),K=i(l,"P",{"data-svelte-h":!0}),p(K)!=="svelte-1hz8wrw"&&(K.innerHTML=Nt),ce=U(l),M(ll.$$.fragment,l),fe=U(l),el=i(l,"P",{"data-svelte-h":!0}),p(el)!=="svelte-igr5l"&&(el.innerHTML=dt),Ee=U(l),M(tl.$$.fragment,l),Re=U(l),nl=i(l,"PRE",{"data-svelte-h":!0}),p(nl)!=="svelte-py5h8i"&&(nl.textContent=St),ue=U(l),M(sl.$$.fragment,l),Ie=U(l),Ul=i(l,"P",{"data-svelte-h":!0}),p(Ul)!=="svelte-1mymh39"&&(Ul.textContent=kt),ge=U(l),al=i(l,"P",{"data-svelte-h":!0}),p(al)!=="svelte-1da167q"&&(al.textContent=Bt),$e=U(l),M(il.$$.fragment,l),Fe=U(l),pl=i(l,"P",{"data-svelte-h":!0}),p(pl)!=="svelte-1dym0c5"&&(pl.innerHTML=vt),be=U(l),Jl=i(l,"P",{"data-svelte-h":!0}),p(Jl)!=="svelte-1y30jf1"&&(Jl.innerHTML=xt),Ne=U(l),Ml=i(l,"UL",{"data-svelte-h":!0}),p(Ml)!=="svelte-1ocjrcm"&&(Ml.innerHTML=Ot),de=U(l),Tl=i(l,"P",{"data-svelte-h":!0}),p(Tl)!=="svelte-1wkbb5o"&&(Tl.innerHTML=At),Se=U(l),M(Cl.$$.fragment,l),ke=U(l),M(yl.$$.fragment,l),Be=U(l),ml=i(l,"P",{"data-svelte-h":!0}),p(ml)!=="svelte-13kyuha"&&(ml.textContent=_t),ve=U(l),M(Vl.$$.fragment,l),xe=U(l),Ql=i(l,"P",{"data-svelte-h":!0}),p(Ql)!=="svelte-1eu352z"&&(Ql.innerHTML=Dt),Oe=U(l),M(hl.$$.fragment,l),Ae=U(l),rl=i(l,"P",{"data-svelte-h":!0}),p(rl)!=="svelte-i9yy29"&&(rl.innerHTML=Gt),_e=U(l),ol=i(l,"P",{"data-svelte-h":!0}),p(ol)!=="svelte-1v560wd"&&(ol.innerHTML=Ht),De=U(l),M(wl.$$.fragment,l),Ge=U(l),jl=i(l,"PRE",{"data-svelte-h":!0}),p(jl)!=="svelte-lfkhgt"&&(jl.textContent=Lt),He=U(l),M(cl.$$.fragment,l),Le=U(l),fl=i(l,"P",{"data-svelte-h":!0}),p(fl)!=="svelte-lw3uih"&&(fl.innerHTML=Wt),We=U(l),M(El.$$.fragment,l),Ze=U(l),Rl=i(l,"P",{"data-svelte-h":!0}),p(Rl)!=="svelte-7n2n9b"&&(Rl.innerHTML=Zt),Xe=U(l),ul=i(l,"P",{"data-svelte-h":!0}),p(ul)!=="svelte-1v560wd"&&(ul.innerHTML=Xt),Ye=U(l),M(Il.$$.fragment,l),Pe=U(l),gl=i(l,"PRE",{"data-svelte-h":!0}),p(gl)!=="svelte-1np6d01"&&(gl.textContent=Yt),ze=U(l),M($l.$$.fragment,l),qe=U(l),Fl=i(l,"P",{"data-svelte-h":!0}),p(Fl)!=="svelte-tcvrhx"&&(Fl.innerHTML=Pt),Ke=U(l),M(bl.$$.fragment,l),lt=U(l),Nl=i(l,"P",{"data-svelte-h":!0}),p(Nl)!=="svelte-1ijvbof"&&(Nl.innerHTML=zt),et=U(l),dl=i(l,"P",{"data-svelte-h":!0}),p(dl)!=="svelte-1v560wd"&&(dl.innerHTML=qt),tt=U(l),M(Sl.$$.fragment,l),nt=U(l),kl=i(l,"PRE",{"data-svelte-h":!0}),p(kl)!=="svelte-1pyexij"&&(kl.textContent=Kt),st=U(l),Ut=i(l,"HR",{}),at=U(l),M(Bl.$$.fragment,l),it=U(l),xl=i(l,"P",{}),ln(xl).forEach(t),this.h()},h(){Jt(h,"name","hf:doc:metadata"),Jt(h,"content",yn),Jt(r,"align","center")},m(l,e){pn(document.head,h),n(l,Ol,e),n(l,vl,e),n(l,Al,e),T(o,l,e),n(l,_l,e),T(w,l,e),n(l,Dl,e),T(j,l,e),n(l,Gl,e),n(l,c,e),n(l,Hl,e),n(l,f,e),n(l,Ll,e),n(l,E,e),n(l,Wl,e),n(l,R,e),n(l,Zl,e),n(l,u,e),n(l,Xl,e),n(l,r,e),n(l,Yl,e),T(I,l,e),n(l,Pl,e),T(g,l,e),n(l,zl,e),T($,l,e),n(l,ql,e),n(l,F,e),n(l,Kl,e),n(l,b,e),n(l,le,e),n(l,N,e),n(l,ee,e),T(d,l,e),n(l,te,e),n(l,S,e),n(l,ne,e),T(k,l,e),n(l,se,e),T(B,l,e),n(l,Ue,e),n(l,v,e),n(l,ae,e),n(l,x,e),n(l,ie,e),n(l,O,e),n(l,pe,e),n(l,A,e),n(l,Je,e),n(l,_,e),n(l,Me,e),T(D,l,e),n(l,Te,e),n(l,G,e),n(l,Ce,e),T(H,l,e),n(l,ye,e),n(l,L,e),n(l,me,e),n(l,W,e),n(l,Ve,e),n(l,Z,e),n(l,Qe,e),T(X,l,e),n(l,he,e),n(l,Y,e),n(l,re,e),T(P,l,e),n(l,oe,e),n(l,z,e),n(l,we,e),T(q,l,e),n(l,je,e),n(l,K,e),n(l,ce,e),T(ll,l,e),n(l,fe,e),n(l,el,e),n(l,Ee,e),T(tl,l,e),n(l,Re,e),n(l,nl,e),n(l,ue,e),T(sl,l,e),n(l,Ie,e),n(l,Ul,e),n(l,ge,e),n(l,al,e),n(l,$e,e),T(il,l,e),n(l,Fe,e),n(l,pl,e),n(l,be,e),n(l,Jl,e),n(l,Ne,e),n(l,Ml,e),n(l,de,e),n(l,Tl,e),n(l,Se,e),T(Cl,l,e),n(l,ke,e),T(yl,l,e),n(l,Be,e),n(l,ml,e),n(l,ve,e),T(Vl,l,e),n(l,xe,e),n(l,Ql,e),n(l,Oe,e),T(hl,l,e),n(l,Ae,e),n(l,rl,e),n(l,_e,e),n(l,ol,e),n(l,De,e),T(wl,l,e),n(l,Ge,e),n(l,jl,e),n(l,He,e),T(cl,l,e),n(l,Le,e),n(l,fl,e),n(l,We,e),T(El,l,e),n(l,Ze,e),n(l,Rl,e),n(l,Xe,e),n(l,ul,e),n(l,Ye,e),T(Il,l,e),n(l,Pe,e),n(l,gl,e),n(l,ze,e),T($l,l,e),n(l,qe,e),n(l,Fl,e),n(l,Ke,e),T(bl,l,e),n(l,lt,e),n(l,Nl,e),n(l,et,e),n(l,dl,e),n(l,tt,e),T(Sl,l,e),n(l,nt,e),n(l,kl,e),n(l,st,e),n(l,Ut,e),n(l,at,e),T(Bl,l,e),n(l,it,e),n(l,xl,e),pt=!0},p:tn,i(l){pt||(C(o.$$.fragment,l),C(w.$$.fragment,l),C(j.$$.fragment,l),C(I.$$.fragment,l),C(g.$$.fragment,l),C($.$$.fragment,l),C(d.$$.fragment,l),C(k.$$.fragment,l),C(B.$$.fragment,l),C(D.$$.fragment,l),C(H.$$.fragment,l),C(X.$$.fragment,l),C(P.$$.fragment,l),C(q.$$.fragment,l),C(ll.$$.fragment,l),C(tl.$$.fragment,l),C(sl.$$.fragment,l),C(il.$$.fragment,l),C(Cl.$$.fragment,l),C(yl.$$.fragment,l),C(Vl.$$.fragment,l),C(hl.$$.fragment,l),C(wl.$$.fragment,l),C(cl.$$.fragment,l),C(El.$$.fragment,l),C(Il.$$.fragment,l),C($l.$$.fragment,l),C(bl.$$.fragment,l),C(Sl.$$.fragment,l),C(Bl.$$.fragment,l),pt=!0)},o(l){y(o.$$.fragment,l),y(w.$$.fragment,l),y(j.$$.fragment,l),y(I.$$.fragment,l),y(g.$$.fragment,l),y($.$$.fragment,l),y(d.$$.fragment,l),y(k.$$.fragment,l),y(B.$$.fragment,l),y(D.$$.fragment,l),y(H.$$.fragment,l),y(X.$$.fragment,l),y(P.$$.fragment,l),y(q.$$.fragment,l),y(ll.$$.fragment,l),y(tl.$$.fragment,l),y(sl.$$.fragment,l),y(il.$$.fragment,l),y(Cl.$$.fragment,l),y(yl.$$.fragment,l),y(Vl.$$.fragment,l),y(hl.$$.fragment,l),y(wl.$$.fragment,l),y(cl.$$.fragment,l),y(El.$$.fragment,l),y(Il.$$.fragment,l),y($l.$$.fragment,l),y(bl.$$.fragment,l),y(Sl.$$.fragment,l),y(Bl.$$.fragment,l),pt=!1},d(l){l&&(t(Ol),t(vl),t(Al),t(_l),t(Dl),t(Gl),t(c),t(Hl),t(f),t(Ll),t(E),t(Wl),t(R),t(Zl),t(u),t(Xl),t(r),t(Yl),t(Pl),t(zl),t(ql),t(F),t(Kl),t(b),t(le),t(N),t(ee),t(te),t(S),t(ne),t(se),t(Ue),t(v),t(ae),t(x),t(ie),t(O),t(pe),t(A),t(Je),t(_),t(Me),t(Te),t(G),t(Ce),t(ye),t(L),t(me),t(W),t(Ve),t(Z),t(Qe),t(he),t(Y),t(re),t(oe),t(z),t(we),t(je),t(K),t(ce),t(fe),t(el),t(Ee),t(Re),t(nl),t(ue),t(Ie),t(Ul),t(ge),t(al),t($e),t(Fe),t(pl),t(be),t(Jl),t(Ne),t(Ml),t(de),t(Tl),t(Se),t(ke),t(Be),t(ml),t(ve),t(xe),t(Ql),t(Oe),t(Ae),t(rl),t(_e),t(ol),t(De),t(Ge),t(jl),t(He),t(Le),t(fl),t(We),t(Ze),t(Rl),t(Xe),t(ul),t(Ye),t(Pe),t(gl),t(ze),t(qe),t(Fl),t(Ke),t(lt),t(Nl),t(et),t(dl),t(tt),t(nt),t(kl),t(st),t(Ut),t(at),t(it),t(xl)),t(h),m(o,l),m(w,l),m(j,l),m(I,l),m(g,l),m($,l),m(d,l),m(k,l),m(B,l),m(D,l),m(H,l),m(X,l),m(P,l),m(q,l),m(ll,l),m(tl,l),m(sl,l),m(il,l),m(Cl,l),m(yl,l),m(Vl,l),m(hl,l),m(wl,l),m(cl,l),m(El,l),m(Il,l),m($l,l),m(bl,l),m(Sl,l),m(Bl,l)}}}const yn='{"title":"지식 그래프를 활용한 RAG 추론 향상","local":"지식-그래프를-활용한-rag-추론-향상","sections":[{"title":"초기화","local":"초기화","sections":[{"title":"Neo4j 인스턴스 설정","local":"neo4j-인스턴스-설정","sections":[],"depth":3},{"title":"데이터셋을 그래프로 로딩","local":"데이터셋을-그래프로-로딩","sections":[],"depth":3},{"title":"벡터 인덱스 구축","local":"벡터-인덱스-구축","sections":[],"depth":3}],"depth":2},{"title":"유사도 기반 Q&A","local":"유사도-기반-qa","sections":[],"depth":2},{"title":"추론을 위한 지식 그래프 탐색","local":"추론을-위한-지식-그래프-탐색","sections":[{"title":"LangChain을 사용한 그래프 Cypher 체인","local":"langchain을-사용한-그래프-cypher-체인","sections":[],"depth":3},{"title":"자연어를 사용한 쿼리 예시","local":"자연어를-사용한-쿼리-예시","sections":[{"title":"” Emily Chen이 발표한 논문은 몇 편인가요? ”","local":"-emily-chen이-발표한-논문은-몇-편인가요-","sections":[],"depth":4},{"title":"” 3편보다 많은 논문을 함께 발표한 연구원 쌍을 알려주세요. ”","local":"-3편보다-많은-논문을-함께-발표한-연구원-쌍을-알려주세요-","sections":[],"depth":4},{"title":"” 가장 많은 동료와 협업한 연구원은 누구인가요? ”","local":"-가장-많은-동료와-협업한-연구원은-누구인가요-","sections":[],"depth":4}],"depth":3}],"depth":2}],"depth":1}';function mn(Mt){return nn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class on extends sn{constructor(h){super(),Un(this,h,mn,Cn,en,{})}}export{on as component};
