Files
task-69de7223f309a98be0007e09/README.md
T
2026-05-26 12:48:41 +00:00

40 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# DeepAgent from Scratch
## Overview
This repository contains a minimal implementation of a **DeepAgent** inspired by the *Deep Agents from Scratch* course. The agent can:
1. Search the web using DuckDuckGo.
2. Create virtual files in an inmemory file system.
3. Persist those virtual files to the real file system when the task is finished.
The implementation uses:
- **LangChain OpenAI** (`ChatOpenAI`) for LLM interactions.
- **DuckDuckGo Search** for web queries.
- A simple `VirtualFileSystem` class to hold files in memory.
## Requirements
```
langchain-openai>=0.3.0
langchain>=1.2.10
langgraph>=0.2.0
duckduckgo-search
```
## Running the Agent
```bash
# Install dependencies
pip install -r requirements.txt
# Run the agent
python main.py
```
The script will perform a sample search for *"LangChain deep agent"* and create a file named `summary.txt` with the first search result. All virtual files are written to the current directory.
## Extending the Agent
- Add more tools by decorating functions with `@tool` and passing them to `DeepAgent`.
- Modify the `run` method to change the interaction loop or add more sophisticated prompting.
## License
MIT