Update README.md
This commit is contained in:
@@ -1,42 +1,29 @@
|
|||||||
# Deep Agent – Search + Virtual Files
|
# Deep Agent from Scratch
|
||||||
|
|
||||||
This repository contains a minimal **deep agent** implementation based on the
|
This repository contains a minimal implementation of a deep agent that can:
|
||||||
"Deep Agents from Scratch" course. The agent can:
|
|
||||||
|
|
||||||
1. Search the web (simple Bing wrapper).
|
1. Search the web using DuckDuckGo.
|
||||||
2. Create and modify files in an **in‑memory virtual file system**.
|
2. Create virtual files in memory.
|
||||||
3. Read those virtual files.
|
3. Export the virtual files to the real file system.
|
||||||
4. Dump the virtual file system to the real disk at the end of the run.
|
|
||||||
|
|
||||||
## Setup
|
The agent is built using the new LangChain 1.x and LangGraph 1.x APIs.
|
||||||
|
|
||||||
```bash
|
## Prerequisites
|
||||||
# Create a virtual environment (optional but recommended)
|
|
||||||
python -m venv venv
|
|
||||||
source venv/bin/activate # Windows: venv\Scripts\activate
|
|
||||||
|
|
||||||
# Install dependencies
|
- Python 3.11 or newer
|
||||||
pip install -r requirements.txt
|
- Ollama running locally with a model such as `llama3.1`
|
||||||
```
|
- `pip install -r requirements.txt`
|
||||||
|
|
||||||
> **Prerequisite** – An Ollama server must be running locally with a model
|
## Running the Agent
|
||||||
> such as `llama3.1` available.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python agent.py
|
python agent.py
|
||||||
```
|
```
|
||||||
|
|
||||||
You will be prompted to type questions. The agent will decide which tool to
|
The script will run the agent with a sample prompt, create a virtual file `report.txt`, and export it to the `exported_files` directory.
|
||||||
use. When you are finished, type `exit`.
|
|
||||||
|
|
||||||
The virtual files are stored in memory. To persist them, use the `DumpVirtualFS`
|
## File Structure
|
||||||
tool or call `dump_virtual_fs_tool("output")` from within the agent.
|
|
||||||
|
|
||||||
## Files
|
- `agent.py` – Main implementation.
|
||||||
|
|
||||||
- `agent.py` – Main agent implementation.
|
|
||||||
- `virtual_fs.py` – Simple in‑memory file system.
|
|
||||||
- `requirements.txt` – Python dependencies.
|
- `requirements.txt` – Python dependencies.
|
||||||
- `README.md` – This documentation.
|
- `README.md` – This file.
|
||||||
Reference in New Issue
Block a user