diff --git a/docs/examples/python/memory_agent.md b/docs/examples/python/memory_agent.md index 20a6ac4..e3035aa 100644 --- a/docs/examples/python/memory_agent.md +++ b/docs/examples/python/memory_agent.md @@ -32,34 +32,20 @@ The memory agent utilizes two primary tools: This example demonstrates a workflow where memories are used to generate contextually relevant responses: -``` -┌─────────────────┐ ┌─────────────────────────┐ ┌─────────────────────────┐ -│ │ │ │ │ │ -│ User Query │────▶│ Command Classification │────▶│ Conditional Execution │ -│ │ │ (store/retrieve/list) │ │ Based on Command Type │ -│ │ │ │ │ │ -└─────────────────┘ └─────────────────────────┘ └───────────┬─────────────┘ - │ - │ - ▼ - ┌───────────────────────────────────────────────────────┐ - │ │ - │ Store Action List Action Retrieve Action │ - │ ┌───────────┐ ┌───────────┐ ┌───────────────┐ │ - │ │ │ │ │ │ │ │ - │ │ mem0() │ │ mem0() │ │ mem0() │ │ - │ │ (store) │ │ (list) │ │ (retrieve) │ │ - │ │ │ │ │ │ │ │ - │ └───────────┘ └───────────┘ └───────┬───────┘ │ - │ │ │ - │ ▼ │ - │ ┌───────────┐ │ - │ │ │ │ - │ │ use_llm() │ │ - │ │ │ │ - │ └───────────┘ │ - │ │ - └──────────────────────────────────────────────────────┘ +```mermaid +flowchart TD + UserQuery["User Query"] --> CommandClassification["Command Classification
(store/retrieve/list)"] + CommandClassification --> ConditionalExecution["Conditional Execution
Based on Command Type"] + + ConditionalExecution --> ActionContainer["Memory Operations"] + + subgraph ActionContainer[Memory Operations] + StoreAction["Store Action

mem0()
(store)"] + ListAction["List Action

mem0()
(list)"] + RetrieveAction["Retrieve Action

mem0()
(retrieve)"] + end + + RetrieveAction --> UseLLM["use_llm()"] ``` ### Key Workflow Components @@ -126,15 +112,12 @@ This example demonstrates a workflow where memories are used to generate context The retrieval path demonstrates tool chaining, where memory retrieval and LLM response generation work together: - ``` - ┌───────────────┐ ┌───────────────────────┐ ┌───────────────┐ - │ │ │ │ │ │ - │ User Query │────▶│ memory() Retrieval │────▶│ use_llm() │────▶ Response - │ │ │ │ │ │ - └───────────────┘ └───────────────────────┘ └───────────────┘ - (Finds relevant memories) (Generates natural - language answer) - ``` +```mermaid +flowchart LR + UserQuery["User Query"] --> MemoryRetrieval["memory() Retrieval
(Finds relevant memories)"] + MemoryRetrieval --> UseLLM["use_llm()
(Generates natural
language answer)"] + UseLLM --> Response["Response"] +``` This chaining allows the agent to: 1. First retrieve memories that are semantically relevant to the user's query diff --git a/docs/examples/python/meta_tooling.md b/docs/examples/python/meta_tooling.md index f0442f0..99679e7 100644 --- a/docs/examples/python/meta_tooling.md +++ b/docs/examples/python/meta_tooling.md @@ -36,7 +36,8 @@ agent = Agent( system_prompt=TOOL_BUILDER_SYSTEM_PROMPT, tools=[load_tool, shell, editor] ) ``` - - `editor`: Tool used to write code directly to a file named `"custom_tool_X.py"`, where "X" is the index of the tool being created. + + - `editor`: Tool used to write code directly to a file named `"custom_tool_X.py"`, where "X" is the index of the tool being created. - `load_tool`: Tool used to load the tool so the Agent can use it. - `shell`: Tool used to execute the tool. diff --git a/docs/examples/python/multi_agent_example/multi_agent_example.md b/docs/examples/python/multi_agent_example/multi_agent_example.md index ac0f63a..90bfac6 100644 --- a/docs/examples/python/multi_agent_example/multi_agent_example.md +++ b/docs/examples/python/multi_agent_example/multi_agent_example.md @@ -109,7 +109,8 @@ def math_assistant(query: str) -> str: except Exception as e: return f"Error processing your mathematical query: {str(e)}" ``` -**Each specialized agent has a distinct system prompt, and tools in its inventory, and follows this general pattern. +Each specialized agent has a distinct system prompt, and tools in its inventory, and follows this general pattern. + - [Language Assistant](https://github.com/strands-agents/docs/blob/main/docs/examples/python/multi_agent_example/language_assistant.py) specializes in queries related to translation into different languages. - [Computer Scince Assistant](https://github.com/strands-agents/docs/blob/main/docs/examples/python/multi_agent_example/computer_science_assistant.py) specializes in queries related to writing, editing, running, code and explaining computer science concepts. - [English Assistant](https://github.com/strands-agents/docs/blob/main/docs/examples/python/multi_agent_example/english_assistant.py) specializes in queries related to grammar, and english comprehension. diff --git a/docs/user-guide/concepts/tools/example-tools-package.md b/docs/user-guide/concepts/tools/example-tools-package.md index 49db7a7..ac94aef 100644 --- a/docs/user-guide/concepts/tools/example-tools-package.md +++ b/docs/user-guide/concepts/tools/example-tools-package.md @@ -59,4 +59,33 @@ pip install strands-agents-tools[mem0_memory] - [`stop`]({{ tools_repo }}/src/strands_tools/stop.py): Force stop the agent event loop - [`think`]({{ tools_repo }}/src/strands_tools/think.py): Perform deep thinking by creating parallel branches of agentic reasoning - [`use_llm`]({{ tools_repo }}/src/strands_tools/use_llm.py): Run a new AI event loop with custom prompts -- [`workflow`]({{ tools_repo }}/src/strands_tools/workflow.py): Orchestrate sequenced workflows \ No newline at end of file +- [`workflow`]({{ tools_repo }}/src/strands_tools/workflow.py): Orchestrate sequenced workflows + + +## Tool Consent and Bypassing + +By default, certain tools that perform potentially sensitive operations (like file modifications, shell commands, or code execution) will prompt for user confirmation before executing. This safety feature ensures users maintain control over actions that could modify their system. + +To bypass these confirmation prompts, you can set the `BYPASS_TOOL_CONSENT` environment variable: + +```bash +# Set this environment variable to bypass tool confirmation prompts +export BYPASS_TOOL_CONSENT=true +``` + +Setting the environment variable within Python: + +```python +import os + +os.environ["BYPASS_TOOL_CONSENT"] = "true" +``` + +When this variable is set to `true`, tools will execute without asking for confirmation. This is particularly useful for: + +- Automated workflows where user interaction isn't possible +- Development and testing environments +- CI/CD pipelines +- Situations where you've already validated the safety of operations + +**Note:** Use this feature with caution in production environments, as it removes an important safety check. \ No newline at end of file