Skip to content

fnusatvik07/deep-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Agents Lifecycle

An interactive tutorial platform that teaches you how to build production-grade AI agents from scratch. 15 progressive chapters, each adding exactly one new concept — from "hello world" to a full multi-agent pipeline that generates charts, reports, and presentations.

What's Inside

deep-agents/
  deepagents-examples/     # 15 Python scripts — the actual tutorial
  backend/                  # FastAPI server that runs examples & streams output
  frontend/                 # Next.js interactive UI with live code viewer
  output/                   # Runtime output organized by chapter (ch01-ch15)
  workspace/                # Agent workspace (files the agent reads/writes)
  skills/                   # Skill files loaded by chapter 12+

The 15 Chapters

# File New Concept What the Agent Does
01 01_hello_analyst.py create_deep_agent() Answers "what is a pivot table?"
02 02_pick_your_brain.py Model swap Same question on GPT vs Claude vs Gemini
03 03_give_it_eyes.py Custom @tool Reads CSV data with a custom tool
04 04_the_analyst.py System prompt Structured analysis with methodology
05 05_think_first.py Planning (write_todos) Plans before analyzing
06 06_files_on_disk.py FilesystemBackend Reads/writes real files on disk
07 07_safe_code_lab.py Daytona sandbox Runs pandas + matplotlib in isolation
08 08_analyst_team.py Sub-agents Data Wrangler + Chart Designer + Report Writer
09 09_it_remembers.py Memory (checkpointer) Remembers preferences across sessions
10 10_trust_gate.py Human-in-the-loop Pauses for approval on destructive ops
11 11_production_armor.py Middleware Retry, rate-limit, token tracking
12 12_domain_brain.py Skills Loads statistics playbook + chart design guide
13 13_typed_results.py Structured output Returns Pydantic AnalysisReport object
14 14_learning_agent.py Persistent learning Agent reads/writes AGENTS.md to learn from corrections
15 15_full_pipeline.py Everything combined CSV -> Charts -> PPT -> Word -> Excel

Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • API keys for OpenAI (required), Anthropic (ch02), Daytona (ch07+)

1. Install Python dependencies

pip install deepagents langchain-daytona python-dotenv

2. Set up environment

cp .env.example .env
# Add your API keys to .env

Required keys:

OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...     # for chapter 02
DAYTONA_API_KEY=...               # for chapters 07+

3. Run individual chapters

cd deepagents-examples
python 01_hello_analyst.py
python 02_pick_your_brain.py
# ... work through all 15

4. Run the interactive UI

# Terminal 1 — Backend
cd backend
pip install -r requirements.txt
python server.py

# Terminal 2 — Frontend
cd frontend
npm install
npm run dev

Open http://localhost:3000 to access the interactive tutorial platform.

Interactive UI Features

  • Learn Tab — Read through each chapter's concepts and code
  • Lab Tab — Run any chapter's code live, watch the agent work in real-time with token stats, tool call tracking, and execution timing
  • Explore Tab — Browse the codebase
  • Agent Failure Arcade — 6 interactive games showing why standard agents fail (context rot, no planning, unsafe execution, amnesia, wrong tools, hallucination)

Output Structure

Each chapter writes its output to output/chXX/:

output/
  ch01/    # Simple text responses
  ch06/    # Files written to disk
  ch07/    # Charts generated in sandbox
  ch08/    # Multi-agent coordinated output
  ch15/    # Full pipeline: charts, Excel, PowerPoint, Word, Markdown

Tech Stack

  • Agent Framework: deepagents (built on LangGraph)
  • LLM Providers: OpenAI, Anthropic, Google (configurable per chapter)
  • Sandbox: Daytona (isolated code execution)
  • Backend: FastAPI + SSE streaming
  • Frontend: Next.js 15, Tailwind CSS, Framer Motion

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors