도구를 다 쥐여줬더니 생긴 일
사내 위키 질의응답 에이전트를 처음 설계할 때는 단순하게 접근하기 쉽습니다. 에이전트 하나에 도구를 전부 쥐여주는 겁니다. 위키 검색, 문서 본문 조회, 최근 변경 이력 조회, 담당자 찾기.
그리고 지시문에 이렇게 씁니다. "반드시 위키를 먼저 검색한 뒤, 찾은 문서만 근거로 답하세요."
대부분은 잘 따릅니다. 문제는 "대부분"이라는 데 있습니다.
질문이 일반적인 기술 상식처럼 보이면, 모델은 가끔 검색을 건너뛰고 자기 지식으로 바로 답합니다. 우리 회사의 배포 규칙을 물었는데, 인터넷에 흔한 일반론이 돌아옵니다. 출처 링크가 없는 답변이 섞이기 시작합니다.
판단과 순서는 다른 문제였다
지시문을 더 강하게 쓰는 것으로 해결하려 하기 쉽습니다. 대문자로 "반드시"를 쓰고, 예시를 늘립니다. 빈도는 줄지만 0이 되지는 않습니다.
한참 지나서야 질문을 바꿔야 한다는 걸 깨닫게 됩니다. 이 에이전트에서 "검색 → 근거 확인 → 답변"이라는 순서는 판단의 대상이 아닙니다. 언제나 그 순서여야 합니다.
판단이 필요한 건 각 단계 안쪽입니다. 어떤 키워드로 검색할지, 찾은 문서가 질문과 관련 있는지, 어떻게 요약해서 답할지. 그런데 우리는 정해진 순서까지 확률적인 모델에게 맡기고 있었던 겁니다.
ADK가 그래프를 택한 이유
Next '26에서 Agent Development Kit(ADK)은 "그래프 기반 프레임워크"로 소개됐습니다. 에이전트를 하위 에이전트들의 네트워크로 구성한다는 설명이었습니다.
이후 공개된 ADK 2.0 문서를 보면 의도가 더 분명합니다. 기존의 계층형 실행기를 **그래프 실행 엔진(Workflow Runtime)**으로 바꿨습니다. 에이전트, 도구, 함수가 모두 그래프의 노드가 됩니다. 노드 사이의 흐름은 코드로 정합니다.
- 조건 분기(routing)
- 병렬 실행 후 합치기(fan-out / fan-in)
- 반복과 재시도
- 상태 관리
- 사람의 승인 대기(human-in-the-loop)
- 그래프 안에 그래프 넣기(nested workflow)
한 문장으로 줄이면 이렇습니다. 흐름은 엔진이 결정하고, 추론은 모델이 한다. 앞의 위키 에이전트가 겪은 문제에 대한 답이 그대로 들어 있습니다.
1.x에서도 흉내는 낼 수 있다
그래프 런타임이 아니어도, ADK 1.x의 SequentialAgent로 순서를 강제하는 건 지금도 가능합니다. 검색 담당과 답변 담당을 나누고, 앞 단계의 결과를 세션 상태로 넘깁니다.
from google.adk.agents import LlmAgent, SequentialAgent
MODEL = "gemini-3.1-pro" # 실제 모델 ID는 콘솔에서 확인
retriever = LlmAgent(
name="retriever",
model=MODEL,
instruction="질문에 맞는 위키 문서를 search_wiki로 찾아 문서 ID와 핵심 문단만 정리하세요.",
tools=[search_wiki],
output_key="evidence",
)
answerer = LlmAgent(
name="answerer",
model=MODEL,
instruction=(
"아래 근거만 사용해 답하세요. 근거가 비어 있으면 '위키에서 찾지 못했습니다'라고 답하세요.\n"
"근거: {evidence}"
),
)
wiki_qa = SequentialAgent(name="wiki_qa", sub_agents=[retriever, answerer])
답변 담당은 검색 도구를 아예 갖고 있지 않습니다. 건너뛸 방법 자체가 없습니다. 근거가 비면 모른다고 답하게 했더니, 출처 없는 답변이 구조적으로 사라졌습니다.
2.0의 그래프에서는 여기에 "근거가 비면 검색어를 바꿔 한 번 더"라는 재시도 분기를 노드로 붙일 수 있습니다. 2.0 API는 언어별로 정식 출시 시점이 달랐으니, 쓰는 언어의 릴리스 노트를 먼저 확인하길 권합니다.
프롬프트에서 코드로 넘어가는 다리, Agent Studio
같이 발표된 Agent Studio는 저코드 빌더입니다. 자연어로 에이전트를 만들고 시험해 볼 수 있습니다.
처음엔 개발자와 상관없는 도구라고 생각했습니다. 눈길을 끈 건 ADK 코드로 내보내기 기능이었습니다. 기획자나 도메인 담당자가 Studio에서 지시문과 도구 구성을 다듬고, 개발자는 그걸 코드로 받아 그래프 구조와 테스트를 붙입니다.
에이전트 품질의 상당 부분은 지시문에서 결정됩니다. 그 지시문을 가장 잘 쓰는 사람이 꼭 개발자일 필요는 없습니다.
배포 쪽에서 달라지는 것
런타임 쪽 발표도 같이 봐야 그림이 완성됩니다.
- Agent Runtime: 1초 미만의 콜드 스타트를 내세웠습니다. 질의응답처럼 사람이 기다리는 에이전트에서 체감이 큽니다.
- Agent Sessions: 세션 ID를 직접 지정할 수 있어서, 사내 DB나 CRM의 레코드와 1:1로 묶을 수 있습니다.
- Memory Bank: 대화에서 장기 기억을 만들고 정리합니다. 새로 나온 Memory Profiles로 사용자별 기억을 관리합니다.
- Agent Sandbox: 모델이 만든 코드를 격리된 환경에서 실행합니다. 정식 출시(GA) 상태로 발표됐습니다.
마이그레이션 전에 확인할 것
ADK 2.0으로 넘어갈 계획이라면 한 가지는 미리 알아 두는 게 좋습니다. 2.0에서 만든 세션은 오래된 1.x 버전과 호환되지 않습니다. 문서 기준으로 1.28 이상은 2.0 세션을 읽을 수 있지만, 추가 필드는 무시합니다.
운영 중인 에이전트가 여러 개라면 한꺼번에 올리기보다, 세션 저장소를 공유하지 않는 에이전트부터 하나씩 옮기는 편이 안전합니다.
에이전트 프레임워크가 그래프로 수렴하는 건 ADK만의 흐름은 아닙니다. 그래도 이번 개편으로 하나는 분명해졌습니다. 모델이 똑똑해질수록, 모델에게 맡기지 않을 일을 명시적으로 정하는 능력이 더 중요해진다는 것입니다.
When first designing an internal wiki Q&A agent, it's easy to take a simple approach: give one agent all the tools. Wiki search, document body retrieval, recent change history lookup, finding the right person.
And then write this in the instructions: "You must search the wiki first, and answer only based on the documents you find."
Most of the time it follows along. The problem is the word "most."
When a question looks like general technical knowledge, the model sometimes skips the search and answers directly from its own knowledge. You ask about our company's deployment rules, and you get back common generalizations found on the internet. Answers without source links start mixing in.
Judgment and Order Were Different Problems
It's tempting to try solving this by making the instructions stronger. Writing "MUST" in all caps, adding more examples. The frequency goes down, but it doesn't go to zero.
Only much later do you realize you need to change the question. In this agent, the sequence of "search → verify evidence → answer" is not a matter of judgment. It must always be that sequence.
What needs judgment is inside each step. Which keywords to search with, whether the found document is relevant to the question, how to summarize and answer. But we were leaving even the fixed sequence up to a probabilistic model.
Why ADK Chose a Graph
At Next '26, the Agent Development Kit (ADK) was introduced as a "graph-based framework." The explanation was that agents are composed as a network of sub-agents.
Looking at the subsequently released ADK 2.0 documentation, the intent becomes clearer. The existing hierarchical executor was replaced with a graph execution engine (Workflow Runtime). Agents, tools, and functions all become nodes in the graph. The flow between nodes is determined by code.
- Conditional branching (routing)
- Parallel execution then merging (fan-out / fan-in)
- Iteration and retry
- State management
- Waiting for human approval (human-in-the-loop)
- Putting a graph inside a graph (nested workflow)
In one sentence: the engine decides the flow, the model does the reasoning. The answer to the problem the wiki agent faced is right there.
You Can Mimic It in 1.x Too
Even without a graph runtime, it's still possible to enforce order with ADK 1.x's SequentialAgent. Split into a search agent and an answer agent, and pass the result of the first step via session state.
from google.adk.agents import LlmAgent, SequentialAgent
MODEL = "gemini-3.1-pro" # 실제 모델 ID는 콘솔에서 확인
retriever = LlmAgent(
name="retriever",
model=MODEL,
instruction="질문에 맞는 위키 문서를 search_wiki로 찾아 문서 ID와 핵심 문단만 정리하세요.",
tools=[search_wiki],
output_key="evidence",
)
answerer = LlmAgent(
name="answerer",
model=MODEL,
instruction=(
"아래 근거만 사용해 답하세요. 근거가 비어 있으면 '위키에서 찾지 못했습니다'라고 답하세요.\n"
"근거: {evidence}"
),
)
wiki_qa = SequentialAgent(name="wiki_qa", sub_agents=[retriever, answerer])
The answer agent doesn't have the search tool at all. There's simply no way to skip it. When we made it answer "I don't know" when evidence is empty, source-less answers disappeared structurally.
In the 2.0 graph, you can attach a retry branch as a node that says "if evidence is empty, change the search query and try once more." Since the 2.0 API had different official release timings per language, I recommend checking the release notes for your language first.
The Bridge from Prompts to Code: Agent Studio
Also announced was Agent Studio, a low-code builder. You can create and test agents in natural language.
At first I thought it was a tool unrelated to developers. What caught my eye was the export to ADK code feature. Planners or domain experts refine the instructions and tool configuration in Studio, and developers receive it as code to attach graph structure and tests.
A significant part of agent quality is determined by the instructions. The person who writes those instructions best doesn't have to be a developer.
What Changes on the Deployment Side
You also need to look at the runtime announcements to complete the picture.
- Agent Runtime: Promised sub-second cold starts. This is noticeable for agents where humans are waiting, like Q&A.
- Agent Sessions: You can specify the session ID directly, so you can tie it 1:1 with records in internal DBs or CRMs.
- Memory Bank: Creates and organizes long-term memory from conversations. The newly introduced Memory Profiles manage per-user memory.
- Agent Sandbox: Executes code created by the model in an isolated environment. Announced as generally available (GA).
Things to Check Before Migrating
If you're planning to move to ADK 2.0, there's one thing worth knowing in advance. Sessions created in 2.0 are not compatible with older 1.x versions. According to the documentation, 1.28 and above can read 2.0 sessions, but they ignore extra fields.
If you have multiple agents in operation, rather than upgrading all at once, it's safer to move them one by one, starting with agents that don't share the session store.
The convergence of agent frameworks toward graphs isn't a trend unique to ADK. Still, this redesign made one thing clear: as models get smarter, the ability to explicitly define what not to leave to the model becomes more important.