# What Are the Dependencies for DeepTutor? Complete Package Stack Guide

> Explore the DeepTutor dependencies organized into four hierarchical layers Core CLI Server TutorBot and Development Learn about the complete package stack guide for this project.

- Repository: [✨Data Intelligence Lab@HKU✨/DeepTutor](https://github.com/HKUDS/DeepTutor)
- Tags: getting-started
- Published: 2026-04-08

---

**DeepTutor organizes its Python dependencies into four hierarchical layers—Core CLI, Server, TutorBot, and Development—each defined in separate `requirements/` files that build upon one another through recursive `-r` includes starting from [`requirements/cli.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/cli.txt).**

The HKUDS/DeepTutor repository structures its runtime into modular dependency layers that support everything from command-line agent execution to multi-platform bot deployment. Understanding what are the dependencies for DeepTutor requires examining how these requirement files chain together to provide LLM integrations, RAG capabilities, API serving, and messaging platform connectors. Each layer inherits the previous through explicit file references, ensuring version consistency across CLI tools, FastAPI servers, and autonomous TutorBot instances.

## Core CLI Dependencies ([`requirements/cli.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/cli.txt))

The foundational layer defined in [`requirements/cli.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/cli.txt) powers the interactive terminal, agent tool registry, and document ingestion pipelines. This set includes strict version pins for **production-critical** packages like `pydantic>=2.0.0` for data validation and `openai>=1.30.0` for LLM interactions.

### Configuration and Templating

Environment management and dynamic prompting rely on `python-dotenv>=1.0.0`, `PyYAML>=6.0`, and `jinja2>=3.1.0`. These packages handle secrets loading, agent configuration files, and prompt templates rendered during runtime orchestration.

### LLM Provider SDKs

Multi-provider support requires `openai>=1.30.0`, `anthropic>=0.30.0`, `dashscope>=1.14.0`, and `perplexityai>=0.1.0`, alongside `tiktoken>=0.5.0` for token counting. The conditional `oauth-cli-kit>=0.1.1` installs only on Python 3.11+ for specific authentication flows.

### Async HTTP and Resilience Patterns

The CLI performs concurrent web searches and API calls using `aiohttp>=3.9.4`, `httpx>=0.27.0`, and `requests>=2.32.2`. Resilience utilities include `nest_asyncio>=1.5.8` for nested event loops and `tenacity>=8.0.0` for retry logic within [`deeptutor/runtime/orchestrator.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/runtime/orchestrator.py).

### Data Models and Storage

Structured output validation depends on `pydantic>=2.0.0` and `pydantic-settings>=2.0.0`, while local SQLite caching uses `aiosqlite>=0.19.0`. These support the registry patterns defined in [`deeptutor/runtime/registry/tool_registry.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/runtime/registry/tool_registry.py).

### RAG and Document Processing

Retrieval-Augmented Generation stacks on `llama-index>=0.14.12`, `PyMuPDF>=1.26.0`, and `numpy>=1.24.0,<2.0.0` for PDF parsing and vector operations. Academic paper access uses `arxiv>=2.0.0`, with `ddgs>=9.9.1` enabling DuckDuckGo web search capabilities.

### CLI Framework and Rich Output

The terminal interface in [`deeptutor_cli/main.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor_cli/main.py) depends on `typer[all]>=0.9.0` for command routing, `rich>=13.0.0` for formatted console output, and `prompt_toolkit>=3.0.36` for interactive user prompts.

## Server Dependencies ([`requirements/server.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/server.txt))

The Server layer extends the CLI foundation by importing [`requirements/cli.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/cli.txt) via `-r cli.txt` and adding HTTP serving capabilities. This enables the FastAPI-based web interface and WebSocket communication channels.

**FastAPI and ASGI Server**: `fastapi>=0.100.0` provides the REST API framework, served by `uvicorn[standard]>=0.24.0` with CORS and logging middleware. **Real-time communication** requires `websockets>=12.0` for socket endpoints and `python-multipart>=0.0.6` for file upload handling in multipart forms.

## TutorBot Dependencies ([`requirements/tutorbot.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/tutorbot.txt))

TutorBot extends the Server layer (`-r server.txt`) to support autonomous agents across messaging platforms. This layer introduces scheduling, channel-specific SDKs, and binary serialization for distributed bot instances.

**Messaging Platform SDKs** include `python-telegram-bot[socks]>=22.6` for Telegram, `slack-sdk>=3.39.0` with `slackify-markdown>=0.2.0` for Slack formatting, `lark-oapi>=1.5.0` for Feishu/Lark, `dingtalk-stream>=0.24.0` for DingTalk, and `qq-botpy>=1.2.0` for QQ channel integration. **Scheduling and utilities** leverage `croniter>=6.0.0` for cron-based task scheduling, `loguru>=0.7.3` for structured logging, and `json-repair>=0.57.0` for fixing malformed LLM outputs. **Networking extensions** include `python-socketio>=5.16.0`, `msgpack>=1.1.0`, `python-socks[asyncio]>=2.8.0`, `socksio>=1.0.0`, and `websocket-client>=1.9.0` for proxy-aware WebSocket connections. The `mcp>=1.26.0` package provides Model Context Protocol support for advanced agent capabilities.

## Development Dependencies ([`requirements/dev.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/dev.txt))

The Development set inherits from [`requirements/server.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/server.txt) to include the full runtime stack while adding quality assurance tools. **Testing** requires `pytest>=7.0.0` and `pytest-asyncio>=0.23.0` for async test coverage. **Security and CI** enforce `pre-commit>=3.0.0` for git hooks, `bandit>=1.8.0` for static security analysis, and `safety<3.0.0` for vulnerability scanning of installed packages.

## Dependency Hierarchy and Installation

The inheritance chain ensures consistent versioning: **CLI** ← **Server** ← **TutorBot**, with **Development** branching from Server. Install only the layer matching your deployment target.

Install the Core CLI stack for command-line agent execution:

```bash
pip install -r requirements/cli.txt
pip install -e .
deeptutor --help

```

Install the Server stack for API and WebSocket access:

```bash
pip install -r requirements/server.txt
pip install -e .
deeptutor serve

```

Install the full TutorBot stack for multi-platform bot deployment:

```bash
pip install -r requirements/tutorbot.txt
pip install -e .
deeptutor bot start

```

Install development tools for contributing to the repository:

```bash
pip install -r requirements/dev.txt
pytest

```

## Key Source Files Consuming Dependencies

Several critical modules within HKUDS/DeepTutor directly import and utilize these packages:

- [`deeptutor_cli/main.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor_cli/main.py) – Entry point that wires **Typer**, **Rich**, and **Prompt Toolkit** to the command-line interface, consuming the CLI dependency set.
- [`deeptutor/runtime/orchestrator.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/runtime/orchestrator.py) – Central orchestrator relying on **OpenAI**, **Anthropic**, **AsyncIO**, and **Tenacity** for agent execution flows.
- [`deeptutor/runtime/registry/tool_registry.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/runtime/registry/tool_registry.py) – Registers tool implementations using **Pydantic** models and **LlamaIndex** vector stores defined in the base CLI requirements.

## Summary

- **Core CLI** ([`requirements/cli.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/cli.txt)) provides the foundational runtime for LLM providers, RAG pipelines, and terminal interaction via Typer and Rich.
- **Server** ([`requirements/server.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/server.txt)) extends CLI with FastAPI, Uvicorn, and WebSocket support for REST API deployment.
- **TutorBot** ([`requirements/tutorbot.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/tutorbot.txt)) layers on top of Server to enable Telegram, Slack, DingTalk, Lark, and QQ integrations alongside scheduling utilities.
- **Development** ([`requirements/dev.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/dev.txt)) includes the Server stack plus pytest, pre-commit, Bandit, and Safety for testing and security auditing.
- The inheritance model uses `-r` includes to maintain a single source of truth for version constraints across all deployment modes.

## Frequently Asked Questions

### What is the minimum dependency set to run DeepTutor commands?

The minimum viable installation requires only [`requirements/cli.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/cli.txt), which includes `typer`, `openai`, `llama-index`, and `pydantic`. This supports the core agent runtime, document processing, and interactive terminal without HTTP serving or bot capabilities.

### How do I install DeepTutor with FastAPI server capabilities?

Run `pip install -r requirements/server.txt` followed by `pip install -e .`. This installs the CLI stack plus `fastapi>=0.100.0`, `uvicorn>=0.24.0`, and `websockets>=12.0`, enabling the `deeptutor serve` command documented in [`deeptutor_cli/main.py`](https://github.com/HKUDS/DeepTutor/blob/main/deeptutor_cli/main.py).

### Which dependencies enable Telegram and Slack bot integrations?

The TutorBot layer in [`requirements/tutorbot.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/tutorbot.txt) adds `python-telegram-bot>=22.6`, `slack-sdk>=3.39.0`, and `slackify-markdown>=0.2.0`, along with platform-specific SDKs for DingTalk (`dingtalk-stream`), Lark (`lark-oapi`), and QQ (`qq-botpy`). These require the Server stack as a prerequisite.

### Are development dependencies required for production deployment?

No. [`requirements/dev.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/dev.txt) installs `pytest`, `bandit`, and `pre-commit` for contributors and CI pipelines. Production deployments should use [`requirements/server.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/server.txt) or [`requirements/tutorbot.txt`](https://github.com/HKUDS/DeepTutor/blob/main/requirements/tutorbot.txt) depending on whether you need API endpoints or messaging bot functionality.