# ReAct: rozumowanie przeplatane z działaniem

EN: **ReAct (interleaved reasoning and acting)** · id `reactagents` · aliases: ReAct, Reason+Act, reasoning and acting

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Aplikacje LLM i agenci](https://aiatlasgraph.com/t/applications.md) › [Agenci i orkiestracja](https://aiatlasgraph.com/t/agentsnode.md) › [Pętle działania agenta (myśl–działaj–obserwuj)](https://aiatlasgraph.com/t/agentloops.md) › ReAct: rozumowanie przeplatane z działaniem

## Description

- PL: Wzorzec promptowania, w którym model generuje naprzemiennie ślady rozumowania i akcje, a obserwacje z narzędzi wracają do kontekstu.
- EN: A prompting pattern in which the model alternates reasoning traces and actions, with tool observations fed back into context.

## In one sentence

- PL: Agent zapisuje krótką myśl, wykonuje jedno działanie, czyta wynik i dopiero na tej podstawie pisze kolejną myśl.
- EN: The agent writes a short thought, takes one action, reads the result, and only then writes its next thought.

## Problem it solves

- PL: Model rozumujący tylko „w głowie” zmyśla fakty, a model działający bez namysłu wykonuje przypadkowe kroki.
- EN: A model that only reasons in its head makes up facts, while one that acts without thinking takes random steps.

## What it does

- PL: Przypomina detektywa, który po każdym przesłuchaniu notuje wnioski i z nich wybiera, kogo przesłuchać następnie.
- EN: It resembles a detective who notes conclusions after each interview and uses them to pick the next witness.

## Everyday example

- PL: Pytasz asystenta, kto był starszy z dwóch pisarzy; sprawdza datę urodzenia pierwszego, potem drugiego i porównuje.
- EN: You ask an assistant which of two writers was older; it looks up the first one's birth date, then the second's, and compares.

## This concerns you if you…

- PL: chcesz, żeby asystent sprawdzał fakty zamiast zgadywać
- PL: piszesz pierwszego prostego agenta z narzędziami
- EN: want an assistant to check facts instead of guessing
- EN: are writing your first simple agent with tools

## Keywords

ReAct prompting · Thought Action Observation · HotpotQA · ALFWorld · WebShop · few-shot trajectories · tool-augmented LLM

## How it works

- PL: Prompt z kilkoma przykładami trajektorii Thought–Action–Observation uczy model formatu. Model generuje myśl i akcję, aplikacja wykonuje akcję (np. zapytanie do API wiedzy) i dopisuje obserwację; pętla trwa do akcji kończącej. Myśli pozwalają śledzić i aktualizować plan oraz obsługiwać wyjątki.
- EN: A prompt with a few Thought–Action–Observation trajectories teaches the format. The model generates a thought and an action, the application executes the action (e.g. a knowledge-API query) and appends the observation; the loop runs until a finishing action. Thoughts let the model track and update its plan and handle exceptions.

## Limits

- PL: Każda obserwacja wymaga nowego wywołania z całą historią, więc zużycie tokenów szybko rośnie z liczbą kroków. Błędne lub puste wyniki narzędzi łatwo wykolejają rozumowanie, a długie trajektorie wypierają ważny kontekst.
- EN: Each observation requires a new call with the full history, so token use grows quickly with step count. Wrong or empty tool results easily derail reasoning, and long trajectories crowd out important context.

## Key terms

- PL: **trajektoria**: Cały zapis myśli, akcji i obserwacji jednego przebiegu agenta.
- PL: **ślad rozumowania**: Tekstowa myśl modelu poprzedzająca wybór akcji.
- PL: **akcja kończąca**: Specjalne działanie, którym agent oddaje odpowiedź końcową.
- EN: **trajectory**: The full record of thoughts, actions and observations in one agent run.
- EN: **reasoning trace**: The model's written thought before it chooses an action.
- EN: **finish action**: A special action the agent uses to return its final answer.

## Know first

- [Łańcuch myśli (chain-of-thought) (Chain-of-thought prompting)](https://aiatlasgraph.com/t/cot.md)
- [Przykłady w poleceniu (few-shot) (Few-shot prompting and in-context learning)](https://aiatlasgraph.com/t/fewshotprompting.md)

## Sources

- [ReAct: Synergizing Reasoning and Acting in Language Models](<https://arxiv.org/abs/2210.03629>) `yao-react-2022` · by Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, Yuan Cao

---

AI Atlas revision 124 (2026-10-31) · HTML: https://aiatlasgraph.com/t/reactagents · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-31
