2026-06-04 16:21:44 +00:00
2026-06-04 16:21:09 +00:00
2026-06-03 07:32:34 +00:00
2026-06-02 07:03:41 +00:00
2026-06-04 16:15:40 +00:00
2026-06-04 16:15:50 +00:00
2026-06-04 16:15:30 +00:00
2026-06-04 16:15:59 +00:00

Deep Agent based on LangGraph & LangChain

This repository contains a minimal implementation of a Deep Agent that can:

  1. Search the web using the Tavily search API.
  2. Create virtual files in an inmemory file system.
  3. Export all virtual files to the real filesystem.

The agent is built on top of the LangGraph framework and uses the LangChain tools API.

Installation

# Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Note

: The Tavily API key is required for the web search tool. Set it via the environment variable TAVILY_API_KEY.

Usage

from agent import create_agent_executor, vfs

# Create an executor
executor = create_agent_executor()

# Run the agent with a simple prompt
result = executor.invoke({"input": "Find the latest news about Python and create a file called news.txt with the summary."})
print(result)

# After the agent finishes, export the virtual files
vfs.export_to_disk("output")

The output directory will contain news.txt with the content produced by the agent.

Testing

The project includes a simple test that verifies the existence of the two required functions:

python -m unittest discover -s tests

License

MIT

S
Description
8. Самописный поисковый агент на основе deep agents from scratch
Readme MIT 133 KiB
Languages
Python 100%