$ show bytedance/deer-flow
DeerFlow is an open-source, full-stack AI agent harness built on LangGraph/LangChain, providing a production-ready platform for building, deploying, and managing conversational AI agents. The system features a Python/FastAPI backend with a modular architecture that includes agent orchestration, long-term memory (DeerMem), sandboxed code execution, a skill system with static analysis (SkillScan), MCP (Model Context Protocol) tool integration, multi-channel IM support (Telegram, Slack, Discord, Lark, etc.), scheduled tasks, subagent batches, and a comprehensive authorization framework. The frontend is a Next.js/React workspace with real-time streaming, artifact management, and a terminal UI (TUI) for headless operation. The architecture follows a gateway pattern: the FastAPI gateway handles authentication (JWT, OAuth, PATs), routing, and SSE streaming, while the core harness package (`deerflow`) implements agent logic, middleware chains, and runtime components. Persistence uses SQLAlchemy with Alembic migrations, supporting both SQLite and PostgreSQL. The system is highly extensible via a Python extension API (`deerflow-extension-api`) and a plugin system for frontend surfaces. Deployment supports Docker Compose and Kubernetes (Helm chart). While primarily an application, DeerFlow includes research-oriented components such as memory eviction benchmarks, context snapshot evaluations, and tracing integrations (LangSmith, Langfuse, OpenTelemetry). The codebase demonstrates strong engineering practices with extensive unit tests, blocking IO regression tests, and contract tests, though its large feature surface and many configuration options introduce complexity and potential for drift between environments.
The LLM identified 4 files worth highlighting for reuse:
A self-contained module that maps tool names to friendly titles, extracts salient detail keys, and truncates results for TUI display. It has no Textual dependency, making it unit-testable and reusable in any Python project that needs to format tool call metadata into human-readable summaries.
Implements generic batch filtering of tools and resources based on authorization outcomes. Supports fail-closed and fail-open policies, and can be extracted to enforce access control in any agent or API system that needs to filter a list of available actions per principal.
Defines an abstract base class for checkpoint caching with a clear contract (get, set, evict, clear). The protocol is backend-agnostic, allowing implementations for memory, Redis, or other stores. This pattern is reusable in any system requiring a pluggable cache layer with eviction semantics.
A centralized fetch wrapper that automatically attaches CSRF tokens, includes credentials, and handles 401 redirects. It enforces consistent error handling and can be extracted as a standalone utility for any frontend application that communicates with a backend using session-based authentication.