You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/concepts/agents/prompts.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ For programmatic control, you can call tools directly:
40
40
result = agent.tool.current_time(timezone="US/Pacific")
41
41
```
42
42
43
-
This bypasses the natural language interface and directly executes the tool with the specified parameters. By default, direct tool calls are added to the [session state](sessions-state.md) but can be optionally not included by specifying `record_direct_tool_call=False`.
43
+
This bypasses the natural language interface and directly executes the tool with the specified parameters. By default, direct tool calls are added to the [session state](state-sessions.md) but can be optionally not included by specifying `record_direct_tool_call=False`.
In this example we can see that the first `agent.tool.calculator()` call is recorded in the agent's conversation history.
74
+
75
+
The second `agent.tool.calculator()` call is **not** recorded in the history because we specified the `record_direct_tool_call=False` argument.
76
+
77
+
#### Conversation Manager
55
78
56
79
Strands uses a conversation manager to handle conversation history effectively. The default is the [`SlidingWindowConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.sliding_window_conversation_manager.SlidingWindowConversationManager), which keeps recent messages and removes older ones when needed:
57
80
@@ -76,52 +99,101 @@ The sliding window conversation manager:
76
99
- Handles context window overflow exceptions by reducing context
77
100
- Ensures conversations don't exceed model context limits
78
101
79
-
## Tool State
102
+
See [`Context Management`](context-management.md) for more information about conversation managers.
80
103
81
-
When an agent uses tools, the tool executions and results become part of the conversation state:
104
+
105
+
### Agent State
106
+
107
+
Agent state provides key-value storage for stateful information that exists outside of the conversation context. Unlike conversation history, agent state is not passed to the model during inference but can be accessed and modified by tools and application logic.
Each agent interaction maintains a request state dictionary that persists throughout the event loop cycles and is **not** included in the agent's context:
127
199
@@ -149,12 +221,12 @@ The request state:
149
221
150
222
- Is initialized at the beginning of each agent call
151
223
- Persists through recursive event loop cycles
152
-
- Can be modified by tools and handlers
224
+
- Can be modified by callback handlers
153
225
- Is returned in the AgentResult object
154
226
155
227
## Session Management
156
228
157
-
For applications requiring persistent sessions across separate interactions, Strands provides several approaches:
229
+
A session represents all of the stateful information that is needed by an agent to function. For applications requiring persistent sessions across separate interactions, Strands provides several approaches:
158
230
159
231
### 1. Object Persistence
160
232
@@ -256,23 +328,3 @@ def chat():
256
328
return {"response": result.message}
257
329
```
258
330
259
-
## Custom Conversation Management
260
-
261
-
For specialized requirements, you can implement your own conversation manager:
262
-
263
-
```python
264
-
from strands.agent.conversation_manager import ConversationManager
Agents have context about tool calls and their results as part of conversation history. See [sessions & state](../agents/sessions-state.md#tool-state) for more information.
59
+
Agents have context about tool calls and their results as part of conversation history. See [state & sessions](../agents/state-sessions.md#using-state-in-tools) for more information.
Copy file name to clipboardExpand all lines: docs/user-guide/quickstart.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,7 +327,7 @@ Ready to learn more? Check out these resources:
327
327
-[Example Built-in Tools](concepts/tools/example-tools-package.md) - The `strands-agents-tools` package provides many powerful example tools for your agents to use during development
328
328
-[Strands Agent Builder]({{ agent_builder_repo_home }}) - Use the accompanying `strands-agents-builder` agent builder to harness the power of LLMs to generate your own tools and agents
329
329
-[Agent Loop](concepts/agents/agent-loop.md) - Learn how Strands agents work under the hood
330
-
-[Sessions & State](concepts/agents/sessions-state.md) - Understand how agents maintain context and state across a conversation or workflow
330
+
-[State & Sessions](concepts/agents/state-sessions.md) - Understand how agents maintain context and state across a conversation or workflow
331
331
-[Multi-agent](concepts/multi-agent/agents-as-tools.md) - Orchestrate multiple agents together as one system, with each agent completing specialized tasks
332
332
-[Observability & Evaluation](observability-evaluation/observability.md) - Understand how agents make decisions and improve them with data
333
333
-[Operating Agents in Production](deploy/operating-agents-in-production.md) - Taking agents from development to production, operating them responsibly at scale
0 commit comments