Workspace IndexKnowledge Notes › Embeddings retrieve the right context, MCP governs what an agent may do with it — the loop between them is where trust holds or breaks

#114Talk2026-09-21geminiconverseraw

Embeddings retrieve the right context, MCP governs what an agent may do with it — the loop between them is where trust holds or breaks

ByteMonk's video (YouTube, 10:03) ties together the four pieces that make up today's agent stack: embeddings, vector databases, the agent tool-calling loop, and Anthropic's Model Context Protocol (MCP). The claim is that modern AI is moving from standalone chat into autonomous agents that must reliably read and act on real data, and that requires all four pieces working together rather than any one of them in isolation. Embedding models project text, code and images into 768–1536-dimension vectors, where semantic similarity becomes geometric proximity, measured as cosine similarity, dot product or Euclidean distance. Because exact nearest-neighbor search across millions of vectors is an O(N) scan, production vector databases use approximate nearest-neighbor (ANN) indexes — HNSW graphs or IVF — to get sub-millisecond retrieval instead. The agent loop wraps a tool call around that retrieval: observe, reason, dispatch a structured JSON tool call, execute and feed the result back, repeat until the goal is verified. MCP is the standard that lets an agent reach any of those tools without one-off glue code for every model-tool pair.

For Jayverse this is a primer rather than new ground: it names, in one place, the primitives that Tech #68 (MCP from three sides) and #99 (vibe modeling via Blender MCP) already touched separately. Worth reading before turning the Auditor into an actual MCP server, and worth keeping the four names straight — it's easy to talk about "RAG" when the real question is which of embeddings, ANN indexing, the loop, or MCP is the piece that's missing.

Why

Each of these four pieces solves one narrow problem, and skipping any of them reintroduces it. Skip embeddings and vector search, and an agent can only work with whatever fits in its prompt — it cannot find the one relevant function in a codebase it hasn't fully read. Skip a real agent loop, and a single tool call stands in for reasoning: no retry, no way to notice a bad result and adjust. Skip MCP, and every new tool needs its own integration against every model provider, an M×N problem that stops scaling past a handful of tools. The more interesting failure, though, sits inside the loop itself: "iterate until the goal is verified" quietly assumes there is a verifier. If the only thing checking the agent's work is the same loop that produced it, verification is theater — that's the harness-and-eval half of the problem (Tech #106, #102), and the failure mode at the end of it is an agent that grades its own homework (Tech #125). MCP's authorization boundary is a narrower, more mechanical version of the same worry: it keeps credentials out of the prompt, which is necessary, but it says nothing about whether the tool call itself was the right one to make.

How it works

Embeddings turn content into geometry

An embedding model maps a chunk of text, code or an image to a vector, typically 768 dimensions (BERT-base) or 1536 (OpenAI's text-embedding-3-small and the older ada-002). Two chunks that mean similar things land near each other in that space, and "near" is one of cosine similarity, dot product or Euclidean distance — three different ways to score the same geometric idea, chosen per embedding model's training objective.

ANN indexing makes retrieval affordable at scale

Comparing a query vector against every stored vector is an O(N) brute-force scan, which does not hold up past a few hundred thousand rows. Vector databases instead build an approximate nearest-neighbor index. HNSW (Hierarchical Navigable Small World, Malkov & Yashunin) builds a multi-layer graph where search starts at a sparse top layer and descends into denser layers, landing close to the true nearest neighbors in a handful of hops. IVF (Inverted File index, the technique behind Meta's FAISS library) partitions the vector space into clusters ahead of time and only searches the clusters nearest the query. Both trade a small, tunable amount of recall for retrieval that stays sub-millisecond as the collection grows into the millions.

The agent loop: observe, reason, dispatch, iterate

The loop that turns an LLM into an agent has four steps: observe (take in the user's input and current context), reason (decide whether external data or an action is needed), dispatch (emit a structured JSON payload naming a specific tool and its arguments), and execute-and-feed-back (the runtime calls the tool, the result goes back into the context, and the loop repeats until the goal is met). Retrieval is just one possible tool call inside this loop — the loop itself doesn't care whether the tool queries a vector database, hits an API or writes a file.

MCP: one standard instead of custom glue per tool

Before MCP, connecting a model to external data — GitHub, Postgres, Drive, local files — meant bespoke integration code for every tool and every model provider, an M×N problem. MCP standardizes this as a client-host-server architecture, a comparison MCP's own documentation draws to the Language Server Protocol in IDEs: the host is the application coordinating everything (Claude Desktop, Gemini CLI), the client is the protocol handler holding the connection, and the server is a small, isolated process exposing tools, resources and prompts in a standard schema. MCP also draws the authorization boundary explicitly, so credentials and API keys live in the server's configuration rather than in the prompt text a model can see or leak.

Where it lands in Jayverse

  • Auditor: an MCP server, not a script. Expose check_rule and get_evidence as MCP tools; its resource is the rule set kept whole in context rather than chunked and retrieved — the tradeoff the item rag-vs-long-context-hybrid-filter-then-attend covers directly.
  • alice: the rail/index as an MCP resource. Let Claude query "already covered?" against the index through MCP instead of re-reading every history file on each session.
  • Verex: devnet RPC and the CLI as MCP tools. Tech #99's lesson applies here too — a scriptable surface with an observable result is what makes an MCP tool usable, the same requirement a Blender MCP call has when it checks its work with a screenshot.
  • Eng: the two-sentence interview answer. MCP standardizes how a model reaches tools and data, the way LSP standardized how an editor reaches language backends — one client-host-server contract instead of custom glue per pair.

Verified and unverified

Verified on 2026-09-21: MCP was released by Anthropic in November 2024 and adopted by OpenAI, Google and other providers through 2025; the LSP analogy is the one used in MCP's own documentation; HNSW is a real ANN algorithm from Malkov and Yashunin (2016 preprint, 2018 published version); IVF is a real technique implemented in FAISS; 768 and 1536 are documented default embedding dimensions for BERT-base and OpenAI's text-embedding-3-small/ada-002 respectively. Taken from the summary and not independently checked: the framing of exact vector search as strictly O(N) brute force (true in complexity terms, though production systems also lean on hardware and batching before reaching for ANN), and the claim that these four pieces are the complete list of what a modern agent needs — no per-fact timestamps were given in this summary to cite.

Sources: YouTube — ByteMonk, "Embeddings, Vector Databases, Agents & MCP: How Modern AI Systems Actually Work" (10:03) · related items: Tech #68 (MCP from three sides), Tech #99 (vibe modeling via Blender MCP), Tech #106 (harness engineering), Tech #102 (eval), Tech #125 (an agent that grades itself), Tech #63 (the boundary file), rag-vs-long-context-hybrid-filter-then-attend.

Key expressions

Words and phrases from this page worth keeping, with the Korean meaning and the sentence they come from.

Expression뜻 · 쓰이는 자리
embedding임베딩(텍스트·코드·이미지를 벡터로 투영한 것) · 의미 검색의 기본 단위. "project text, code and images into 768–1536-dimension vectors"
vector database벡터 데이터베이스(임베딩을 저장하고 유사도로 검색하는 저장소) · 의미 검색 인프라의 핵심. "production vector databases use approximate nearest-neighbor (ANN) indexes"
cosine similarity코사인 유사도(두 벡터 사이 각도로 재는 유사도) · 임베딩 비교의 표준 지표 중 하나. "cosine similarity, dot product or Euclidean distance"
dot product내적(두 벡터 성분을 곱해 더한 값) · 코사인 유사도와 함께 쓰는 유사도 계산법. "cosine similarity, dot product or Euclidean distance"
Euclidean distance유클리드 거리(두 점 사이 직선 거리) · 벡터 공간에서의 근접성 측정법. "cosine similarity, dot product or Euclidean distance"
ANN (Approximate Nearest Neighbor)근사 최근접 이웃(정확도를 약간 포기하고 빠르게 찾는 탐색) · O(N) 전수 탐색의 대안. "approximate nearest-neighbor (ANN) indexes"
HNSWHierarchical Navigable Small World(계층형 항해 가능 소세계 그래프, ANN 인덱스 알고리즘) · 다층 그래프로 빠르게 근접 벡터를 찾는 방식. "HNSW graphs or IVF"
IVFInverted File index(역파일 인덱스, ANN 인덱스 알고리즘) · 벡터 공간을 클러스터로 나눠 탐색 범위를 줄이는 기법, FAISS의 핵심. "HNSW graphs or IVF"
FAISSFacebook AI Similarity Search(Meta가 만든 벡터 유사도 검색 라이브러리) · IVF 같은 기법이 구현된 원조 라이브러리. "the technique behind Meta's FAISS library"
O(N)빅오 표기법으로 입력 크기 N에 비례하는 계산량 · 전수 탐색(브루트포스)의 시간 복잡도. "an O(N) brute-force scan"
agent loop에이전트 루프(관찰-추론-디스패치-실행을 반복하는 구조) · LLM을 자율 에이전트로 만드는 핵심 구조. "observe, reason, dispatch a structured JSON tool call"
tool dispatch도구 디스패치(어떤 도구를 어떤 인자로 호출할지 내보내는 단계) · 에이전트 루프의 한 단계. "dispatch a structured JSON tool call"
JSON payloadJSON 페이로드(도구 호출에 실어 보내는 구조화된 데이터) · 도구 호출의 구체적 형태. "a structured JSON payload naming a specific tool"
MCPModel Context Protocol(모델 컨텍스트 프로토콜, Anthropic이 만든 에이전트-도구 연결 표준) · 이 항목의 핵심 주제. "Anthropic's Model Context Protocol (MCP)"
M×N problemM곱N 문제(도구 M개와 모델 N개마다 각자 연결 코드가 필요해지는 조합 폭발) · MCP가 풀려는 문제. "an M×N problem that stops scaling"
LSPLanguage Server Protocol(언어 서버 프로토콜, IDE와 언어 분석기를 표준으로 연결하는 프로토콜) · MCP가 스스로 드는 비유. "the Language Server Protocol in IDEs"
authorization boundary권한 경계(자격 증명과 접근 범위를 가르는 선) · 프롬프트 밖에 자격 증명을 두는 안전장치. "MCP's authorization boundary"
harness engineering하니스 엔지니어링(에이전트를 감싸는 실행·검증 장치를 설계하는 일) · 루프의 검증 문제와 직결된 개념. "the harness-and-eval half of the problem"
eval이밸류에이션(모델·에이전트 성능을 체계적으로 측정하는 평가) · 검증이 실제로 이루어지는지 확인하는 절차. "the harness-and-eval half of the problem"
galaxy-brain risk(비유) 지나치게 자기 확신에 빠진 추론의 위험 · 검증자가 없는 루프의 극단적 실패, 자기 채점 에이전트를 가리키는 표현. "an agent that grades its own homework"

← All Knowledge Notes · Workspace Index · Top ↑

임베딩이 맥락을 찾아오고, MCP는 에이전트가 그것으로 무엇을 하도록 허용할지 정한다 — 신뢰는 그 사이의 루프에서 지켜지거나 깨진다

ByteMonk의 영상(YouTube, 10:03)은 오늘날 에이전트 스택을 이루는 네 조각, 즉 임베딩, 벡터 데이터베이스, 에이전트 도구 호출 루프, 그리고 Anthropic의 MCP(Model Context Protocol)를 하나로 엮는다. 주장은 이렇다. 최신 AI는 독립된 챗 인터페이스에서 벗어나, 실제 데이터를 안정적으로 읽고 행동하는 자율 에이전트로 옮겨가고 있고, 이를 위해서는 네 조각 중 하나만이 아니라 넷이 함께 작동해야 한다. 임베딩 모델은 텍스트, 코드, 이미지를 768~1536차원 벡터로 투영하고, 이 공간에서 의미적 유사성은 기하학적 근접성이 된다. 코사인 유사도, 내적(dot product), 유클리드 거리로 측정한다. 수백만 개 벡터에 대한 정확한 최근접 이웃 탐색은 O(N) 스캔이므로, 실전 벡터 데이터베이스는 근사 최근접 이웃(ANN) 인덱스, 즉 HNSW 그래프나 IVF를 써서 서브밀리초 수준의 검색을 얻는다. 에이전트 루프는 그 검색 위에 도구 호출을 두른다. 관찰하고, 추론하고, 구조화된 JSON 도구 호출을 내보내고, 실행 결과를 다시 피드백하고, 목표가 달성될 때까지 반복한다. MCP는 모델-도구 쌍마다 일회용 연결 코드를 짜지 않고도 에이전트가 그 도구들에 닿게 해 주는 표준이다.

Jayverse 입장에서 이것은 새로운 내용이라기보다 정리다. Tech #68(세 각도에서 본 MCP)과 #99(Blender MCP를 통한 바이브 모델링)가 따로 건드렸던 원시 개념들을 한자리에 이름 붙여 놓았다. Auditor를 실제 MCP 서버로 만들기 전에 읽어 둘 만하고, "RAG" 한 단어로 뭉뚱그리기 쉬운 것을 임베딩·ANN 인덱싱·루프·MCP 중 정확히 어느 조각이 빠졌는지로 나눠 생각하는 데 도움이 된다.

이 네 조각은 각각 좁은 문제 하나씩을 푼다. 어느 하나를 건너뛰면 그 문제가 그대로 돌아온다. 임베딩과 벡터 검색을 건너뛰면 에이전트는 프롬프트에 들어가는 것만 다룰 수 있다. 다 읽지 못한 코드베이스에서 관련 함수 하나를 찾아낼 수 없다. 진짜 에이전트 루프를 건너뛰면 도구 호출 한 번이 추론을 대신한다. 재시도도, 나쁜 결과를 알아채고 조정할 방법도 없다. MCP를 건너뛰면 새 도구마다 모델 제공자마다 각자 통합 코드가 필요해지고, 이는 도구 몇 개를 넘는 순간 확장이 멈추는 M×N 문제다. 더 흥미로운 실패는 루프 안쪽에 있다. "목표가 검증될 때까지 반복한다"는 말은 조용히 검증자의 존재를 전제한다. 에이전트의 작업을 확인하는 것이 그 작업을 만든 바로 그 루프뿐이라면, 검증은 연극이다. 이것이 하니스·이밸류에이션의 절반(Tech #106, #102)이고, 그 끝에 있는 실패 형태가 스스로 자기 숙제를 채점하는 에이전트(Tech #125)다. MCP의 authorization boundary는 같은 걱정을 더 좁고 더 기계적으로 다룬 버전이다. 자격 증명을 프롬프트 밖에 두는 것은 필요하지만, 그 도구 호출 자체가 옳은 선택이었는지는 아무것도 말해 주지 않는다.

동작 방식

임베딩이 콘텐츠를 기하학으로 바꾼다

임베딩 모델은 텍스트, 코드, 이미지 한 조각을 벡터로 매핑한다. 보통 768차원(BERT-base)이거나 1536차원(OpenAI의 text-embedding-3-small, 구버전 ada-002)이다. 의미가 비슷한 두 조각은 이 공간에서 가까이 놓이고, "가깝다"는 코사인 유사도·내적·유클리드 거리 중 하나로 잰다. 같은 기하학적 개념을 재는 세 가지 다른 방식이고, 어느 것을 쓰는지는 임베딩 모델의 학습 목적에 달려 있다.

ANN 인덱싱이 대규모에서도 검색을 감당 가능하게 만든다

질의 벡터를 저장된 모든 벡터와 비교하는 것은 O(N) 브루트포스 스캔이고, 수십만 행을 넘어가면 버티지 못한다. 벡터 데이터베이스는 대신 근사 최근접 이웃 인덱스를 만든다. HNSW(Hierarchical Navigable Small World, Malkov와 Yashunin)는 다층 그래프를 만들어, 성긴 최상위 층에서 탐색을 시작해 더 촘촘한 하위 층으로 내려가며 몇 번의 홉만에 실제 최근접 이웃 근처에 도달한다. IVF(Inverted File index, Meta의 FAISS 라이브러리가 쓰는 기법)는 벡터 공간을 미리 클러스터로 나눠 놓고 질의와 가장 가까운 클러스터만 탐색한다. 둘 다 약간의, 조절 가능한 재현율을 대가로 컬렉션이 수백만 개로 커져도 서브밀리초 검색을 유지한다.

에이전트 루프: 관찰, 추론, 디스패치, 반복

LLM을 에이전트로 만드는 루프는 네 단계다. 관찰(사용자 입력과 현재 맥락을 받아들임), 추론(외부 데이터나 행동이 필요한지 판단), 디스패치(특정 도구와 그 인자를 지정하는 구조화된 JSON 페이로드를 내보냄), 실행과 피드백(런타임이 도구를 호출하고 결과를 맥락에 되돌려 넣으며, 목표가 달성될 때까지 반복). 검색은 이 루프 안에서 가능한 도구 호출 중 하나일 뿐이다. 루프 자체는 그 도구가 벡터 데이터베이스를 조회하는지, API를 호출하는지, 파일을 쓰는지 신경 쓰지 않는다.

MCP: 도구마다 짜는 연결 코드 대신 표준 하나

MCP 이전에는 모델을 외부 데이터, 즉 GitHub, Postgres, Drive, 로컬 파일과 연결하려면 도구마다, 모델 제공자마다 맞춤 통합 코드가 필요했다. M×N 문제다. MCP는 이를 client-host-server 아키텍처로 표준화한다. MCP 공식 문서 스스로가 IDE의 Language Server Protocol에 견주는 비유다. 호스트는 모든 것을 조율하는 애플리케이션(Claude Desktop, Gemini CLI)이고, 클라이언트는 연결을 쥐고 있는 프로토콜 핸들러이며, 서버는 도구·리소스·프롬프트를 표준 스키마로 노출하는 작고 격리된 프로세스다. MCP는 authorization boundary도 명시적으로 그어 놓아서, 자격 증명과 API 키는 모델이 보거나 유출할 수 있는 프롬프트 텍스트가 아니라 서버 설정에 산다.

Jayverse에서의 위치

  • Auditor: 스크립트가 아니라 MCP 서버. check_ruleget_evidence를 MCP 도구로 노출한다. 그 리소스는 규칙 집합을 쪼개서 검색하는 대신 통째로 맥락에 넣는 것이다. 이 트레이드오프는 rag-vs-long-context-hybrid-filter-then-attend 항목이 정면으로 다룬다.
  • alice: rail·인덱스를 MCP 리소스로. 매 세션 모든 히스토리 파일을 다시 읽는 대신, MCP를 통해 인덱스에 "이미 다뤘나?"를 질의하게 한다.
  • Verex: 데브넷 RPC와 CLI를 MCP 도구로. 여기서도 Tech #99의 교훈이 적용된다. 스크립트로 조작 가능하고 결과를 관찰할 수 있는 표면이 있어야 MCP 도구가 쓸모 있다. Blender MCP 호출이 스크린샷으로 자기 작업을 확인해야 하는 것과 같은 요구다.
  • Eng: 면접용 두 문장 답변. MCP는 모델이 도구와 데이터에 닿는 방식을 표준화한다. LSP가 에디터가 언어 백엔드에 닿는 방식을 표준화했던 것과 같다. 쌍마다 맞춤 연결 코드를 짜는 대신 client-host-server 계약 하나로.

확인된 것과 미확인

2026-09-21 확인: MCP는 2024년 11월 Anthropic이 공개했고 2025년에 걸쳐 OpenAI, Google 등 다른 제공자들이 채택했다. LSP 비유는 MCP 공식 문서 자신이 쓰는 것이다. HNSW는 Malkov와 Yashunin(2016년 프리프린트, 2018년 발표)이 낸 실제 ANN 알고리즘이다. IVF는 FAISS에 구현된 실제 기법이다. 768과 1536은 각각 BERT-base와 OpenAI text-embedding-3-small/ada-002의 문서화된 기본 임베딩 차원이다. 요약에서 가져왔고 독립 확인하지 않은 것: 정확한 벡터 검색을 순수 O(N) 브루트포스로 규정한 프레이밍(복잡도 관점에서는 맞지만, 실전 시스템은 ANN을 쓰기 전에 하드웨어와 배치 처리에도 기댄다), 그리고 이 네 조각이 최신 에이전트에 필요한 것의 완전한 목록이라는 주장. 이 요약에는 인용할 개별 타임스탬프가 주어지지 않았다.

출처: YouTube — ByteMonk, "Embeddings, Vector Databases, Agents & MCP: How Modern AI Systems Actually Work" (10:03) · 관련 항목: Tech #68(세 각도에서 본 MCP), Tech #99(Blender MCP를 통한 바이브 모델링), Tech #106(하니스 엔지니어링), Tech #102(이밸류에이션), Tech #125(스스로를 채점하는 에이전트), Tech #63(경계 파일), rag-vs-long-context-hybrid-filter-then-attend.

핵심 표현

이 페이지의 영어 본문에서 배울 만한 단어와 표현, 뜻과 나온 자리.

Expression뜻 · 쓰이는 자리
embedding임베딩(텍스트·코드·이미지를 벡터로 투영한 것) · 의미 검색의 기본 단위. "project text, code and images into 768–1536-dimension vectors"
vector database벡터 데이터베이스(임베딩을 저장하고 유사도로 검색하는 저장소) · 의미 검색 인프라의 핵심. "production vector databases use approximate nearest-neighbor (ANN) indexes"
cosine similarity코사인 유사도(두 벡터 사이 각도로 재는 유사도) · 임베딩 비교의 표준 지표 중 하나. "cosine similarity, dot product or Euclidean distance"
dot product내적(두 벡터 성분을 곱해 더한 값) · 코사인 유사도와 함께 쓰는 유사도 계산법. "cosine similarity, dot product or Euclidean distance"
Euclidean distance유클리드 거리(두 점 사이 직선 거리) · 벡터 공간에서의 근접성 측정법. "cosine similarity, dot product or Euclidean distance"
ANN (Approximate Nearest Neighbor)근사 최근접 이웃(정확도를 약간 포기하고 빠르게 찾는 탐색) · O(N) 전수 탐색의 대안. "approximate nearest-neighbor (ANN) indexes"
HNSWHierarchical Navigable Small World(계층형 항해 가능 소세계 그래프, ANN 인덱스 알고리즘) · 다층 그래프로 빠르게 근접 벡터를 찾는 방식. "HNSW graphs or IVF"
IVFInverted File index(역파일 인덱스, ANN 인덱스 알고리즘) · 벡터 공간을 클러스터로 나눠 탐색 범위를 줄이는 기법, FAISS의 핵심. "HNSW graphs or IVF"
FAISSFacebook AI Similarity Search(Meta가 만든 벡터 유사도 검색 라이브러리) · IVF 같은 기법이 구현된 원조 라이브러리. "the technique behind Meta's FAISS library"
O(N)빅오 표기법으로 입력 크기 N에 비례하는 계산량 · 전수 탐색(브루트포스)의 시간 복잡도. "an O(N) brute-force scan"
agent loop에이전트 루프(관찰-추론-디스패치-실행을 반복하는 구조) · LLM을 자율 에이전트로 만드는 핵심 구조. "observe, reason, dispatch a structured JSON tool call"
tool dispatch도구 디스패치(어떤 도구를 어떤 인자로 호출할지 내보내는 단계) · 에이전트 루프의 한 단계. "dispatch a structured JSON tool call"
JSON payloadJSON 페이로드(도구 호출에 실어 보내는 구조화된 데이터) · 도구 호출의 구체적 형태. "a structured JSON payload naming a specific tool"
MCPModel Context Protocol(모델 컨텍스트 프로토콜, Anthropic이 만든 에이전트-도구 연결 표준) · 이 항목의 핵심 주제. "Anthropic's Model Context Protocol (MCP)"
M×N problemM곱N 문제(도구 M개와 모델 N개마다 각자 연결 코드가 필요해지는 조합 폭발) · MCP가 풀려는 문제. "an M×N problem that stops scaling"
LSPLanguage Server Protocol(언어 서버 프로토콜, IDE와 언어 분석기를 표준으로 연결하는 프로토콜) · MCP가 스스로 드는 비유. "the Language Server Protocol in IDEs"
authorization boundary권한 경계(자격 증명과 접근 범위를 가르는 선) · 프롬프트 밖에 자격 증명을 두는 안전장치. "MCP's authorization boundary"
harness engineering하니스 엔지니어링(에이전트를 감싸는 실행·검증 장치를 설계하는 일) · 루프의 검증 문제와 직결된 개념. "the harness-and-eval half of the problem"
eval이밸류에이션(모델·에이전트 성능을 체계적으로 측정하는 평가) · 검증이 실제로 이루어지는지 확인하는 절차. "the harness-and-eval half of the problem"
galaxy-brain risk(비유) 지나치게 자기 확신에 빠진 추론의 위험 · 검증자가 없는 루프의 극단적 실패, 자기 채점 에이전트를 가리키는 표현. "an agent that grades its own homework"

← 전체 기술 노트 · 워크스페이스 인덱스 · 맨 위 ↑