import{s as TM,n as yM,o as nM}from"../chunks/scheduler.e0212c12.js";import{S as QM,i as VM,e,s as J,c as T,h as aM,a as C,d as M,b as s,f as eM,g as y,j as I,k as CM,l as IM,m as t,n,t as Q,o as V,p as a}from"../chunks/index.a585a37c.js";import{C as jM,H as i,E as iM}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.b7b693fd.js";import{D as wM,C as j}from"../chunks/DocNotebookDropdown.1738c255.js";function pM(NU){let w,ul,Fl,cl,p,Ol,R,bl,m,ol,E,gU='<em>참조: <a href="https://github.com/MartinEls" rel="nofollow">Martin Elstner</a> </em>작성자: <a href="https://github.com/ahnjj" rel="nofollow">안정</a>',Bl,F,fU=`검색 엔진은 크게 키워드 검색과 벡터 검색으로 나눌 수 있습니다.
키워드 검색과 달리, 벡터 검색을 사용할 때는 두 가지를 고려해야 합니다.`,dl,A,hU="<li>적합한 임베딩 모델로 데이터셋과 쿼리를 임베딩하는 작업</li> <li>임베딩 데이터를 처리할 수 있는 DB</li>",Nl,u,SU="하지만 임베딩 값을 기반으로 한 벡터 검색만으로는 ‘사용자가 원하는 답변’을 보장하기 어렵습니다.",gl,c,rU="그래서 검색 과정에서 에이전트가 자율적으로 판단하고 최적화한다면, 사용자 의도에 더 가까운 검색 결과를 얻을 수 있습니다.",fl,O,hl,b,kU="기존 벡터 검색 워크플로우",Sl,o,rl,B,DU="똑똑한 Agentic 방식",kl,d,Dl,N,$l,g,$U='허깅페이스의 데이터셋은 파켓(parquet) 파일을 기반으로 동작하는데, 이때 빠른 인메모리 데이터베이스 시스템인 <a href="https://huggingface.co/docs/hub/en/datasets-duckdb" rel="nofollow">DuckDB를 사용하면 이 파일들과 상호작용</a>할 수 있습니다. 또한 DuckDB의 기능 중 하나는 <a href="https://duckdb.org/docs/extensions/vss.html" rel="nofollow">벡터 유사도 검색</a>으로, 인덱스 유무에 관계없이 사용할 수 있습니다.',Zl,f,ZU="이번 노트북에서는 단일 Agent에 여러가지 도구를 주어 수행하는 간단한 Agentic 벡터 검색 엔진을 만들어 보겠습니다.",Wl,h,WU="필요한 의존성을 설치합니다 :",Gl,S,_l,r,GU="HuggingFace의 추론 API를 사용하기 위해 로그인합니다 :",xl,k,ql,D,Yl,$,vl,Z,_U="정의할 도구는 아래와 같습니다.",zl,W,xU="<li>임베딩 생성 도구</li> <li>인덱스 생성 도구</li> <li>유사도 검색 도구</li> <li>답변 생성 도구</li>",Xl,G,Hl,_,qU="일반적으로, 임베딩 작업에서는 작은 배치 사이즈로 데이터를 청킹하지만 여기서는 단순히 데이터셋을 임베딩으로 변환하는 과정만 수행하겠습니다.",Ll,x,Kl,q,Pl,Y,YU=`<code>duckdb</code>를 사용하여 데이터셋에서 벡터 검색을 수행할 수 있습니다.
인덱스는 사용하거나 사용하지 않을 수 있습니다. 인덱스를 <strong>활용하지 않고</strong> 검색하는 것은 더 느리지만 더 정확하고, 인덱스를 <strong>활용하여</strong> 검색하는 것은 더 빠르지만 덜 정확합니다.`,lU,v,UU,z,vU="인덱스를 활용하지 않고 검색하는 것은 느린 작업지만 일반적으로 약 10만 행까지의 작은 데이터셋에서는 충분히 빠르게 동작합니다. 하지만 이번 노트북에서는 DuckDB의 인덱스를 활용해서 검색해보겠습니다.",MU,X,tU,H,zU="이 접근법은 데이터셋의 로컬 복사본을 생성하고 이를 사용하여 인덱스를 생성합니다. 약간의 오버헤드가 있지만 한번 인덱스를 생성한 후에는 검색 속도가 개선될 것입니다.",JU,L,sU,K,eU,P,XU="이 도구를 통해 인덱스를 사용하여 벡터 검색을 수행할 수 있으며, 결과는 즉시 반환됩니다.",CU,ll,TU,Ul,yU,Ml,HU="무거운 벡터 검색 엔진을 따로 배포할 필요 없고, 저장소는 허브에서 처리됩니다.",nU,tl,QU,Jl,LU="유사도 검색 결과 청크를 기반으로, LLM이 사용자가 원할 만한 답변을 생성합니다.",VU,sl,aU,el,KU="도구를 정의하였으니, 데이터셋을 로드하고 에이전트를 동작해보겠습니다.",IU,Cl,PU='사용한 데이터셋은 <a href="https://huggingface.co/datasets/huggingface-KREW/KoCultre-Descriptions" rel="nofollow">huggingface-KREW/KoCultre-Descriptions</a>으로, 한국어 밈(meme)에 대한 데이터입니다.',jU,Tl,iU,yl,lM="에이전트를 정의합니다. 사용할 모델은 Qwen/Qwen2.5-Coder-32B-Instruct 입니다.",wU,nl,pU,Ql,UM="에이전트가 자율적으로 임베딩 모델을 택할 수 있도록 프롬프트를 구성하겠습니다.",RU,Vl,mU,al,MM="데이터셋에 대한 설명과, 검색어를 입력하고 검색엔진 에이전트를 실행합니다.",EU,Il,FU,jl,AU,il,tM=`Final result: 엄마가되는 밈은 최근 SNS와 온라인 커뮤니티에서 유행하는 표현으로, 주로 누군가가 매우 귀엽거나 사랑스러워서 모성애적 감정을 느낄 때 사용됩니다. 이 표현은 아이돌 팬덤 문화에서 자주 사용되며, '엄마가 돼'가 올바른 표기이지만 의도적인 맞춤법 파괴를 통해 밈으로서의 독특한 성격을 갖게 되었습니다.
`,uU,wl,cU,pl,OU,Rl,JM="단순히 검색 결과만을 가져오는 것이 아니라, 검색결과를 바탕으로 쿼리에 따른 답변을 정제해서 보여주었습니다.✌🏻",bU,ml,sM="지금까지 간단한 에이전트 시스템을 만들어보았습니다. 여기에 품질 평가, 분석 등을 추가한다면 진정한 Agentic 검색 엔진을 구현할 수 있습니다.",oU,El,BU,Al,dU;return p=new wM({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/vector_search_agent.ipynb"}]}}),R=new jM({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new i({props:{title:"🤖 벡터 검색 에이전트: 허깅페이스 허브를 백엔드로 하는 지능형 검색 엔진",local:"-벡터-검색-에이전트-허깅페이스-허브를-백엔드로-하는-지능형-검색-엔진",headingTag:"h1"}}),O=new i({props:{title:"Agentic 접근 방식의 차별점",local:"agentic-접근-방식의-차별점",headingTag:"h3"}}),o=new j({props:{code:"JUVCJThEJUIwJUVDJTlEJUI0JUVEJTg0JUIwJTIwJUUyJTlFJUExJTIwJUVCJThEJUIwJUVDJTlEJUI0JUVEJTg0JUIwJTIwJUVDJTlFJTg0JUVCJUIyJUEwJUVCJTk0JUE5KCVFQSVCMyVBMCVFQyVBMCU5NSUyMCVFQiVBQSVBOCVFQiU4RCVCOCklMjAlRTIlOUUlQTElMjAlRUMlOUQlQjglRUIlOEQlQjElRUMlOEElQTQlMjAlRUMlODMlOUQlRUMlODQlQjElMjAlRTIlOUUlQTElMjAlRUMlODIlQUMlRUMlOUElQTklRUMlOUUlOTAlMjAlRUMlQTclODglRUMlOUQlOTglMjAlRTIlOUUlQTElMjAlRUMlOUMlQTAlRUMlODIlQUMlRUIlOEYlODQlMjAlRUElQjIlODAlRUMlODMlODklMjAlRTIlOUUlQTElMjAlRUIlOEIlQjUlRUIlQjMlODA=",highlighted:'데이터 ➡ 데이터 임베딩<span class="hljs-comment">(고정 모델)</span> ➡ 인덱스 생성 ➡ 사용자 질의 ➡ 유사도 검색 ➡ 답변',wrap:!1}}),d=new j({props:{code:"JUVDJTgyJUFDJUVDJTlBJUE5JUVDJTlFJTkwJTIwJUVDJUE3JTg4JUVDJTlEJTk4JTIwJUVCJUI2JTg0JUVDJTg0JTlEKCVFQSVCMiU4MCVFQyU4MyU4OSUyMCVFQyVBMCU4NCVFQiU5RSVCNSUyMCVFQyU4NCVCOCVFQyU5QiU4MCklMjAlRTIlOUUlQTElMjAlRUMlQjUlOUMlRUMlQTAlODElMjAlRUMlOUUlODQlRUIlQjIlQTAlRUIlOTQlQTklMjAlRUIlQUElQTglRUIlOEQlQjglMjAlRUMlODQlQTAlRUQlODMlOUQlMjAlRTIlOUUlQTElMjAlRUIlOEQlQjAlRUMlOUQlQjQlRUQlODQlQjAlMjAlRUMlOUUlODQlRUIlQjIlQTAlRUIlOTQlQTklMjAlRTIlOUUlQTElMjAlRUMlOUQlQjglRUIlOEQlQjElRUMlOEElQTQlMjAlRUMlODMlOUQlRUMlODQlQjElMjAlRTIlOUUlQTElMjAlRUMlOUMlQTAlRUMlODIlQUMlRUIlOEYlODQlMjAlRUElQjIlODAlRUMlODMlODklMjAlRTIlOUUlQTElMjAlRUElQjIlODAlRUMlODMlODklRUElQjIlQjAlRUElQjMlQkMlMjAlRUIlQjAlOTQlRUQlODMlOTUlRUMlOUMlQkMlRUIlQTElOUMlMjAlRUIlOEIlQjUlRUIlQjMlODAlMjAlRUMlQTAlOTUlRUMlQTAlOUM=",highlighted:'사용자 질의 분석<span class="hljs-comment">(검색 전략 세움)</span> ➡ 최적 임베딩 모델 선택 ➡ 데이터 임베딩 ➡ 인덱스 생성 ➡ 유사도 검색 ➡ 검색결과 바탕으로 답변 정제',wrap:!1}}),N=new i({props:{title:"DuckDB?",local:"duckdb",headingTag:"h3"}}),S=new j({props:{code:"JTIzJTIwJUVCJUIzJUI4JTIwJUVDJTk4JTg4JUVDJUEwJTlDJTIwJUVEJThDJThDJUVDJTlEJUJDJUVDJTlEJTgwJTIwUHl0aG9uJTIwMy4xMCUyMCVFQyU5RCVCNCVFQyU4MyU4MSUyMCVFQiVCMiU4NCVFQyVBMCU4NCVFQyU5NyU5MCVFQyU4NCU5QyVFQiVBNyU4QyUyMCVFQyU4QiVBNCVFRCU5NiU4OSVFRCU5NSVBMCUyMCVFQyU4OCU5OCUyMCVFQyU5RSU4OCVFQyU4QSVCNSVFQiU4QiU4OCVFQiU4QiVBNC4lMEEhcGlwJTIwaW5zdGFsbCUyMC1VJTIwc21vbGFnZW50cyUyMGRhdGFzZXRzJTIwc2VudGVuY2UtdHJhbnNmb3JtZXJzJTIwZHVja2RiJTIwb3BlbmFp",highlighted:`<span class="hljs-comment"># 본 예제 파일은 Python 3.10 이상 버전에서만 실행할 수 있습니다.</span>
!pip install -U smolagents datasets sentence-transformers duckdb openai`,wrap:!1}}),k=new j({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`,wrap:!1}}),D=new j({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjB0b29sJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwRGF0YXNldCUwQWltcG9ydCUyMG9zJTBBJTBBJTIzJTIwJUVCJThGJTg0JUVBJUI1JUFDJTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVDJTlEJTg0JTIwJUVDJTlDJTg0JUVEJTk1JUI0JTIwT1BFTkFJJTIwJUVEJTgyJUE0JUVCJUE1JUJDJTIwJUVCJUIwJTlDJUVBJUI4JTg5JTIwJUVCJUIwJTlCJUVDJTk1JTg0JUVDJTk1JUJDJUVEJTk1JUE5JUVCJThCJTg4JUVCJThCJUE0LiUwQW9zLmVudmlyb24lNUIlMjJPUEVOQUlfQVBJX0tFWSUyMiU1RCUyMCUzRCUyMCUyMllPVVIlMjBLRVklMjI=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> tool
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> Dataset
<span class="hljs-keyword">import</span> os

<span class="hljs-comment"># 도구 사용을 위해 OPENAI 키를 발급 받아야합니다.</span>
os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>] = <span class="hljs-string">&quot;YOUR KEY&quot;</span>`,wrap:!1}}),$=new i({props:{title:"도구 정의",local:"도구-정의",headingTag:"h1"}}),G=new i({props:{title:"도구1 : 임베딩 생성",local:"도구1--임베딩-생성",headingTag:"h3"}}),x=new j({props:{code:"JTQwdG9vbCUwQWRlZiUyMGNyZWF0ZV9lbWJlZGRpbmdzKCUwQSUyMCUyMCUyMCUyMGRhdGFzZXQlM0ElMjBEYXRhc2V0JTJDJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0ElMj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TIwJTIwJUVDJTlFJTg0JUVCJUIyJUEwJUVCJTk0JUE5JUVDJTlEJUI0JTIwJUVDJUI2JTk0JUVBJUIwJTgwJUVCJTkwJTlDJTIwJUVCJThEJUIwJUVDJTlEJUI0JUVEJTg0JUIwJUVDJTg1JThCJTBBJTIwJTIwJTIyJTIyJTIyJTBBJTIwJTIwZnJvbSUyMHNlbnRlbmNlX3RyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlbnRlbmNlVHJhbnNmb3JtZXIlMEElMEElMjAlMjBtb2RlbCUyMCUzRCUyMFNlbnRlbmNlVHJhbnNmb3JtZXIobW9kZWxfaWQpJTBBJTBBJTIwJTIwZGVmJTIwZW1iZWRfYmF0Y2goYmF0Y2gpJTNBJTBBJTIwJTIwJTIwJTIwZW1iZWRkaW5ncyUyMCUzRCUyMG1vZGVsLmVuY29kZShiYXRjaCU1QmNvbHVtbl9uYW1lJTVEJTJDJTIwY29udmVydF90b19udW1weSUzRFRydWUpJTBBJTIwJTIwJTIwJTIwYmF0Y2glNUIlMjJlbWJlZGRpbmdzJTIyJTVEJTIwJTNEJTIwZW1iZWRkaW5ncy50b2xpc3QoKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGJhdGNoJTBBJTBBJTIwJTIwZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQubWFwKGVtYmVkX2JhdGNoJTJDJTIwYmF0Y2hlZCUzRFRydWUpJTBBJTBBJTIwJTIwcmV0dXJuJTIwZGF0YXNldA==",highlighted:`<span class="hljs-meta">@tool</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">create_embeddings</span>(<span class="hljs-params">
    dataset: Dataset,
    model_id: <span class="hljs-built_in">str</span>,
    column_name: <span class="hljs-built_in">str</span>,
    </span>) -&gt; Dataset:
  <span class="hljs-string">&quot;&quot;&quot;
    주어진 데이터셋에 대해 임베딩을 생성합니다.

    Args:
        dataset: 임베딩을 생성할 대상 데이터셋
        model_id: 임베딩에 사용할 모델
        column_name: 임베딩할 열 이름

    Returns:
        임베딩이 추가된 데이터셋
  &quot;&quot;&quot;</span>
  <span class="hljs-keyword">from</span> sentence_transformers <span class="hljs-keyword">import</span> SentenceTransformer

  model = SentenceTransformer(model_id)

  <span class="hljs-keyword">def</span> <span class="hljs-title function_">embed_batch</span>(<span class="hljs-params">batch</span>):
    embeddings = model.encode(batch[column_name], convert_to_numpy=<span class="hljs-literal">True</span>)
    batch[<span class="hljs-string">&quot;embeddings&quot;</span>] = embeddings.tolist()
    <span class="hljs-keyword">return</span> batch

  dataset = dataset.<span class="hljs-built_in">map</span>(embed_batch, batched=<span class="hljs-literal">True</span>)

  <span class="hljs-keyword">return</span> dataset`,wrap:!1}}),q=new i({props:{title:"DuckDB로 벡터 검색 수행하기",local:"duckdb로-벡터-검색-수행하기",headingTag:"h2"}}),v=new i({props:{title:"인덱스를 활용하지 않고 검색하기",local:"인덱스를-활용하지-않고-검색하기",headingTag:"h3"}}),X=new i({props:{title:"인덱스를 활용하여 검색하기",local:"인덱스를-활용하여-검색하기",headingTag:"h3"}}),L=new i({props:{title:"도구2 : DuckDB 인덱스 만들기",local:"도구2--duckdb-인덱스-만들기",headingTag:"h3"}}),K=new j({props:{code:"JTQwdG9vbCUwQWRlZiUyMGNyZWF0ZV9kYl9pbmRleCglMEElMjAlMjAlMjAlMjBkYXRhc2V0X3dpdGhfZW1iZWRkaW5ncyUzQSUyMERhdGFzZXQlMkMlMjAlMjAlMjMlMjAlRUMlOUUlODQlRUIlQjIlQTAlRUIlOTQlQTklRUMlOUQlQjQlMjAlRUQlOEYlQUMlRUQlOTUlQTglRUIlOTAlOUMlMjAlRUIlOEQlQjAlRUMlOUQlQjQlRUQlODQlQjAlRUMlODUlOEIlMEElMjAlMjAlMjAlMjB0YWJsZV9uYW1lJTNBJTIwc3RyJTJDJTBBJTIwJTIwJTIwJTIwZW1iZWRkaW5nX2NvbHVtbiUzQSUyMHN0ciUyMCUzRCUyMCUyMmVtYmVkZGluZ3MlMjIlMEEpJTIwLSU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MjAlMjAlMjAlMjBDUkVBVEUlMjBJTkRFWCUyMGlkeF8lN0JlbWJlZGRpbmdfY29sdW1uJTdEJTIwT04lMjAlN0J0YWJsZV9uYW1lJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwVVNJTkclMjBITlNXJTIwKCU3QmVtYmVkZGluZ19jb2x1bW4lN0RfZmxvYXQpJTIwV0lUSCUyMChtZXRyaWMlMjAlM0QlMjAnY29zaW5lJyklM0IlMEElMjAlMjAlMjAlMjAlMjIlMjIlMjIpJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwJUVDJTlFJTg0JUVDJThCJTlDJTIwJUVEJTg1JThDJUVDJTlEJUI0JUVCJUI4JTk0JTIwJUVDJUEwJTk1JUVCJUE2JUFDJTBBJTIwJTIwJTIwJTIwZHVja2RiLnNxbChmJTIyRFJPUCUyMFZJRVclMjBJRiUyMEVYSVNUUyUyMCU3QnRhYmxlX25hbWUlN0RfdGVtcCUzQiUyMik=",highlighted:`<span class="hljs-meta">@tool</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">create_db_index</span>(<span class="hljs-params">
    dataset_with_embeddings: Dataset,  <span class="hljs-comment"># 임베딩이 포함된 데이터셋</span>
    table_name: <span class="hljs-built_in">str</span>,
    embedding_column: <span class="hljs-built_in">str</span> = <span class="hljs-string">&quot;embeddings&quot;</span>
</span>) -&gt; <span class="hljs-literal">None</span>:
    <span class="hljs-string">&quot;&quot;&quot;
    임베딩이 포함된 데이터셋에 대해 DuckDB 인덱스를 생성합니다.

    Args:
        dataset_with_embeddings: 이미 임베딩이 포함된 데이터셋
        table_name: 생성할 테이블 이름
        embedding_column: 임베딩 열 이름

    Returns:
        None
    &quot;&quot;&quot;</span>
    <span class="hljs-keyword">import</span> duckdb
    
    <span class="hljs-comment"># VSS 확장 설치 및 로드</span>
    duckdb.sql(<span class="hljs-string">&quot;INSTALL vss; LOAD vss;&quot;</span>)
    duckdb.sql(<span class="hljs-string">f&quot;DROP TABLE IF EXISTS <span class="hljs-subst">{table_name}</span>;&quot;</span>)

    <span class="hljs-comment"># 데이터셋을 pandas DataFrame으로 변환</span>
    df = dataset_with_embeddings.to_pandas()

    <span class="hljs-comment"># DuckDB에 DataFrame 등록</span>
    duckdb.register(<span class="hljs-string">f&quot;<span class="hljs-subst">{table_name}</span>_temp&quot;</span>, df)

    <span class="hljs-comment"># 모델에서 임베딩 차원 가져오기</span>
    embedding_dim = <span class="hljs-built_in">len</span>(df[embedding_column].iloc[<span class="hljs-number">0</span>])
    <span class="hljs-comment"># embedding_dim = model.get_sentence_embedding_dimension()</span>

    <span class="hljs-comment"># 테이블 생성 (임베딩을 FLOAT 배열로 변환)</span>
    duckdb.sql(<span class="hljs-string">f&quot;&quot;&quot;
        CREATE TABLE <span class="hljs-subst">{table_name}</span> AS
        SELECT *, <span class="hljs-subst">{embedding_column}</span>::FLOAT[<span class="hljs-subst">{embedding_dim}</span>] AS <span class="hljs-subst">{embedding_column}</span>_float
        FROM <span class="hljs-subst">{table_name}</span>_temp;
    &quot;&quot;&quot;</span>)

    <span class="hljs-comment"># HNSW 인덱스 생성</span>
    duckdb.sql(<span class="hljs-string">f&quot;&quot;&quot;
        CREATE INDEX idx_<span class="hljs-subst">{embedding_column}</span> ON <span class="hljs-subst">{table_name}</span>
        USING HNSW (<span class="hljs-subst">{embedding_column}</span>_float) WITH (metric = &#x27;cosine&#x27;);
    &quot;&quot;&quot;</span>)

    <span class="hljs-comment"># 임시 테이블 정리</span>
    duckdb.sql(<span class="hljs-string">f&quot;DROP VIEW IF EXISTS <span class="hljs-subst">{table_name}</span>_temp;&quot;</span>)`,wrap:!1}}),ll=new i({props:{title:"도구3 : 벡터 검색 수행하기",local:"도구3--벡터-검색-수행하기",headingTag:"h3"}}),Ul=new j({props:{code:"JTQwdG9vbCUwQWRlZiUyMHNpbWlsYXJpdHlfc2VhcmNoX3dpdGhfZHVja2RiX2luZGV4KCUwQSUyMCUyMCUyMCUyMHF1ZXJ5JTNBJTI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WRkaW5nJTdEJTNBJTNBRkxPQVQlNUIlN0Jtb2RlbC5nZXRfc2VudGVuY2VfZW1iZWRkaW5nX2RpbWVuc2lvbigpJTdEJTVEKSUyMGFzJTIwZGlzdGFuY2UlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBGUk9NJTIwJTdCdGFibGVfbmFtZSU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyME9SREVSJTIwQlklMjBkaXN0YW5jZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMExJTUlUJTIwJTdCayU3RCUzQiUwQSUyMCUyMCUyMCUyMCUyMiUyMiUyMiUwQSUyMCUyMCUyMCUyMCkudG9fZGYoKQ==",highlighted:`<span class="hljs-meta">@tool</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">similarity_search_with_duckdb_index</span>(<span class="hljs-params">
    query: <span class="hljs-built_in">str</span>,
    table_name: <span class="hljs-built_in">str</span>,
    model_id: <span class="hljs-built_in">str</span>,
    k: <span class="hljs-built_in">int</span> = <span class="hljs-number">5</span>,
    embedding_column: <span class="hljs-built_in">str</span> = <span class="hljs-string">&quot;embeddings&quot;</span>
</span>)-&gt; <span class="hljs-built_in">dict</span>:
    <span class="hljs-string">&quot;&quot;&quot;
    DuckDB 인덱스를 이용해 벡터 검색을 수행합니다.

    Args:
        query: 검색할 쿼리 문자열
        model_id: 임베딩에 사용할 모델
        k: 반환할 결과 수
        table_name: 검색할 테이블 이름
        embedding_column: 임베딩 컬럼 이름

    Returns:
        dict: 검색 결과
    &quot;&quot;&quot;</span>
    <span class="hljs-keyword">from</span> sentence_transformers <span class="hljs-keyword">import</span> SentenceTransformer
    <span class="hljs-keyword">import</span> duckdb
    
    model = SentenceTransformer(model_id)
    embedding = model.encode(query).tolist()
    <span class="hljs-keyword">return</span> duckdb.sql(
        query=<span class="hljs-string">f&quot;&quot;&quot;
        SELECT *, array_cosine_distance(<span class="hljs-subst">{embedding_column}</span>_float, <span class="hljs-subst">{embedding}</span>::FLOAT[<span class="hljs-subst">{model.get_sentence_embedding_dimension()}</span>]) as distance
        FROM <span class="hljs-subst">{table_name}</span>
        ORDER BY distance
        LIMIT <span class="hljs-subst">{k}</span>;
    &quot;&quot;&quot;</span>
    ).to_df()`,wrap:!1}}),tl=new i({props:{title:"도구4 : 답변 생성 도구",local:"도구4--답변-생성-도구",headingTag:"h3"}}),sl=new j({props:{code:"JTQwdG9vbCUwQWRlZiUyMGdlbmVyYXRlX2Fuc3dlcihjaHVua3MlM0ElMjBsaXN0JTJDJTIwcXVlcnklM0ElMjBzdHIpJTIwLSUzRSUyMHN0ciUzQSUwQSUyMCUyMCUyMCUyMCUyMiUyMiUyMiUwQSUyMCUyMCUyMCUyMCVFQyVCRiVCQyVFQiVBNiVBQyVFQiVBNSVCQyUyMCVFQSVCOCVCMCVFQiVCMCU5OCVFQyU5QyVCQyVFQiVBMSU5QyUyMCVFQyVBMyVCQyVFQyU5NiVCNCVFQyVBNyU4NCUyMCVFRCU4NSU4RCVFQyU4QSVBNCVFRCU4QSVCOCUyMCVFQyVCMiVBRCVFRCU4MSVBQyUyMCVFQiVBQSVBOSVFQiVBMSU5RCVFQyU5NyU5MCVFQyU4NCU5QyUyMCVFQiU4QiVCNSVFQiVCMyU4MCVFQyU5RCU4NCUyMCVFQyU4MyU5RCVFQyU4NCVCMSVFRCU5NSVBOSVFQiU4QiU4OCVFQiU4QiVBNC4lMEElMEElMjAlMjAlMjAlMjBBcmdzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwY2h1bmtzJTNBJTIwJUVCJThCJUI1JUVCJUIzJTgwJTIwJUVDJTgzJTlEJUVDJTg0JUIxJUVDJTk3JTkwJTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVEJTk1JUEwJTIwJUVEJTg1JThEJUVDJThBJUE0JUVEJThBJUI4JTIwJUVDJUIyJUFEJUVEJTgxJUFDJTIwJUVCJUFBJUE5JUVCJUExJTlEJTBBJTIwJTIwJTIwJ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MEElMjAlMjAlMjAlMjApJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwcmVzcG9uc2UlNUIlMjJjaG9pY2VzJTIyJTVEJTVCMCU1RCU1QiUyMm1lc3NhZ2UlMjIlNUQlNUIlMjJjb250ZW50JTIyJTVE",highlighted:`<span class="hljs-meta">@tool</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">generate_answer</span>(<span class="hljs-params">chunks: <span class="hljs-built_in">list</span>, query: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;
    쿼리를 기반으로 주어진 텍스트 청크 목록에서 답변을 생성합니다.

    Args:
        chunks: 답변 생성에 사용할 텍스트 청크 목록
        query: 답변할 쿼리 문자열

    Returns:
        str: 생성된 답변
    &quot;&quot;&quot;</span>
    <span class="hljs-keyword">import</span> openai   <span class="hljs-comment"># OPENAI 키 발급이 필요합니다.</span>
    
    context = <span class="hljs-string">&quot;\\n\\n&quot;</span>.join(chunks)
    prompt = <span class="hljs-string">f&quot;Context:\\n<span class="hljs-subst">{context}</span>\\n\\nQuestion: <span class="hljs-subst">{query}</span>\\nAnswer:&quot;</span>
    response = openai.ChatCompletion.create(
        model=<span class="hljs-string">&quot;gpt-4&quot;</span>,
        messages=[{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: prompt}]
    )
    <span class="hljs-keyword">return</span> response[<span class="hljs-string">&quot;choices&quot;</span>][<span class="hljs-number">0</span>][<span class="hljs-string">&quot;message&quot;</span>][<span class="hljs-string">&quot;content&quot;</span>]`,wrap:!1}}),Tl=new j({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZS1LUkVXJTJGS29DdWx0cmUtRGVzY3JpcHRpb25zJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

dataset = load_dataset(<span class="hljs-string">&quot;huggingface-KREW/KoCultre-Descriptions&quot;</span>)`,wrap:!1}}),nl=new j({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwoJTBBJTIwJTIwJTIwJTIwJTIyUXdlbiUyRlF3ZW4yLjUtQ29kZXItMzJCLUluc3RydWN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwcHJvdmlkZXIlM0QlMjJ0b2dldGhlciUyMiUyQyUwQSUyMCUyMCUyMCUyMG1heF90b2tlbnMlM0QyMDQ4JTBBKSUwQSUwQXRvb2xzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwY3JlYXRlX2VtYmVkZGluZ3MlMkMlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjAlRUMlOUUlODQlRUIlQjIlQTAlRUIlOTQlQTklMjAlRUMlODMlOUQlRUMlODQlQjElMjAlRUIlOEYlODQlRUElQjUlQUMlMEElMjAlMjAlMjAlMjBjcmVhdGVfZGJfaW5kZXglMkMlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjAlRUMlOUQlQjglRUIlOEQlQjElRUMlOEElQTQlMjAlRUMlODMlOUQlRUMlODQlQjElMjAlRUIlOEYlODQlRUElQjUlQUMlMEElMjAlMjAlMjAlMjBzaW1pbGFyaXR5X3NlYXJjaF93aXRoX2R1Y2tkYl9pbmRleCUyQyUyMCUyMCUyMyUyMCVFQyU5QyVBMCVFQyU4MiVBQyVFQiU4RiU4NCUyMCVFQSVCMiU4MCVFQyU4MyU4OSUyMCVFQiU4RiU4NCVFQSVCNSVBQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRlX2Fuc3dlciUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMCVFQiU4QiVCNSVFQiVCMyU4MCUyMCVFQyU4MyU5RCVFQyU4NCVCMSUyMCVFQiU4RiU4NCVFQSVCNSVBQyUwQSU1RCUwQSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjB0b29scyUzRHRvb2xzJTJDJTBBJTIwJTIwJTIwJTIwdmVyYm9zaXR5X2xldmVsJTNEMiUyQyUwQSUyMCUyMCUyMCUyMG1heF9zdGVwcyUzRDE1JTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

model = InferenceClientModel(
    <span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
    provider=<span class="hljs-string">&quot;together&quot;</span>,
    max_tokens=<span class="hljs-number">2048</span>
)

tools = [
    create_embeddings,                    <span class="hljs-comment"># 임베딩 생성 도구</span>
    create_db_index,                      <span class="hljs-comment"># 인덱스 생성 도구</span>
    similarity_search_with_duckdb_index,  <span class="hljs-comment"># 유사도 검색 도구</span>
    generate_answer                       <span class="hljs-comment"># 답변 생성 도구</span>
]

agent = CodeAgent(
    model=model,
    tools=tools,
    verbosity_level=<span class="hljs-number">2</span>,
    max_steps=<span class="hljs-number">15</span>
)`,wrap:!1}}),Vl=new j({props:{code:"ZGVmJTIwYWdlbnRpY19wcm9tcHQocXVlcnklM0ElMjBzdHIpJTNBJTBBJTIwJTIwcmV0dXJuJTIwZiUyMiUyMiUyMiUw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yMCUyMC0lMjBzZW50ZW5jZS10cmFuc2Zvcm1lcnMlMkZhbGwtbXBuZXQtYmFzZS12MiUyMChiYWxhbmNlZCUyMHBlcmZvcm1hbmNlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC0lMjBpbnRmbG9hdCUyRmU1LWxhcmdlLXYyJTIwKGhpZ2glMjBxdWFsaXR5JTIwZm9yJTIwY29tcGxleCUyMHRhc2tzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC0lMjBtaW5pc2hsYWIlMkZwb3Rpb24tYmFzZS04TSUyMCh2ZXJ5JTIwZWZmaWNpZW50KSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMiUyMiUyMg==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">agentic_prompt</span>(<span class="hljs-params">query: <span class="hljs-built_in">str</span></span>):
  <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;&quot;&quot;
      당신은 지능형 검색 전문가입니다. <span class="hljs-subst">{query}</span>:

      검색을 위해 먼저 쿼리와 데이터셋을 분석하고, 분석 결과에 따라 가장 적합한 임베딩 모델을 선택하세요
        - sentence-transformers/all-MiniLM-L6-v2 (fast, lightweight, good for simple queries)
        - sentence-transformers/all-mpnet-base-v2 (balanced performance)
        - intfloat/e5-large-v2 (high quality for complex tasks)
        - minishlab/potion-base-8M (very efficient)
      &quot;&quot;&quot;</span>`,wrap:!1}}),Il=new j({props:{code:"cmVzdWx0JTIwJTNEJTIwYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMGFnZW50aWNfcHJvbXB0KHF1ZXJ5JTNEJTIyJUVDJTk1JTg0JUVDJTlEJUI0JUVCJThGJThDJTIwJUVBJUI0JTgwJUVCJUEwJUE4JTIwJUVCJUIwJTg4JTIwJUVDJTk1JThDJUVCJUEwJUE0JUVDJUEzJUJDJUVDJTg0JUI4JUVDJTlBJTk0JTIyKSUyQyUwQSUyMCUyMCUyMCUyMGFkZGl0aW9uYWxfYXJncyUzRCU3QiUyMmRhdGFzZXQlMjIlM0ElMjBkYXRhc2V0JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyZGF0YXNldF9kZXNjcmlwdGlvbiUyMiUzQSUyMCUyMiVFRCU5NSU5QyVFQSVCNSVBRCVFQyU5NiVCNCUyMCVFQiVCMCU4OChtZW1lKSVFQyU5NyU5MCUyMCVFQiU4QyU4MCVFRCU5NSU5QyUyMCVFQiU4RCVCMCVFQyU5RCVCNCVFRCU4NCVCMCVFQyU4NSU4QiVFQyU5QyVCQyVFQiVBMSU5QyUyQyUyMG1lbWUlRUElQjMlQkModGl0bGUpJTJDJTIwbWVtZSVFQyU5RCU5OCUyMCVFQiU5QyVCQihjb250ZW50KSVFQyU5RCU4NCUyMCVFQyU5NSU4QyVFQiVBMCVBNCVFQyVBNCU4MCVFQiU4QiVBNC4lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjb2x1bW5fbmFtZSUyMiUzQSUyMCUyMmNvbnRlbnQlMjIlN0QlMEEp",highlighted:`result = agent.run(
    agentic_prompt(query=<span class="hljs-string">&quot;아이돌 관련 밈 알려주세요&quot;</span>),
    additional_args={<span class="hljs-string">&quot;dataset&quot;</span>: dataset,
                     <span class="hljs-string">&quot;dataset_description&quot;</span>: <span class="hljs-string">&quot;한국어 밈(meme)에 대한 데이터셋으로, meme과(title), meme의 뜻(content)을 알려준다.&quot;</span>,
                     <span class="hljs-string">&quot;column_name&quot;</span>: <span class="hljs-string">&quot;content&quot;</span>}
)`,wrap:!1}}),jl=new j({props:{code:"cHJpbnQoZiUyMkZpbmFsJTIwcmVzdWx0JTNBJTIwJTdCcmVzdWx0JTdEJTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Final result: <span class="hljs-subst">{result}</span>&quot;</span>)',wrap:!1}}),wl=new j({props:{code:"RmluYWwlMjByZXN1bHQlM0ElMjAlRUMlOTclODQlRUIlQTclODglRUElQjAlODAlRUIlOTAlOTglRUIlOEElOTQlMjAlRUIlQjAlODglRUMlOUQlODAlMjAlRUMlQjUlOUMlRUElQjclQkMlMjBTTlMlRUMlOTklODAlMjAlRUMlOTglQTglRUIlOUQlQkMlRUMlOUQlQjglMjAlRUMlQkIlQTQlRUIlQUUlQTQlRUIlOEIlODglRUQlOEIlQjAlRUMlOTclOTAlRUMlODQlOUMlMjAlRUMlOUMlQTAlRUQlOTYlODklRUQlOTUlOTglRUIlOEElOTQlMjAlRUQlOTElOUMlRUQlOTglODQlRUMlOUMlQkMlRUIlQTElOUMlMkMlMjAlRUMlQTMlQkMlRUIlQTElOUMlMjAlRUIlODglODQlRUElQjUlQjAlRUElQjAlODAlRUElQjAlODAlMjAlRUIlQTclQTQlRUMlOUElQjAlMjAlRUElQjclODAlRUMlOTclQkQlRUElQjElQjAlRUIlODIlOTglMjAlRUMlODIlQUMlRUIlOUUlOTElRUMlOEElQTQlRUIlOUYlQUMlRUMlOUIlOEMlRUMlODQlOUMlMjAlRUIlQUElQTglRUMlODQlQjElRUMlOTUlQTAlRUMlQTAlODElMjAlRUElQjAlOTAlRUMlQTAlOTUlRUMlOUQlODQlMjAlRUIlOEElOTAlRUIlODIlODQlMjAlRUIlOTUlOEMlMjAlRUMlODIlQUMlRUMlOUElQTklRUIlOTAlQTklRUIlOEIlODglRUIlOEIlQTQuJTIwJUVDJTlEJUI0JTIwJUVEJTkxJTlDJUVEJTk4JTg0JUVDJTlEJTgwJTIwJUVDJTk1JTg0JUVDJTlEJUI0JUVCJThGJThDJTIwJUVEJThDJUFDJUVCJThEJUE0JTIwJUVCJUFDJUI4JUVEJTk5JTk0JUVDJTk3JTkwJUVDJTg0JTlDJTIwJUVDJTlFJTkwJUVDJUEzJUJDJTIwJUVDJTgyJUFDJUVDJTlBJUE5JUVCJTkwJTk4JUVCJUE5JUIwJTJDJTIwJyVFQyU5NyU4NCVFQiVBNyU4OCVFQSVCMCU4MCUyMCVFQiU4RiVCQyclRUElQjAlODAlMjAlRUMlOTglQUMlRUIlQjAlOTQlRUIlQTUlQjglMjAlRUQlOTElOUMlRUElQjglQjAlRUMlOUQlQjQlRUMlQTclODAlRUIlQTclOEMlMjAlRUMlOUQlOTglRUIlOEYlODQlRUMlQTAlODElRUMlOUQlQjglMjAlRUIlQTclOUUlRUMlQjYlQTQlRUIlQjIlOTUlMjAlRUQlOEMlOEMlRUElQjQlQjQlRUIlQTUlQkMlMjAlRUQlODYlQjUlRUQlOTUlQjQlMjAlRUIlQjAlODglRUMlOUMlQkMlRUIlQTElOUMlRUMlODQlOUMlRUMlOUQlOTglMjAlRUIlOEYlODUlRUQlOEElQjklRUQlOTUlOUMlMjAlRUMlODQlQjElRUElQjIlQTklRUMlOUQlODQlMjAlRUElQjAlOTYlRUElQjIlOEMlMjAlRUIlOTAlOTglRUMlOTclODglRUMlOEElQjUlRUIlOEIlODglRUIlOEIlQTQu",highlighted:'<span class="hljs-keyword">Final</span> <span class="hljs-keyword">result</span>: 엄마가되는 밈은 최근 SNS와 온라인 커뮤니티에서 유행하는 표현으로, 주로 누군가가 매우 귀엽거나 사랑스러워서 모성애적 감정을 느낄 때 사용됩니다. 이 표현은 아이돌 팬덤 문화에서 자주 사용되며, <span class="hljs-string">&#x27;엄마가 돼&#x27;</span>가 올바른 표기이지만 의도적인 맞춤법 파괴를 통해 밈으로서의 독특한 성격을 갖게 되었습니다.',wrap:!1}}),pl=new i({props:{title:"Conclusion",local:"conclusion",headingTag:"h3"}}),El=new iM({props:{source:"https://github.com/huggingface/cookbook/blob/main/notebooks/ko/vector_search_agent.md"}}),{c(){w=e("meta"),ul=J(),Fl=e("p"),cl=J(),T(p.$$.fragment),Ol=J(),T(R.$$.fragment),bl=J(),T(m.$$.fragment),ol=J(),E=e("p"),E.innerHTML=gU,Bl=J(),F=e("p"),F.textContent=fU,dl=J(),A=e("ol"),A.innerHTML=hU,Nl=J(),u=e("p"),u.textContent=SU,gl=J(),c=e("p"),c.textContent=rU,fl=J(),T(O.$$.fragment),hl=J(),b=e("p"),b.textContent=kU,Sl=J(),T(o.$$.fragment),rl=J(),B=e("p"),B.textContent=DU,kl=J(),T(d.$$.fragment),Dl=J(),T(N.$$.fragment),$l=J(),g=e("p"),g.innerHTML=$U,Zl=J(),f=e("p"),f.textContent=ZU,Wl=J(),h=e("p"),h.textContent=WU,Gl=J(),T(S.$$.fragment),_l=J(),r=e("p"),r.textContent=GU,xl=J(),T(k.$$.fragment),ql=J(),T(D.$$.fragment),Yl=J(),T($.$$.fragment),vl=J(),Z=e("p"),Z.textContent=_U,zl=J(),W=e("ul"),W.innerHTML=xU,Xl=J(),T(G.$$.fragment),Hl=J(),_=e("p"),_.textContent=qU,Ll=J(),T(x.$$.fragment),Kl=J(),T(q.$$.fragment),Pl=J(),Y=e("p"),Y.innerHTML=YU,lU=J(),T(v.$$.fragment),UU=J(),z=e("p"),z.textContent=vU,MU=J(),T(X.$$.fragment),tU=J(),H=e("p"),H.textContent=zU,JU=J(),T(L.$$.fragment),sU=J(),T(K.$$.fragment),eU=J(),P=e("p"),P.textContent=XU,CU=J(),T(ll.$$.fragment),TU=J(),T(Ul.$$.fragment),yU=J(),Ml=e("p"),Ml.textContent=HU,nU=J(),T(tl.$$.fragment),QU=J(),Jl=e("p"),Jl.textContent=LU,VU=J(),T(sl.$$.fragment),aU=J(),el=e("p"),el.textContent=KU,IU=J(),Cl=e("p"),Cl.innerHTML=PU,jU=J(),T(Tl.$$.fragment),iU=J(),yl=e("p"),yl.textContent=lM,wU=J(),T(nl.$$.fragment),pU=J(),Ql=e("p"),Ql.textContent=UM,RU=J(),T(Vl.$$.fragment),mU=J(),al=e("p"),al.textContent=MM,EU=J(),T(Il.$$.fragment),FU=J(),T(jl.$$.fragment),AU=J(),il=e("pre"),il.textContent=tM,uU=J(),T(wl.$$.fragment),cU=J(),T(pl.$$.fragment),OU=J(),Rl=e("p"),Rl.textContent=JM,bU=J(),ml=e("p"),ml.textContent=sM,oU=J(),T(El.$$.fragment),BU=J(),Al=e("p"),this.h()},l(l){const U=aM("svelte-u9bgzb",document.head);w=C(U,"META",{name:!0,content:!0}),U.forEach(M),ul=s(l),Fl=C(l,"P",{}),eM(Fl).forEach(M),cl=s(l),y(p.$$.fragment,l),Ol=s(l),y(R.$$.fragment,l),bl=s(l),y(m.$$.fragment,l),ol=s(l),E=C(l,"P",{"data-svelte-h":!0}),I(E)!=="svelte-owjfcg"&&(E.innerHTML=gU),Bl=s(l),F=C(l,"P",{"data-svelte-h":!0}),I(F)!=="svelte-1c92z2c"&&(F.textContent=fU),dl=s(l),A=C(l,"OL",{"data-svelte-h":!0}),I(A)!=="svelte-368w9u"&&(A.innerHTML=hU),Nl=s(l),u=C(l,"P",{"data-svelte-h":!0}),I(u)!=="svelte-1x27ct1"&&(u.textContent=SU),gl=s(l),c=C(l,"P",{"data-svelte-h":!0}),I(c)!=="svelte-1az0hy6"&&(c.textContent=rU),fl=s(l),y(O.$$.fragment,l),hl=s(l),b=C(l,"P",{"data-svelte-h":!0}),I(b)!=="svelte-1qp8008"&&(b.textContent=kU),Sl=s(l),y(o.$$.fragment,l),rl=s(l),B=C(l,"P",{"data-svelte-h":!0}),I(B)!=="svelte-1qd4ash"&&(B.textContent=DU),kl=s(l),y(d.$$.fragment,l),Dl=s(l),y(N.$$.fragment,l),$l=s(l),g=C(l,"P",{"data-svelte-h":!0}),I(g)!=="svelte-1b38992"&&(g.innerHTML=$U),Zl=s(l),f=C(l,"P",{"data-svelte-h":!0}),I(f)!=="svelte-1cn3q17"&&(f.textContent=ZU),Wl=s(l),h=C(l,"P",{"data-svelte-h":!0}),I(h)!=="svelte-1af45jk"&&(h.textContent=WU),Gl=s(l),y(S.$$.fragment,l),_l=s(l),r=C(l,"P",{"data-svelte-h":!0}),I(r)!=="svelte-3y32x0"&&(r.textContent=GU),xl=s(l),y(k.$$.fragment,l),ql=s(l),y(D.$$.fragment,l),Yl=s(l),y($.$$.fragment,l),vl=s(l),Z=C(l,"P",{"data-svelte-h":!0}),I(Z)!=="svelte-1n2ss7b"&&(Z.textContent=_U),zl=s(l),W=C(l,"UL",{"data-svelte-h":!0}),I(W)!=="svelte-c88pvg"&&(W.innerHTML=xU),Xl=s(l),y(G.$$.fragment,l),Hl=s(l),_=C(l,"P",{"data-svelte-h":!0}),I(_)!=="svelte-1xn2q0w"&&(_.textContent=qU),Ll=s(l),y(x.$$.fragment,l),Kl=s(l),y(q.$$.fragment,l),Pl=s(l),Y=C(l,"P",{"data-svelte-h":!0}),I(Y)!=="svelte-18k1ji7"&&(Y.innerHTML=YU),lU=s(l),y(v.$$.fragment,l),UU=s(l),z=C(l,"P",{"data-svelte-h":!0}),I(z)!=="svelte-of1kmm"&&(z.textContent=vU),MU=s(l),y(X.$$.fragment,l),tU=s(l),H=C(l,"P",{"data-svelte-h":!0}),I(H)!=="svelte-16chymz"&&(H.textContent=zU),JU=s(l),y(L.$$.fragment,l),sU=s(l),y(K.$$.fragment,l),eU=s(l),P=C(l,"P",{"data-svelte-h":!0}),I(P)!=="svelte-b4gp9c"&&(P.textContent=XU),CU=s(l),y(ll.$$.fragment,l),TU=s(l),y(Ul.$$.fragment,l),yU=s(l),Ml=C(l,"P",{"data-svelte-h":!0}),I(Ml)!=="svelte-1yfgbs2"&&(Ml.textContent=HU),nU=s(l),y(tl.$$.fragment,l),QU=s(l),Jl=C(l,"P",{"data-svelte-h":!0}),I(Jl)!=="svelte-1k09lse"&&(Jl.textContent=LU),VU=s(l),y(sl.$$.fragment,l),aU=s(l),el=C(l,"P",{"data-svelte-h":!0}),I(el)!=="svelte-en7cjr"&&(el.textContent=KU),IU=s(l),Cl=C(l,"P",{"data-svelte-h":!0}),I(Cl)!=="svelte-53u7m"&&(Cl.innerHTML=PU),jU=s(l),y(Tl.$$.fragment,l),iU=s(l),yl=C(l,"P",{"data-svelte-h":!0}),I(yl)!=="svelte-gsyogr"&&(yl.textContent=lM),wU=s(l),y(nl.$$.fragment,l),pU=s(l),Ql=C(l,"P",{"data-svelte-h":!0}),I(Ql)!=="svelte-25stim"&&(Ql.textContent=UM),RU=s(l),y(Vl.$$.fragment,l),mU=s(l),al=C(l,"P",{"data-svelte-h":!0}),I(al)!=="svelte-q81us6"&&(al.textContent=MM),EU=s(l),y(Il.$$.fragment,l),FU=s(l),y(jl.$$.fragment,l),AU=s(l),il=C(l,"PRE",{"data-svelte-h":!0}),I(il)!=="svelte-dwlxai"&&(il.textContent=tM),uU=s(l),y(wl.$$.fragment,l),cU=s(l),y(pl.$$.fragment,l),OU=s(l),Rl=C(l,"P",{"data-svelte-h":!0}),I(Rl)!=="svelte-1xsmqoq"&&(Rl.textContent=JM),bU=s(l),ml=C(l,"P",{"data-svelte-h":!0}),I(ml)!=="svelte-16cnm9y"&&(ml.textContent=sM),oU=s(l),y(El.$$.fragment,l),BU=s(l),Al=C(l,"P",{}),eM(Al).forEach(M),this.h()},h(){CM(w,"name","hf:doc:metadata"),CM(w,"content",RM)},m(l,U){IM(document.head,w),t(l,ul,U),t(l,Fl,U),t(l,cl,U),n(p,l,U),t(l,Ol,U),n(R,l,U),t(l,bl,U),n(m,l,U),t(l,ol,U),t(l,E,U),t(l,Bl,U),t(l,F,U),t(l,dl,U),t(l,A,U),t(l,Nl,U),t(l,u,U),t(l,gl,U),t(l,c,U),t(l,fl,U),n(O,l,U),t(l,hl,U),t(l,b,U),t(l,Sl,U),n(o,l,U),t(l,rl,U),t(l,B,U),t(l,kl,U),n(d,l,U),t(l,Dl,U),n(N,l,U),t(l,$l,U),t(l,g,U),t(l,Zl,U),t(l,f,U),t(l,Wl,U),t(l,h,U),t(l,Gl,U),n(S,l,U),t(l,_l,U),t(l,r,U),t(l,xl,U),n(k,l,U),t(l,ql,U),n(D,l,U),t(l,Yl,U),n($,l,U),t(l,vl,U),t(l,Z,U),t(l,zl,U),t(l,W,U),t(l,Xl,U),n(G,l,U),t(l,Hl,U),t(l,_,U),t(l,Ll,U),n(x,l,U),t(l,Kl,U),n(q,l,U),t(l,Pl,U),t(l,Y,U),t(l,lU,U),n(v,l,U),t(l,UU,U),t(l,z,U),t(l,MU,U),n(X,l,U),t(l,tU,U),t(l,H,U),t(l,JU,U),n(L,l,U),t(l,sU,U),n(K,l,U),t(l,eU,U),t(l,P,U),t(l,CU,U),n(ll,l,U),t(l,TU,U),n(Ul,l,U),t(l,yU,U),t(l,Ml,U),t(l,nU,U),n(tl,l,U),t(l,QU,U),t(l,Jl,U),t(l,VU,U),n(sl,l,U),t(l,aU,U),t(l,el,U),t(l,IU,U),t(l,Cl,U),t(l,jU,U),n(Tl,l,U),t(l,iU,U),t(l,yl,U),t(l,wU,U),n(nl,l,U),t(l,pU,U),t(l,Ql,U),t(l,RU,U),n(Vl,l,U),t(l,mU,U),t(l,al,U),t(l,EU,U),n(Il,l,U),t(l,FU,U),n(jl,l,U),t(l,AU,U),t(l,il,U),t(l,uU,U),n(wl,l,U),t(l,cU,U),n(pl,l,U),t(l,OU,U),t(l,Rl,U),t(l,bU,U),t(l,ml,U),t(l,oU,U),n(El,l,U),t(l,BU,U),t(l,Al,U),dU=!0},p:yM,i(l){dU||(Q(p.$$.fragment,l),Q(R.$$.fragment,l),Q(m.$$.fragment,l),Q(O.$$.fragment,l),Q(o.$$.fragment,l),Q(d.$$.fragment,l),Q(N.$$.fragment,l),Q(S.$$.fragment,l),Q(k.$$.fragment,l),Q(D.$$.fragment,l),Q($.$$.fragment,l),Q(G.$$.fragment,l),Q(x.$$.fragment,l),Q(q.$$.fragment,l),Q(v.$$.fragment,l),Q(X.$$.fragment,l),Q(L.$$.fragment,l),Q(K.$$.fragment,l),Q(ll.$$.fragment,l),Q(Ul.$$.fragment,l),Q(tl.$$.fragment,l),Q(sl.$$.fragment,l),Q(Tl.$$.fragment,l),Q(nl.$$.fragment,l),Q(Vl.$$.fragment,l),Q(Il.$$.fragment,l),Q(jl.$$.fragment,l),Q(wl.$$.fragment,l),Q(pl.$$.fragment,l),Q(El.$$.fragment,l),dU=!0)},o(l){V(p.$$.fragment,l),V(R.$$.fragment,l),V(m.$$.fragment,l),V(O.$$.fragment,l),V(o.$$.fragment,l),V(d.$$.fragment,l),V(N.$$.fragment,l),V(S.$$.fragment,l),V(k.$$.fragment,l),V(D.$$.fragment,l),V($.$$.fragment,l),V(G.$$.fragment,l),V(x.$$.fragment,l),V(q.$$.fragment,l),V(v.$$.fragment,l),V(X.$$.fragment,l),V(L.$$.fragment,l),V(K.$$.fragment,l),V(ll.$$.fragment,l),V(Ul.$$.fragment,l),V(tl.$$.fragment,l),V(sl.$$.fragment,l),V(Tl.$$.fragment,l),V(nl.$$.fragment,l),V(Vl.$$.fragment,l),V(Il.$$.fragment,l),V(jl.$$.fragment,l),V(wl.$$.fragment,l),V(pl.$$.fragment,l),V(El.$$.fragment,l),dU=!1},d(l){l&&(M(ul),M(Fl),M(cl),M(Ol),M(bl),M(ol),M(E),M(Bl),M(F),M(dl),M(A),M(Nl),M(u),M(gl),M(c),M(fl),M(hl),M(b),M(Sl),M(rl),M(B),M(kl),M(Dl),M($l),M(g),M(Zl),M(f),M(Wl),M(h),M(Gl),M(_l),M(r),M(xl),M(ql),M(Yl),M(vl),M(Z),M(zl),M(W),M(Xl),M(Hl),M(_),M(Ll),M(Kl),M(Pl),M(Y),M(lU),M(UU),M(z),M(MU),M(tU),M(H),M(JU),M(sU),M(eU),M(P),M(CU),M(TU),M(yU),M(Ml),M(nU),M(QU),M(Jl),M(VU),M(aU),M(el),M(IU),M(Cl),M(jU),M(iU),M(yl),M(wU),M(pU),M(Ql),M(RU),M(mU),M(al),M(EU),M(FU),M(AU),M(il),M(uU),M(cU),M(OU),M(Rl),M(bU),M(ml),M(oU),M(BU),M(Al)),M(w),a(p,l),a(R,l),a(m,l),a(O,l),a(o,l),a(d,l),a(N,l),a(S,l),a(k,l),a(D,l),a($,l),a(G,l),a(x,l),a(q,l),a(v,l),a(X,l),a(L,l),a(K,l),a(ll,l),a(Ul,l),a(tl,l),a(sl,l),a(Tl,l),a(nl,l),a(Vl,l),a(Il,l),a(jl,l),a(wl,l),a(pl,l),a(El,l)}}}const RM='{"title":"🤖 벡터 검색 에이전트: 허깅페이스 허브를 백엔드로 하는 지능형 검색 엔진","local":"-벡터-검색-에이전트-허깅페이스-허브를-백엔드로-하는-지능형-검색-엔진","sections":[{"title":"Agentic 접근 방식의 차별점","local":"agentic-접근-방식의-차별점","sections":[],"depth":3},{"title":"DuckDB?","local":"duckdb","sections":[],"depth":3}],"depth":1}';function mM(NU){return nM(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class cM extends QM{constructor(w){super(),VM(this,w,mM,pM,TM,{})}}export{cM as component};
