类库 › ai-agent-book
chemark

chemark/ai-agent-book

一本关于AI Agent设计原理与工程实践的开源书籍,基于“Agent=LLM+上下文+工具”核心公式。涵盖从基础、上下文工程到多Agent协作的十章内容,提供92个配套Python实验代码,旨在帮助读者深入理解并实战构建AI Agent系统。

技术栈

chapter1/context python

测试

pytest

网络

Requests
查看全部依赖 (9)

依赖

NumPy PyPDF2 black flake8 matplotlib openai python-dotenv reportlab tabulate

chapter1/learning-from-experience python

查看全部依赖 (5)

依赖

NumPy matplotlib openai python-dotenv seaborn

chapter1/search-codegen python

测试

pytest

网络

Requests
查看全部依赖 (13)

依赖

NumPy Pandas Pydantic black colorama flake8 matplotlib mypy openai pytest-asyncio python-dotenv rich tqdm

chapter1/web-search-agent python

测试

pytest
查看全部依赖 (7)

依赖

aiohttp black openai pylint python-dotenv rich tenacity

chapter10/book-translation python

查看全部依赖 (3)

依赖

openai python-dotenv tiktoken

chapter10/multi-role-transfer python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter10/parallel-web-research python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter10/staged-system-prompt python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter10/voice-werewolf python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter2/agent-skills-ppt python

查看全部依赖 (3)

依赖

openai python-dotenv python-pptx

chapter2/attention_visualization/frontend javascript

框架

Next.js 14.0.4 React ^18.2.0

CSS 框架

Tailwind CSS ^3.3.0

代码规范

ESLint ^8
查看全部依赖 (13)

依赖

clsx ^2.0.0 d3 ^7.8.5 react-dom ^18.2.0 recharts ^2.10.4 tailwind-merge ^2.2.0

开发依赖

@types/d3 ^7.4.3 @types/node ^20 @types/react ^18 @types/react-dom ^18 autoprefixer ^10.0.1 eslint-config-next 14.0.4 postcss ^8 typescript ^5

chapter2/attention_visualization python

网络

Requests
查看全部依赖 (6)

依赖

NumPy matplotlib python-dotenv seaborn torch transformers

chapter2/context-compression python

网络

Requests
查看全部依赖 (8)

依赖

beautifulsoup4 colorama html2text lxml openai python-dotenv tiktoken tqdm

chapter2/kv-cache python

查看全部依赖 (4)

依赖

openai python-dotenv rich tabulate

chapter2/local_llm_serving python

框架

FastAPI

网络

Requests
查看全部依赖 (11)

依赖

PyPDF2 Pydantic accelerate ollama openai python-dotenv python-weather torch transformers uvicorn vllm

chapter2/log-sanitization python

查看全部依赖 (2)

依赖

ollama pyyaml

chapter2/prompt-engineering python

网络

Requests
查看全部依赖 (10)

依赖

NumPy Pydantic anthropic google-generativeai litellm mistralai openai python-dotenv tenacity termcolor

chapter2/prompt-injection python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter2/system-hint python

网络

Requests
查看全部依赖 (2)

依赖

openai python-dotenv

chapter3/agentic-rag-for-user-memory python

网络

Requests
查看全部依赖 (6)

依赖

NumPy openai python-dotenv pyyaml rich tiktoken

chapter3/agentic-rag python

网络

Requests
查看全部依赖 (3)

依赖

jieba openai python-dotenv

chapter3/contextual-retrieval-for-user-memory python

测试

pytest

网络

Requests
查看全部依赖 (11)

依赖

NumPy Pandas black click flake8 openai python-dotenv pyyaml rich tenacity tiktoken

chapter3/contextual-retrieval python

网络

Requests
查看全部依赖 (7)

依赖

NumPy Pydantic openai python-dotenv rank-bm25 scikit-learn tiktoken

chapter3/dense-embedding python

框架

FastAPI
查看全部依赖 (12)

依赖

FlagEmbedding NumPy Pydantic annoy colorlog hnswlib python-dotenv python-multipart sentencepiece torch transformers uvicorn

chapter3/mem0 python

测试

pytest
查看全部依赖 (16)

依赖

NumPy Pandas Pydantic chromadb click httpx mem0ai openai pytest-asyncio python-dotenv qdrant-client rich scikit-learn tenacity tqdm typer

chapter3/memobase python

查看全部依赖 (11)

依赖

NumPy Pandas Pydantic httpx memobase openai python-dotenv rich scikit-learn tenacity tiktoken

chapter3/multimodal-agent python

测试

pytest
查看全部依赖 (11)

依赖

aiofiles google-genai httpx matplotlib mistralai openai pytest-asyncio pytest-mock python-dotenv python-magic reportlab

chapter3/retrieval-pipeline python

框架

FastAPI
查看全部依赖 (15)

依赖

FlagEmbedding NumPy Pydantic aiohttp httpx huggingface-hub jieba python-multipart rank-bm25 sentence-transformers torch tqdm transformers typing-extensions uvicorn

chapter3/sparse-embedding python

框架

FastAPI

网络

Requests
查看全部依赖 (3)

依赖

Pydantic python-multipart uvicorn

chapter3/structured-index python

框架

FastAPI

测试

pytest

网络

Requests
查看全部依赖 (31)

依赖

NumPy Pandas Pydantic aiofiles azure-search-documents azure-storage-blob beautifulsoup4 faiss-cpu graphrag httpx loguru lxml markdown networkx openai pdfplumber pyarrow pypdf pytest-asyncio python-dotenv pyyaml raptor-rag rich scikit-learn sentence-transformers tabulate tiktoken tqdm transformers umap-learn uvicorn

chapter3/structured-knowledge-extraction python

查看全部依赖 (4)

依赖

NumPy openai python-dotenv scikit-learn

chapter3/user-memory-evaluation python

查看全部依赖 (8)

依赖

Pandas Pydantic openai python-dotenv pyyaml rich tenacity typing-extensions

chapter3/user-memory python

测试

pytest

网络

Requests
查看全部依赖 (7)

依赖

Pydantic colorama openai pytest-asyncio python-dotenv pyyaml rich

chapter4/active-tool-discovery python

查看全部依赖 (3)

依赖

openai python-dotenv tiktoken

chapter4/active-tool-selection python

网络

Requests
查看全部依赖 (5)

依赖

NumPy openai python-dotenv scikit-learn tabulate

chapter4/agent-with-event-trigger python

框架

FastAPI Flask

网络

Requests
查看全部依赖 (4)

依赖

mcp openai python-dotenv uvicorn

chapter4/async-agent python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter4/collaboration-tools python

测试

Playwright

网络

Requests
查看全部依赖 (18)

依赖

Pandas Pydantic aiosmtplib anyio apscheduler browser-use fastmcp httpx langchain-openai loguru mcp openai openpyxl pydantic-settings python-chess python-dotenv sendgrid tiktoken

chapter4/execution-tools python

测试

pytest

网络

Requests
查看全部依赖 (39)

依赖

NumPy Pandas PyGithub PyMuPDF PyPDF2 Pydantic XlsxWriter beautifulsoup4 colorama google-api-python-client google-auth google-auth-httplib2 google-auth-oauthlib httpx lightgbm lxml matplotlib mcp openai opencv-python openpyxl pillow plotly psutil pytest-asyncio pytest-cov pytest-mock python-docx python-dotenv scikit-image scikit-learn scipy seaborn statsmodels structlog subprocess-tee tabulate xgboost xlrd

chapter4/perception-tools python

网络

Requests
查看全部依赖 (19)

依赖

Pandas Pillow PyPDF2 Pydantic arxiv beautifulsoup4 chardet lxml mcp openai opencv-python python-docx python-dotenv python-pptx waybackpy wikipedia yfinance youtube-transcript-api yt-dlp

chapter5/adaptive-log-parser python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter5/code-for-logic python

查看全部依赖 (2)

依赖

openai python-constraint

chapter5/code-for-math python

查看全部依赖 (4)

依赖

NumPy openai scipy sympy

chapter5/coding-agent python

测试

pytest

网络

Requests
查看全部依赖 (7)

依赖

PyPDF2 anthropic beautifulsoup4 html2text openai pytest-cov python-dotenv

chapter5/conversational-ui/backend python

框架

FastAPI
查看全部依赖 (1)

依赖

uvicorn

chapter5/conversational-ui/frontend javascript

框架

React ^18.3.1

构建工具

Vite ^6.0.7
查看全部依赖 (2)

依赖

react-dom ^18.3.1

开发依赖

@vitejs/plugin-react ^4.3.4

chapter5/conversational-ui python

框架

FastAPI
查看全部依赖 (3)

依赖

openai python-dotenv uvicorn

chapter5/dynamic-form python

查看全部依赖 (3)

依赖

beautifulsoup4 openai python-dotenv

chapter5/erp-agent python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter5/log-diagnosis python

查看全部依赖 (3)

依赖

mcp openai python-dotenv

chapter5/paper-to-ppt javascript

查看全部依赖 (8)

依赖

@slidev/cli ^0.49.29 @slidev/theme-default ^0.25.0 Pillow matplotlib openai playwright-chromium ^1.44.0 python-dotenv typescript ^5.9.3

chapter5/paper-to-video python

查看全部依赖 (3)

依赖

Pillow openai python-dotenv

chapter5/small-model-codified-rules python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter5/video-edit python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter6/agent-cost-analysis python

查看全部依赖 (2)

依赖

openai tiktoken

chapter6/elo-leaderboard python

网络

Requests
查看全部依赖 (7)

依赖

NumPy Pandas matplotlib plotly scikit-learn seaborn tqdm

chapter6/model-benchmark python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter6/public-health-reporting-eval python

测试

pytest

chapter6/tts-quality-eval python

查看全部依赖 (1)

依赖

openai

chapter7/MultilingualReasoning python

查看全部依赖 (9)

依赖

accelerate bitsandbytes datasets huggingface-hub peft torch trackio transformers trl

chapter7/continued-pretraining python

查看全部依赖 (8)

依赖

accelerate bitsandbytes datasets scipy torch transformers unsloth wandb

chapter7/cot-distillation python

查看全部依赖 (1)

依赖

openai

chapter7/orpheus python

查看全部依赖 (20)

依赖

accelerate bitsandbytes cut_cross_entropy datasets hf_transfer huggingface_hub librosa peft protobuf sentencepiece snac soundfile torch torchaudio transformers triton trl unsloth unsloth_zoo xformers

chapter7/sesame python

查看全部依赖 (18)

依赖

accelerate bitsandbytes cut_cross_entropy datasets hf_transfer huggingface_hub peft protobuf sentencepiece soundfile torch torchcodec tqdm transformers triton trl unsloth unsloth_zoo

chapter8/browser-use-rpa python

测试

Playwright
查看全部依赖 (12)

依赖

Pillow Pydantic aiofiles anthropic asyncio-atexit browser-use colorlog google-generativeai openai playwright-stealth python-dotenv uuid-extensions

chapter8/gaia-experience/AWorld/aworld/cmd/web/webui javascript

框架

React ^18.2.0

构建工具

Vite ^6.3.5

CSS 预处理器

Less ^4.3.0

代码规范

ESLint ^9.25.0
查看全部依赖 (21)

依赖

@ant-design/x ^1.4.0 @xyflow/react ^12.8.1 antd ^5.26.0 antd-style ^3.7.1 dagre ^0.8.5 mermaid ^11.7.0 react-dom ^18.2.0 react-markdown ^10.1.0 react-router-dom ^6.30.1 uuid ^11.1.0

开发依赖

@eslint/js ^9.25.0 @types/dagre ^0.7.53 @types/node ^24.0.4 @types/react ^18.2.0 @types/react-dom ^18.2.0 @vitejs/plugin-react ^4.4.1 eslint-plugin-react-hooks ^5.2.0 eslint-plugin-react-refresh ^0.4.19 globals ^16.0.0 typescript ~5.8.3 typescript-eslint ^8.30.1

chapter8/gaia-experience/AWorld/aworld python

框架

FastAPI
查看全部依赖 (16)

依赖

NumPy Pydantic aiohttp click executing kubernetes mcp openai opentelemetry-api opentelemetry-exporter-otlp opentelemetry-sdk packaging python-dotenv pyvis pyyaml tiktoken

chapter8/gaia-experience/AWorld/aworlddistributed python

框架

FastAPI Flask

ORM

SQLAlchemy

网络

Requests
查看全部依赖 (32)

依赖

PyJWT PyPDF2 Pydantic aiohttp bcrypt browser_use datasets docx2markdown e2b_code_interpreter executing fitz frontend grpcio html2text httpx openpyxl opentelemetry-api opentelemetry-exporter-otlp opentelemetry-instrumentation-system-metrics opentelemetry-sdk oss2 passlib prometheus_client psycopg2-binary python-multipart python-pptx python-socketio selenium tabulate tools uvicorn xmltodict

chapter8/gaia-experience python

测试

pytest
查看全部依赖 (16)

依赖

-e NumPy anthropic black colorama faiss-cpu flake8 jsonlines openai pytest-asyncio python-dotenv pyyaml sentence-transformers tabulate tiktoken tqdm

chapter8/prompt-auto-optimization python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter8/prompt-distillation python

查看全部依赖 (10)

依赖

NumPy accelerate datasets peft torch tqdm transformers trl vllm wandb

chapter8/self-evolution-eval python

测试

pytest
查看全部依赖 (2)

依赖

openai python-dotenv

chapter8/self-evolving-tools python

网络

Requests
查看全部依赖 (3)

依赖

beautifulsoup4 openai python-dotenv

chapter9/controllable-tts python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter9/end-to-end-speech python

网络

Requests
查看全部依赖 (2)

依赖

openai python-dotenv

chapter9/live-audio/backend javascript

测试

Mocha ^10.2.0

网络

Axios ^1.7.5
查看全部依赖 (9)

依赖

emoji-regex ^10.4.0 express ^4.21.1 fluent-ffmpeg ^2.1.3 form-data ^4.0.0 franc ^6.2.0 node-wav ^0.0.2 onnxruntime-node ^1.22.0-rev wav ^1.0.2 ws ^8.18.0

chapter9/live-audio/frontend javascript

框架

Next.js 13.3.0 React 18.2.0

CSS 框架

Tailwind CSS ^3.3.1

代码规范

ESLint 9.30.1
查看全部依赖 (20)

依赖

@radix-ui/react-slot ^1.0.2 @types/node 18.15.11 @types/react 18.0.33 @types/react-dom 18.0.11 class-variance-authority ^0.6.0 clsx ^1.2.1 lucide-react ^0.130.1 react-dom 18.2.0 react-markdown ^9.0.1 react-syntax-highlighter ^15.6.1 remark-gfm ^4.0.0 tailwind-merge ^1.10.0 tailwindcss-animate ^1.0.5 typescript 5.0.4 web-audio-resampler ^1.0.1

开发依赖

@tailwindcss/typography ^0.5.15 autoprefixer ^10.4.14 cross-env ^7.0.3 eslint-config-next 15.3.5 postcss ^8.4.21

chapter9/phone-agent python

查看全部依赖 (2)

依赖

openai python-dotenv

chapter9/streaming-speech python

查看全部依赖 (2)

依赖

openai python-dotenv

评论

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-09 00:50
浙ICP备14020137号-1 $Map of visitor$