상담사 모드
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 문서에서는 Gemini Code Assist의 에이전트 모드를 설명합니다.
에이전트 모드는 VS Code 및 IntelliJ 통합 개발 환경 (IDE)에서 사용할 수 있습니다. 에이전트 모드를 사용하려면 에이전트형 채팅을 페어 프로그래머로 사용하기를 참고하세요.
VS Code의 에이전트 모드는 Gemini CLI를 기반으로 합니다.
IntelliJ의 에이전트 모드는 Gemini CLI를 사용하지 않습니다.
에이전트 모드를 사용하면 다음 작업을 비롯한 다양한 작업을 할 수 있습니다.
- 코드에 대해 질문합니다.
- 컨텍스트와 기본 제공 도구를 사용하여 생성된 콘텐츠를 개선합니다.
- MCP 서버를 구성하여 에이전트의 기능을 확장합니다.
- 복잡한 다단계 작업에 대한 솔루션을 얻습니다.
- 설계 문서, 문제,
TODO
주석으로 코드를 생성합니다.
- 실행 중에 계획과 도구 사용에 대한 댓글을 달고, 수정하고, 승인하여 에이전트 동작을 제어합니다.
에이전트 모드 작동 방식
에이전트 모드에서는 사용 가능한 도구 목록과 함께 프롬프트가 Gemini API로 전송됩니다. Gemini API는 프롬프트를 처리하고 대답을 반환합니다. 대답은 직접적인 답변이거나 사용 가능한 도구를 사용하라는 요청일 수 있습니다.
도구가 요청되면 에이전트는 해당 도구를 사용할 준비를 하고 명시적 권한이 있거나 없는 상태에서 해당 도구를 사용할 수 있는지 확인합니다.
- 파일 시스템을 수정하거나 리소스에 대한 변형 작업을 실행하는 도구 요청의 경우 Gemini는 해당 도구를 항상 허용하도록 구성된 경우를 제외하고 해당 작업을 허용하도록 요청합니다.
- 읽기 전용 도구 요청은 작업을 완료하기 전에 권한을 요청하지 않을 수 있습니다.
도구 사용을 허용하라는 메시지가 표시되는 경우 해당 작업을 허용하거나 거부할 수 있습니다. 에이전트는 도구나 서버를 항상 허용하거나 유사한 작업을 허용하는 옵션을 제공할 수도 있습니다. 자세한 내용은 항상 에이전트 작업 허용을 참고하세요.
도구 사용 권한이 부여되거나 자체 부여되면 에이전트는 해당 도구를 사용하여 필요한 작업을 완료하며 작업 결과는 Gemini API로 전송됩니다. Gemini는 도구 작업의 결과를 처리하고 다른 대답을 생성합니다. 이러한 작업과 평가 주기는 작업이 완료될 때까지 계속됩니다.
복잡한 작업의 경우 Gemini가 승인을 위해 개략적인 계획을 표시할 수 있습니다. 프로세스를 시작하기 전에 계획을 세부적으로 조정하고 채팅에서 질문할 수 있습니다. 계획에 만족하면 승인하면 됩니다. 계획을 승인하면 에이전트가 첫 번째 작업을 시작하고 계획을 실행하면서 필요에 따라 설명이나 권한을 요청합니다.
에이전트 모드 컨텍스트
컨텍스트를 사용하면 에이전트가 지정된 프롬프트에 대해 더 나은 대답을 생성할 수 있습니다. 컨텍스트는 IDE의 파일, 로컬 시스템 폴더의 파일, 도구 대답, 프롬프트 세부정보에서 가져올 수 있습니다.
IDE 및 설정에 따라 에이전트가 사용할 수 있는 컨텍스트가 다를 수 있습니다.
다음 탭에서는 다양한 IDE에 대해 컨텍스트가 수집되는 방식을 자세히 설명합니다.
VS Code
에이전트 모드에서 Gemini Code Assist가 컨텍스트를 가져올 수 있는 방법은 다음과 같습니다.
- IDE 작업공간의 정보
- 기본 제공 도구의 도구 응답(예: grep, 터미널, 파일 읽기 또는 파일 쓰기)
- Google 검색 응답
- 프롬프트 또는 도구에서 제공된 특정 URL의 콘텐츠
- 마크다운으로 만든 컨텍스트 파일
상담사 메모리
VS Code의 Gemini Code Assist 에이전트 모드는 Gemini CLI 메모리 검색 서비스를 활용하여 에이전트에 컨텍스트를 제공하는 GEMINI.md
파일을 찾아 로드합니다. 메모리 검색 서비스는 현재 작업 디렉터리에서 시작하여 프로젝트 루트 및 홈 디렉터리로 이동하면서 이러한 파일을 계층적으로 검색합니다. 하위 디렉터리도 검색합니다.
전역, 프로젝트 수준, 구성요소 수준 컨텍스트 파일을 만들 수 있으며, 이러한 파일은 모두 결합되어 모델에 가장 관련성 높은 정보를 제공합니다.
/memory show
명령어를 사용하여 로드된 모든 GEMINI.md
파일의 결합된 콘텐츠를 확인하고 /memory refresh
명령어를 사용하여 이를 다시 로드할 수 있습니다.
IntelliJ
에이전트 모드에서 Gemini Code Assist가 컨텍스트를 가져올 수 있는 방법은 다음과 같습니다.
- 파일, 색인이 생성된 심볼, 프로젝트의 심볼 사용 등 IDE 프로젝트의 정보
- 기본 제공 도구의 도구 응답(예: grep, 파일 읽기 또는 파일 쓰기)
- IntelliJ 버전 관리
- 구성된 MCP 서버 및 도구
- 마크다운으로 만든 컨텍스트 파일
상담사가 사용할 수 있는 컨텍스트는 상담사 모드 채팅 프롬프트 영역의 컨텍스트 드로어에서 확인할 수 있습니다.
도구는 에이전트가 프롬프트에 대답할 때 컨텍스트와 작업을 위해 사용할 수 있는 서비스의 광범위한 카테고리입니다. 도구를 사용하면 에이전트가 API 엔드포인트 또는 다른 에이전트에 대한 함수 호출을 통해 최신 정보에 액세스할 수 있습니다. 도구는 하나의 기능만 제공할 수도 있고, 여러 관련 기능을 제공할 수도 있습니다.
예를 들어 grep와 파일 읽기/쓰기와 같은 기본 제공 도구, 로컬 또는 원격 Model Context Protocol (MCP) 서버 및 실행 가능한 함수, RESTful API 호출 등이 있습니다.
에이전트 모드에서 Gemini는 내장 시스템 도구에 액세스할 수 있습니다. IDE를 선택하여 에이전트 모드의 Gemini에서 사용할 수 있는 내장 도구 목록을 확인하세요.
IntelliJ
read_file
- 절대 경로를 사용하여 파일의 텍스트 콘텐츠를 가져옵니다.
write_file
- 지정된 파일에 주어진 텍스트를 씁니다. 파일이 없으면 파일을 만듭니다.
analyze_current_file
- 편집기에서 열린 파일의 오류와 경고를 분석합니다.
find_files
- 파일 이름 또는 경로의 일부가 지정된 파일의 절대 경로를 찾습니다.
grep
- 주어진 텍스트 패턴이나 정규 표현식을 포함하는 프로젝트 내의 모든 파일을 찾습니다.
list_files
- 지정된 절대 경로에 있는 모든 파일과 디렉터리를 나열합니다.
resolve_symbol
- 특정 심볼 참조를 원래 선언으로 확인합니다.
find_usages
- 지정된 심볼 선언에 대한 모든 참조를 프로젝트에서 검색합니다.
git
- Git 명령줄 인터페이스 (CLI) 명령어를 실행하고 결과를 반환합니다.
list_vcs_roots
- 현재 프로젝트의 모든 버전 관리 시스템(VCS) 루트(예: Git 저장소)를 반환합니다.
제한사항
표준 Gemini Code Assist 채팅의 일부 기능은 에이전트 모드에서 사용할 수 없거나 표준 채팅에서와 다르게 작동할 수 있습니다.
에이전트 모드에서는 낭독을 사용할 수 없습니다. 에이전트 모드에서는 Gemini가 소스를 인용하지 않으며 인용된 소스와 일치하는 코드 추천을 사용 중지할 수 없습니다.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-31(UTC)"],[],[],null,["# Agent mode\n\n| **Preview**\n|\n| \u003cbr /\u003e\n|\n| This product or feature is in preview. Products and features that are\n| in preview are available \"as is\".\n|\n| \u003cbr /\u003e\n|\n\u003cbr /\u003e\n\nThis document describes agent mode in Gemini Code Assist.\n\nAgent mode is available in the VS Code and IntelliJ integrated development\nenvironments (IDEs). To start using agent mode, see\n[Use agentic chat as a pair programmer](/gemini-code-assist/docs/use-agentic-chat-pair-programmer).\n\nAgent mode in VS Code is powered by [Gemini CLI](/gemini-code-assist/docs/gemini-cli).\n\nAgent mode in IntelliJ doesn't use the Gemini CLI.\n\nWith agent mode, you can do any of the following and more:\n\n- Ask questions about your code.\n- Use context and built-in tools to improve generated content.\n- Configure MCP servers to extend the agent's abilities.\n- Get solutions to complex tasks with multiple steps.\n- Generate code from design documents, issues, and `TODO` comments.\n- Control the agent behavior by commenting on, editing, and approving plans and tool use during execution.\n\nHow agent mode works\n--------------------\n\nIn agent mode, your prompt is sent to the Gemini API with a list of\n[tools](#tools) that are available. The Gemini\nAPI processes the prompt and returns a response. The response might be a direct\nanswer or a request to use an available tool.\n\nWhen a tool is requested, the agent prepares to use the tool and checks to see\nif it is allowed to use the tool with or without explicit permission:\n\n- For tool requests that modify the file system, or perform mutating operations on any resources, Gemini will ask you to allow the operation unless you have configured Gemini to always allow the tool or tools.\n- Tool requests that are read-only might not ask for permission before completing the task.\n\nWhen asked to allow the use of a tool, you can choose to allow or deny the\noperation. The agent might also give you options to always allow a tool or\nserver or allow similar operations. For more information, see\n[Always allow agent actions](/gemini-code-assist/docs/use-agentic-chat-pair-programmer#yolo-mode).\n\nOnce permission to use the tool is given or self-granted, the agent uses the\ntool to complete the required action, and the result of that action is sent\nback to the Gemini API. Gemini processes the result of the\ntool action and generates another response. This cycle of action and\nevaluation continues until the task is complete.\n\nFor complex tasks, Gemini might show a high-level plan for your\napproval. You can fine tune the plan and ask questions in chat before beginning\nthe process. Once you are happy with the plan, you can approve it. After you\napprove the plan, the agent starts working on the first task, and will ask you\nfor clarifications or permissions as needed as it executes the plan.\n\nAgent mode context\n------------------\n\nContext allows an agent to generate better responses for a given prompt. Context\ncan be taken from files in your IDE, files in your local system folders, tool\nresponses, and your prompt details.\n\nDepending on your IDE and settings, different contexts might be available to the\nagent.\n\nThe following tabs detail how context is gathered for different IDEs. \n\n### VS Code\n\nThe following methods of getting context are usually available to\nGemini Code Assist in agent mode:\n\n- Information in your IDE workspace.\n- Tool responses from built-in tools like grep, terminal, file read, or file write.\n- Google Search responses.\n- Content from a given URL provided in a prompt or by a tool.\n- Context files you create in Markdown.\n\n### Agent memory\n\nGemini Code Assist agent mode in VS Code leverages the\nGemini CLI memory discovery service to find and load `GEMINI.md`\nfiles that provide context for the agent. The memory discovery service\nsearches for these files hierarchically, starting from the current working\ndirectory and moving up to the project root and your home directory. It also\nsearches in subdirectories.\n\nYou can create context files that are global,\nproject-level, and component-level, which are all combined to provide the\nmodel with the most relevant information.\n\nYou can use the `/memory show` command to see the combined content of all\nloaded `GEMINI.md` files, and the `/memory refresh` command to reload them.\n\n### IntelliJ\n\nThe following methods of getting context are usually available to\nGemini Code Assist in agent mode:\n\n- Information in your IDE project including your files, indexed symbols and usage of symbols in your project.\n- Tool responses from built-in tools like grep, file read, or file write.\n- IntelliJ [version control](https://www.jetbrains.com/help/idea/version-control-integration.html).\n- Configured MCP servers and tools\n- Context files you create in Markdown.\n\nYou can see the context available to the agent in the context drawer in the\nagent mode chat prompt area. \n\nTools\n-----\n\n*Tools* are a broad category of services that an agent can use for context and\nactions in its response to your prompt. Tools allow agents to access up-to-date\ninformation through function calling to API endpoints or to other agents. Tools\nmight only offer one function, or they might offer multiple related functions.\n\nSome example tools are built-in tools like grep and file read or write, local or\nremote Model Context Protocol (MCP) servers and their executable functions, and\nRESTful API calls.\n\n### Built-in tools\n\nIn agent mode, Gemini has access to your built-in system tools. Select\nyour IDE to view a list of built-in tools available to Gemini in\nagent mode. \n\n### VS Code\n\nAll of the\n[Gemini CLI built-in tools](https://github.com/google-gemini/gemini-cli/blob/main/docs/core/tools-api.md#built-in-tools) are\navailable to agent mode in Gemini Code Assist.\n\n### IntelliJ\n\n`read_file`\n: Retrieves the text content of a file using its absolute path.\n\n`write_file`\n: Writes the given text to a specified file, creating the file if it doesn't exist.\n\n`analyze_current_file`\n: Analyzes the open file in the editor for errors and warnings.\n\n`find_files`\n: Finds the absolute path to files given a filename or a part of the path\n\n`grep`\n: Finds all files inside the project that contain a given text pattern or regular expression.\n\n`list_files`\n: Lists all files and directories in a given absolute path.\n\n`resolve_symbol`\n: Resolves a specific symbol reference to its original declaration.\n\n`find_usages`\n: Searches the project for all references to a given symbol declaration.\n\n`git`\n: Runs a Git command-line interface (CLI) command and returns the result.\n\n`list_vcs_roots`\n: Returns all Version Control System (VCS) roots, such as Git repositories, in the current project.\n\nLimitations\n-----------\n\nSome features of [standard Gemini Code Assist chat](/gemini-code-assist/docs/chat-overview)\nmight not be available in agent mode or might work differently than they do in\nstandard chat.\n\nRecitation is not available in agent mode. While in agent mode, Gemini\ndoesn't [cite sources](/gemini-code-assist/docs/works#how-when-gemini-cites-sources) and you can't\n[disable code suggestions that match cited sources](/gemini-code-assist/docs/write-code-gemini#disable_code_suggestions_that_match_cited_sources).\n\nWhat's next\n-----------\n\n- [Use agentic chat as a pair programmer](/gemini-code-assist/docs/use-agentic-chat-pair-programmer).\n- Read the [Gemini CLI documentation](https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md)."]]