DanielWalnut 5f4c58aa82 feat: implement lazy sandbox and thread data initialization (#11)
Defer sandbox acquisition and thread directory creation until first use to improve performance and reduce resource usage.

Changes:
- Add lazy_init parameter to SandboxMiddleware (default: true)
- Add ensure_sandbox_initialized() helper for lazy sandbox acquisition
- Update all sandbox tools to use lazy initialization
- Add lazy_init parameter to ThreadDataMiddleware (default: true)
- Create thread directories on-demand in AioSandboxProvider
- LocalSandbox already creates directories on write (no changes needed)

Benefits:
- Saves 1-2s Docker container startup for conversations without tools
- Reduces unnecessary directory creation and file system operations
- Backward compatible with lazy_init=false option

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 13:38:34 +08:00
2026-01-18 13:16:27 +08:00
2026-01-14 07:09:20 +08:00
2026-01-14 07:09:20 +08:00

🦌 DeerFlow - v2

Originated from Open Source, give back to Open Source.

A LangGraph-based AI agent backend with sandbox execution capabilities.

Quick Start

  1. Configure the application:

    # Copy example configuration
    cp config.example.yaml config.yaml
    
    # Set your API keys
    export OPENAI_API_KEY="your-key-here"
    # or edit config.yaml directly
    
  2. Install dependencies:

    cd backend
    make install
    
  3. Run development server:

    make dev
    

Project Structure

deer-flow/
├── config.example.yaml    # Configuration template (copy to config.yaml)
├── backend/               # Backend application
│   ├── src/              # Source code
│   └── docs/             # Documentation
├── frontend/             # Frontend application
└── skills/               # Agent skills
    ├── public/           # Public skills
    └── custom/           # Custom skills

Documentation

License

This project is open source and available under the MIT License.

Acknowledgments

DeerFlow is built upon the incredible work of the open-source community. We are deeply grateful to all the projects and contributors whose efforts have made DeerFlow possible. Truly, we stand on the shoulders of giants.

We would like to extend our sincere appreciation to the following projects for their invaluable contributions:

  • LangChain: Their exceptional framework powers our LLM interactions and chains, enabling seamless integration and functionality.
  • LangGraph: Their innovative approach to multi-agent orchestration has been instrumental in enabling DeerFlow's sophisticated workflows.

These projects exemplify the transformative power of open-source collaboration, and we are proud to build upon their foundations.

Key Contributors

A heartfelt thank you goes out to the core authors of DeerFlow, whose vision, passion, and dedication have brought this project to life:

Your unwavering commitment and expertise have been the driving force behind DeerFlow's success. We are honored to have you at the helm of this journey.

Star History

Star History Chart

Description
No description provided
Readme MIT 24 MiB
Languages
Python 59.3%
TypeScript 24.3%
HTML 7.3%
CSS 3.2%
JavaScript 2.8%
Other 3.1%