Shell execution · Streaming · RAG · Multi-agent · Persistent memory · Web UI
📖 中文版 README | 📘 Prerequisite: Agent Builder — the 6-step beginner tutorial.
| Beginner | Pro |
|---|---|
| Q&A only | ✅ Execute shell commands (ls, cat, git) |
| Response appears all at once | ✅ Stream word-by-word (like ChatGPT) |
| Memory lost on exit | ✅ SQLite persistent memory |
| Knows only training data | ✅ RAG — reads your documents |
| Single agent | ✅ Multi-agent pipeline |
| Terminal-only | ✅ Gradio Web UI |
| # | File | What You Learn | Core Skill |
|---|---|---|---|
| P1 | step_p1_shell_executor.py |
Safe shell execution | subprocess, whitelist sandbox |
| P2 | step_p2_streaming.py |
Streaming output | async generators, yield |
| P3 | step_p3_rag.py |
RAG retrieval | sentence-transformers, cosine similarity |
| P4 | step_p4_multi_agent.py |
Multi-agent pipeline | Researcher → Writer → Reviewer |
| P5 | step_p5_persistent_memory.py |
Persistent memory | SQLite, session recovery |
| P6 | step_p6_web_ui.py |
Gradio Web UI | ChatInterface, streaming in web |
| P7 | step_p7_full_pro.py |
Complete Pro Agent | All components + Web UI |
# Install
pip install -r requirements.txt
# API key
export OPENAI_API_KEY="sk-your-key"
export OPENAI_BASE_URL="https://api.deepseek.com/v1"
# Run (P1 and P3 work without API key!)
python step_p1_shell_executor.py
python step_p2_streaming.py
python step_p3_rag.py
# ...
python step_p7_full_pro.py # The grand finale: Web UI + Shell + Memory💡 Stuck? → TROUBLESHOOTING.md
| Package | Used In | Purpose |
|---|---|---|
openai |
P2-P7 | LLM API |
sentence-transformers |
P3 | Text → vector embedding |
gradio |
P6-P7 | Web chat interface |
agent-builder-pro/
├── step_p1_shell_executor.py ← Safe shell commands
├── step_p2_streaming.py ← Stream word-by-word
├── step_p3_rag.py ← Document retrieval
├── step_p4_multi_agent.py ← Multi-agent pipeline
├── step_p5_persistent_memory.py ← SQLite memory
├── step_p6_web_ui.py ← Gradio interface
├── step_p7_full_pro.py ← Complete product
├── exercises/ ← Practice exercises
├── outputs/ ← Example outputs
├── CHEATSHEET.md ← Quick reference
├── ARCHITECTURE.md ← Deep dive
└── TROUBLESHOOTING.md ← Error fixes
MIT © 2026