ReAct: 도구를 활용한 추론과 실행
모델이 추론 단계와 도구 작업을 번갈아 수행해 기억만으로 답할 수 없는 작업을 해결하는 ReAct 패턴을 배웁니다.
ReAct: 도구를 활용한 추론과 실행은(는) CoddyKit의 무료 Prompt Engineering & LLM Optimization for Developers 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Prompt Engineering & LLM Optimization for Developers 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Prompt Engineering & LLM Optimization for Developers 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
When Thinking Is Not Enough
Chain-of-thought helps a model reason, but reasoning alone cannot fetch live data or run code. The ReAct pattern combines Reasoning with Acting so the model can use tools mid-task.
The ReAct Loop
ReAct alternates three roles in a loop:
- Thought: reason about what to do next.
- Action: call a tool with an input.
- Observation: read the tool's result.
Repeat until the answer is ready.
A ReAct Trace
A typical trace looks like this. The model emits a thought, an action, then waits for an observation injected back into the prompt.
Thought: I need today's weather in Paris.
Action: get_weather("Paris")
Observation: 18C, light rain
Thought: I can now answer.
Answer: It is 18C with light rain in Paris.Defining the Tools
You describe the available tools in the prompt: their names, what they do, and the input format. The model picks among them.
Tools:
- search(query): web search
- calc(expr): evaluate math
- get_weather(city): current weatherStopping at the Action
In practice your code stops generation when it sees an Action, executes the real tool, then appends the Observation and resumes the model. The model never invents tool results itself.
Why It Reduces Hallucination
Because the model grounds each step in real observations, ReAct cuts hallucination on factual or computational tasks. The reasoning explains why each tool was called, aiding debugging.
Multi-Step Problems
ReAct shines on tasks needing several lookups: find a company, then its founder, then that person's birth year. Each step's observation feeds the next thought.
Limiting the Loop
Always cap the number of iterations. Without a limit, a confused model can loop forever calling tools. Add a max-step budget and a fallback answer.
for step in range(MAX_STEPS):
out = model(prompt)
if is_answer(out): break
obs = run_tool(parse_action(out))
prompt += observation(obs)Handling Tool Errors
Tools fail: timeouts, bad inputs, empty results. Feed the error back as an observation so the model can retry differently rather than crashing the loop.
Observation: ERROR: city not found.
Thought: I should try the full country name.ReAct vs Plain Chain-of-Thought
- CoT: reasons internally, no external data.
- ReAct: reasons AND acts on the world via tools.
Use ReAct whenever the answer depends on information the model cannot already know.
Foundation for Agents
ReAct is the backbone of modern LLM agents. Frameworks like LangChain implement this thought-action-observation loop under the hood to build autonomous tool-using assistants.
Quick Check
Test your understanding of ReAct.
Recap
ReAct interleaves Thought, Action, and Observation so the model reasons and uses real tools. It grounds answers, reduces hallucination, needs a step limit and error handling, and underpins modern LLM agents.
AI 튜터와 함께 Prompt Engineering & LLM Optimization for Developers을(를) 배우세요 — 무료
브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.
- 코스
- 12
- 레슨
- 48
자주 묻는 질문
“ReAct: 도구를 활용한 추론과 실행” 강의는 무료인가요?
네 — “ReAct: 도구를 활용한 추론과 실행” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Prompt Engineering & LLM Optimization for Developers 강의 전체를 잠금 해제할 수 있습니다. Prompt Engineering & LLM Optimization for Developers 강의에는 총 4개의 강의가 포함되어 있습니다.
“ReAct: 도구를 활용한 추론과 실행”에서 뭘 배우나요?
모델이 추론 단계와 도구 작업을 번갈아 수행해 기억만으로 답할 수 없는 작업을 해결하는 ReAct 패턴을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 Prompt Engineering & LLM Optimization for Developers을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Prompt Engineering & LLM Optimization for Developers을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Prompt Engineering & LLM Optimization for Developers은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.
“ReAct: 도구를 활용한 추론과 실행” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Prompt Engineering & LLM Optimization for Developers 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Prompt Engineering & LLM Optimization for Developers 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 사고 과정 프롬프트
- 자기 일관성과 생성 지식
- 사고 트리 및 그래프 프롬프트
- ReAct: 도구를 활용한 추론과 실행