Introduction to DeepAgents CLI

# DeepAgents CLI – Your AI-Powered Development Assistant

We’re excited to introduce **DeepAgents CLI** — a powerful tool for **coding**, **research**, and building **agents with persistent memory**. Now you can easily create and run custom DeepAgents directly from the terminal.

## Key Capabilities

- **Read, write, and edit files** within your project  
- **Execute shell commands** (with human approval)  
- **Search the web** for current information  
- **Make HTTP requests** to APIs  
- **Learn and remember** across sessions  
- **Plan tasks** with visual to-do lists  

---

## Installation

Choose your preferred method:

**Using pip:**

pip install deepagents-cli


**Using uv:**

uv pip install deepagents-cli


---

## Quick Start

### 1. Configure API Keys
DeepAgents CLI supports both **Anthropic (Claude)** and **OpenAI** models.  
**Default model:** *Anthropic Claude Sonnet 4*  
**Default search engine:** *Tavily*  

Add keys to your `.env` in your project root:

export ANTHROPIC_API_KEY=your_api_key_here

export OPENAI_API_KEY=your_api_key_here

export TAVILY_API_KEY=your_tavily_key_here


The CLI will automatically load these.

---

### 2. Launch DeepAgents
From your project directory:

deepagents


Or with uv:

uv run deepagents


---

### 3. Run Your First Task

Example prompt:

You: Add type hints to all functions in src/utils.py


The agent will:
1. **Read** the file  
2. **Analyze** the functions  
3. **Show a diff** of proposed changes  
4. **Request your approval** before writing  

💡 **Tip:** Enable *Auto-Accept Edits* to speed up development.

---

## Integration with Publishing Platforms

In modern AI workflows, pairing persistent-memory agents with **multi-platform publishing** can vastly improve productivity.  

Tools like [AiToEarn官网](https://aitoearn.ai/) enable:
- AI content generation
- Instant publishing to major platforms
- Analytics and performance tracking
- Monetization via open-source infrastructure

Publish across: Douyin, Kwai, WeChat, Bilibili, Rednote, Facebook, Instagram, LinkedIn, Threads, YouTube, Pinterest, and X (Twitter).

---

## Persistent Memory in DeepAgents

### How It Works
DeepAgents’ **persistent memory system** lets agents:
- Retain knowledge between sessions
- Apply learned info in future tasks

**Storage location:**

~/.deepagents/AGENT_NAME/memories/


**Default agent:** `agent`  
Switch with:

deepagents --agent foo


---

## Memory-First Protocol

Agents automatically:
- **Research:** Check `/memories/` first
- **Answer:** Search memory files if unsure
- **Learn:** Save new info into `/memories/`

---

### Example — Teaching API Patterns

**You:**  
Our API follows these rules:  
- Use `/api/v1/` prefix  
- POST requests return `201` on success  
- Errors include `"code"` and `"message"`  

**Agent:**  
I'll save these to `/memories/api-conventions.md`.

Later, when tasked with user registration:
- Reads `api-conventions.md`
- Creates `/api/v1/users` endpoint returning `201`
- Uses specified error format

---

## Memory Best Practices

**1. Use descriptive filenames**

✓ /memories/deployment-checklist.md

✗ /memories/notes.md


**2. Organize by topic**

/memories/

├── backend/

│ ├── tools_to_use.md

│ └── api-design.md

├── frontend/

│ ├── component-patterns.md

└── security-setup.md


**3. Validate saved knowledge**
Inspect memory files directly:

ls ~/.deepagents/AGENT_NAME/memories/


---

## Why Memory Matters for Teams

A shared, structured memory ensures **consistency** for:
- Multiple collaborators
- Multiple AI agents
- Scaling workflows
- Automating repetitive tasks

When combined with publishing tools like **AiToEarn**:
- Maintain guidelines & templates
- Publish consistently across many channels
- Monetize AI-driven content effectively

---

### Managing Multiple Agents

- **List agents:**

deepagents --list

- **Use a specific agent:**

deepagents --agent backend-dev

- **Reset an agent:**

deepagents --reset backend-dev


---

## Get Started

Start building with DeepAgents CLI today.

**Join the community:**
- GitHub: [github.com/langchain-ai/deepagents](https://github.com/langchain-ai/deepagents?ref=blog.langchain.com)  
- Docs: [docs.langchain.com/oss/python/deepagents](https://docs.langchain.com/oss/python/deepagents/overview?ref=blog.langchain.com)  
- YouTube: [youtu.be/IrnacLa9PJc](https://youtu.be/IrnacLa9PJc?ref=blog.langchain.com)

---

## Explore AiToEarn

If you want to combine intelligent agents with multi-platform publishing and monetization, try **AiToEarn**.  
Features include:
- AI content generation
- Cross-platform publishing
- Analytics
- Model ranking

Publish instantly to: Douyin, Kwai, WeChat, Bilibili, Rednote, Facebook, Instagram, LinkedIn, Threads, YouTube, Pinterest, X (Twitter).

**Learn more:**
- [AiToEarn官网](https://aitoearn.ai/)  
- [AiToEarn博客](https://blog.aitoearn.ai)  
- [AiToEarn开源地址](https://github.com/yikart/AiToEarn)  
- [AiToEarn文档](https://docs.aitoearn.ai/)  
- [AI模型排名](https://rank.aitoearn.ai)

Read more