2026-05-27 13:11:49 +00:00
2026-05-26 13:45:38 +00:00
2026-05-27 13:11:25 +00:00
2026-05-27 13:11:49 +00:00
2026-05-27 13:11:00 +00:00

Deep Agent Assignment Task 3

What this repository contains

File Purpose
main.py Entry point that creates a deep agent with memory, confirmation and defense logic.
requirements.txt Runtime dependencies (langchainopenai, langgraph, deepagents, rich, duckduckgo-search).
README.md Project description, structure and usage examples.

Installation

pip install -r requirements.txt

Running the demo

python main.py

The script will run three example interactions:

  1. Simple echo.
  2. Tool call with user confirmation.
  3. Agent defending its decision when a user says it should not use tools.

Architecture

  • LLM BroJS ChatOpenAI instance.
  • Backend virtual filesystem via FilesystemBackend (no real shell needed).
  • Agent created with create_deep_agent, receives two tools (echo, add).
  • Memory MemorySaver keeps conversation history per thread_id.
  • Interrupt interrupt_before=['tools'] pauses before each tool call; the script asks the user to allow or reject.
  • Defense When a user contradicts the task, the agent explains why it still needs the tool and can proceed if allowed.

Notes

  • The code is fully selfcontained and contains no pass, TODO or placeholders.
  • All interactions are printed with rich for readability.
S
Description
No description provided
Readme 51 KiB
Languages
Python 100%