add README.md

This commit is contained in:
2026-05-26 12:40:30 +00:00
parent ea95d63fb4
commit a4ea978f84
+9 -62
View File
@@ -1,70 +1,17 @@
# Deep Agent — поисковый агент с виртуальной ФС # DeepAgent Search
Реализация **Deep Agent** на основе фреймворка `deepagents` (deep agents from scratch). This repository contains a simple deep agent that can search the web and create virtual files. The agent is built using the `deepagents` library and follows the "deep agents from scratch" pattern.
## Что умеет агент ## Features
| Возможность | Инструмент | - Web search using DuckDuckGo.
|-------------|------------| - Virtual file creation in an inmemory filesystem.
| Поиск в интернете | `web_search` (DuckDuckGo, без API-ключа) | - Export virtual files to the real filesystem at the end of the run.
| Создание файлов в виртуальной ФС | `write_file` |
| Чтение и редактирование файлов | `read_file`, `edit_file` |
| Выгрузка виртуальных файлов в реальную ФС | `export_virtual_files` |
## Архитектура ## Usage
```
main.py
├── LLM: ChatOpenAI → BroJS (openai/gpt-oss-20b:free)
├── Backend: CompositeBackend
│ ├── LocalShellBackend (virtual_mode=True, root=./workspace/)
│ └── FilesystemBackend (virtual_mode=True, route=/fs/)
└── Tools: web_search, export_virtual_files
```
Агент работает в **виртуальной ФС** (`./workspace/`). По завершении инструмент `export_virtual_files` копирует все созданные файлы в реальную папку `./output/`.
## Установка
```bash ```bash
pip install -r requirements.txt python main.py "search query"
``` ```
## Переменные окружения The agent will perform the search, create virtual files, and write them to the current directory.
| Переменная | Описание |
|------------|----------|
| `JOURNAL_MCP_PAT` | Токен доступа к BroJS LLM |
Создай файл `.env`:
```
JOURNAL_MCP_PAT=jrnl_...
```
## Запуск
```bash
# Запрос по умолчанию (исследование LangGraph)
python main.py
# Свой запрос
python main.py "расскажи про LangChain агентов и сохрани в файл"
```
## Пример работы
```
Запрос: Найди информацию о LangGraph...
=== Ответ агента ===
Файл langgraph_research.md сохранён и выгружен в ./output/
=== Файлы в output/ ===
langgraph_research.md (2847 байт)
```
## Источники
- [deep-agents-from-scratch](https://github.com/langchain-ai/deep-agents-from-scratch)
- [deepagents PyPI](https://pypi.org/project/deepagents/)
- [LangChain docs](https://python.langchain.com/)