From 5f3f32613dd3dc30ea66f5a7d83e6b169a8f3e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=9A=D1=83=D1=82?= =?UTF-8?q?=D0=BB=D0=B0=D1=85=D0=BC=D0=B5=D1=82=D0=BE=D0=B2?= Date: Tue, 26 May 2026 12:16:44 +0000 Subject: [PATCH] add README.md --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9093c5e..48d6311 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,53 @@ -# DeepAgent Implementation +# Deep Agent with Web Search and Virtual File Creation -This repository contains a minimal **DeepAgent** that can search the web and create virtual files. The agent uses OpenRouter for LLM calls, DuckDuckGo for web searches, and `deepagents` to manage a hybrid filesystem + shell backend. +## Overview +This repository contains a minimal implementation of a **Deep Agent** built from scratch using the `deepagents` framework. The agent can: -## Features -- **Web search**: Uses DuckDuckGo API to fetch up to 5 results per query. -- **Virtual file creation**: The agent writes files into a temporary workspace (`./workspace`). -- **Real‑world file export**: After completing the task, the virtual files are copied to the real filesystem under `./workspace`. +1. **Search the web** for information using DuckDuckGo. +2. **Create virtual files** during its execution. +3. **Export** those virtual files to the real filesystem after the agent finishes. -## How it works -1. The agent is instantiated with an OpenRouter LLM and a single web search tool. -2. A backend combines a local shell environment (for executing commands) and a simple in‑memory filesystem. -3. When the user asks for information, the agent calls `web_search`, receives the results, and stores them in `results.txt` inside the virtual workspace. -4. The script then copies that file to the real working directory so it can be committed to Git later. +The implementation follows the guidelines from the *Deep Agents from Scratch* course and uses the BroJS LLM endpoint. -## Running locally +## Prerequisites +- Python 3.10 or newer +- A valid BroJS API key set in the environment variable `JOURNAL_MCP_PAT`. +- (Optional) A virtual environment to isolate dependencies. + +## Installation ```bash +# Clone the repository +git clone https://git.brojs.ru/KirillKutlakhmetov/task-69de7223f309a98be0007e09.git +cd task-69de7223f309a98be0007e09 + +# Create and activate a virtual environment (recommended) +python -m venv .venv +source .venv/bin/activate # On Windows use .venv\Scripts\activate + +# Install dependencies pip install -r requirements.txt +``` + +## Usage +```bash +# Ensure the environment variable is set +export JOURNAL_MCP_PAT=your_brojs_api_key + +# Run the agent python main.py ``` -The program will print search results and create a `results.txt` file in the current directory. + +The agent will perform a sample query (`"Python async programming"`). After completion, the virtual files created during the run will be exported to the `./exported_files` directory. + +## Project Structure +- `main.py` – Entry point and agent definition. +- `requirements.txt` – Python dependencies. +- `README.md` – Project documentation. + +## Customization +- To change the query, modify the `user_query` variable in `main.py`. +- To add more tools, define additional functions decorated with `@tool` and include them in the `tools` list when creating the agent. +- The agent can be extended to accept user input at runtime by replacing the hard‑coded query. + +## License +MIT License.