ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
# Experiment Layout Conventions
|
||||
|
||||
This is the working convention for cleanup after the `chapter1/context` pilot.
|
||||
It is intentionally small: chapter experiments stay independent teaching
|
||||
projects, and only shared plumbing belongs in `agentbook/`.
|
||||
|
||||
## Target Shape
|
||||
|
||||
Use this shape for runnable Python experiments when it fits the project:
|
||||
|
||||
```text
|
||||
experiment-name/
|
||||
├── README.md
|
||||
├── main.py
|
||||
├── agent.py
|
||||
├── config.py
|
||||
├── fixtures/
|
||||
├── tests/
|
||||
│ └── manual/
|
||||
├── requirements.txt
|
||||
└── env.example
|
||||
```
|
||||
|
||||
Not every experiment needs every file. Prefer the smallest structure that makes
|
||||
the runnable entry point, tests, fixtures, and generated outputs obvious.
|
||||
|
||||
## Entry Points
|
||||
|
||||
- Prefer one documented command-line entry point, usually `main.py`.
|
||||
- Keep helper modules next to the entry point when they are part of the teaching
|
||||
code, for example `agent.py`, `tools.py`, `config.py`, or `sources.py`.
|
||||
- Keep setup helpers at the experiment root only when they are part of normal
|
||||
local use, for example `create_sample_pdf.py`.
|
||||
- Move old quick checks or provider smoke scripts to `tests/manual/` unless they
|
||||
are the primary way readers run the experiment.
|
||||
- Do not move teaching logic into `agentbook/`; shared provider/dependency
|
||||
plumbing can live there.
|
||||
|
||||
## Provider Portability
|
||||
|
||||
- A vendor-specific reference implementation may remain canonical when an
|
||||
experiment measures that exact model or native tool protocol, but ordinary
|
||||
readers should not need that vendor's credential merely to exercise the
|
||||
chapter's mechanism.
|
||||
- Document a provider-portable path when an equivalent endpoint exists. Prefer
|
||||
an explicit base URL, requested model ID, and API-key variable over a hidden
|
||||
fallback. For visual Computer Use, retain at least one open-weight model API
|
||||
path plus a generic self-hosted OpenAI-compatible path.
|
||||
- A fallback model is a separate experimental arm, not a reproduction of the
|
||||
reference model. Store the requested model, provider-reported model, endpoint,
|
||||
raw credential-free response, and behavior evidence for each arm.
|
||||
- Fail closed when an endpoint drops required modalities, schemas, or tools.
|
||||
Successful authentication, model listing, installation, or browser launch is
|
||||
not task-completion evidence.
|
||||
- Never put API-key values in receipts. Record only the environment-variable
|
||||
name used, and scan retained requests/responses before committing evidence.
|
||||
|
||||
## Installation Docs
|
||||
|
||||
- README setup should prefer the root chapter extra, for example
|
||||
`uv sync --locked --python 3.12 --extra chN`.
|
||||
- Activate the root `.venv` before changing into the experiment directory.
|
||||
- Keep the pip fallback: `python -m pip install -e ".[chN]"`.
|
||||
- Keep `python -m pip install -r requirements.txt` as a commented compatibility
|
||||
path while the migration is active.
|
||||
- Document platform-specific or isolated environments explicitly instead of
|
||||
pretending one root extra covers incompatible stacks.
|
||||
|
||||
## Tests
|
||||
|
||||
- Automated regression tests go under `tests/` and should run with
|
||||
`python -m pytest tests` from the experiment directory.
|
||||
- When documenting pytest commands for a clean environment, include the `dev`
|
||||
extra from the repository root, for example
|
||||
`uv sync --locked --python 3.12 --extra chN --extra dev`.
|
||||
- The equivalent pip testing fallback is `python -m pip install -e ".[chN,dev]"`.
|
||||
- Automated tests should avoid live API calls, network dependence, GPU-only
|
||||
paths, and heavyweight model downloads unless they are explicitly marked and
|
||||
isolated.
|
||||
- Use fixtures and mocks for deterministic behavior.
|
||||
- If tests import root-level experiment modules after being moved, add a small
|
||||
`tests/conftest.py` path bootstrap rather than changing user-facing imports.
|
||||
- Manual/live smoke scripts go under `tests/manual/` and should not be named
|
||||
`test_*.py` or `*_test.py`, so pytest does not collect them by default.
|
||||
- Manual scripts should state which API keys or external tools they require.
|
||||
|
||||
## Fixtures
|
||||
|
||||
- Put deterministic local data under `fixtures/`, with subdirectories by type
|
||||
when useful, for example `fixtures/pdfs/`.
|
||||
- Keep tracked fixtures small and stable.
|
||||
- If a helper can regenerate a fixture, document both the helper and the fixture
|
||||
location in the README.
|
||||
- Update code paths and README examples together when moving fixtures.
|
||||
|
||||
## Generated Outputs
|
||||
|
||||
- Do not track normal run outputs unless the file is a deliberate fixture or
|
||||
golden example.
|
||||
- Prefer a documented output directory such as `output/`, `outputs/`, or
|
||||
`results/`, or an explicit `--output PATH` option.
|
||||
- Make generated-output defaults consistent within an experiment before applying
|
||||
that convention to other experiments.
|
||||
- Add or update ignore rules before changing commands that create new output
|
||||
paths.
|
||||
|
||||
## README Checklist
|
||||
|
||||
Each runnable experiment README should answer:
|
||||
|
||||
- What concept does this experiment teach?
|
||||
- What is the one recommended install path?
|
||||
- What is the compatibility install path during migration?
|
||||
- What command runs the default demo?
|
||||
- Which commands are offline/no-key and which need credentials?
|
||||
- Where are tests, fixtures, manual smoke scripts, and generated outputs?
|
||||
- Which platform/system dependencies are separate from Python dependencies?
|
||||
|
||||
## Migration Checklist
|
||||
|
||||
When cleaning an existing experiment:
|
||||
|
||||
- Move the smallest set of files needed to clarify the layout.
|
||||
- Preserve direct execution from the experiment directory.
|
||||
- Rename manual checks away from `test_*.py` if they need live credentials.
|
||||
- Keep automated tests runnable through `python -m pytest tests`.
|
||||
- Update code paths, README commands, and project structure diagrams in the same
|
||||
change.
|
||||
- Run targeted validation for the experiment plus repository docs checks.
|
||||
|
||||
Baseline validation for a layout-only change:
|
||||
|
||||
```bash
|
||||
git diff --check
|
||||
python scripts/check_i18n_consistency.py
|
||||
uv lock --check
|
||||
```
|
||||
|
||||
Then add experiment-specific checks, for example:
|
||||
|
||||
```bash
|
||||
uv sync --locked --python 3.12 --extra chN --extra dev
|
||||
python -m pytest tests
|
||||
python main.py --help
|
||||
python tests/manual/show_sample_tasks.py
|
||||
```
|
||||
@@ -0,0 +1,90 @@
|
||||
# Experiment status and evidence
|
||||
|
||||
This operational record is kept separate from the book README. It tracks the
|
||||
cross-chapter experiments that require special local implementations, evidence
|
||||
gates, external services, or hardware. Cloning a pinned source repository,
|
||||
installing its dependencies, or passing a smoke test does not establish that an
|
||||
experiment is complete.
|
||||
|
||||
Statuses in this file describe evidence retained in the repository. A local
|
||||
checkpoint or run directory that is still untracked is useful work-in-progress,
|
||||
but it does not close the clean-clone audit until a reviewable evidence package
|
||||
is committed.
|
||||
|
||||
Status meanings:
|
||||
|
||||
- **Complete**: the manuscript's execution and evidence gates have substantive
|
||||
saved evidence. A complete experiment may still produce a negative result.
|
||||
- **Incomplete**: some implementation, execution, or evidence gates remain
|
||||
unsatisfied.
|
||||
- **Reader exercise**: completion requires a reader-operated campaign and its
|
||||
retained evidence rather than a repository checkout alone.
|
||||
|
||||
This table is a selective operational ledger, not a second numbered index.
|
||||
Each chapter README remains the authoritative ordered experiment list. The
|
||||
WebRTC phone project is listed as an unnumbered add-on and uses a stable,
|
||||
non-numeric evidence identifier.
|
||||
|
||||
## Tracked experiments
|
||||
|
||||
| Experiment | Track | Current status and evidence |
|
||||
| --- | --- | --- |
|
||||
| 4-1 | External-service acceptance | **Incomplete.** The real MCP catalog covers the public-data, multimodal, and filesystem gates, but Google Calendar and Notion remain blocked by missing authorized credentials. See the [Chapter 4 ledger](../chapter4/EXPERIMENT_LEDGER.md). |
|
||||
| 4-2 | Multimodal comparison | **Complete.** The canonical run compares native vision, extract-to-text, and tool-on-demand processing over the same chart/PDF questions with retained model receipts, latency/usage, tool traces, and an external judge. See the [canonical evidence](../chapter4/multimodal-agent/validation/latest.json). |
|
||||
| 4-3 | External-service acceptance | **Incomplete only at Calendar/email authorization.** The canonical 20-call MCP campaign passes 13/15 gates: core safety, sandboxing, spreadsheet rendering, webhook, headless browser, real GitHub PR mutation, Xvfb Computer Use, and KVM-backed Android execution. Calendar and real email-provider mutations remain unsatisfied, so `official_complete` stays false. See the [canonical manifest](../chapter4/execution-tools/validation/experiment_4_3/real_mcp_gui_20260802T093657Z/manifest.json). |
|
||||
| 4-4 | Human/external-channel acceptance | **Incomplete only at real notification delivery.** The canonical run retains a live repository-user decision on the same pending MCP request, a separate conservative timeout, six real Kimi K3 receipts, 55 MCP calls, and 61 verified manifest files. Email, Telegram, and Slack remain unconfigured and are not simulated, so `official_complete` stays false. See the [Chapter 4 ledger](../chapter4/EXPERIMENT_LEDGER.md). |
|
||||
| 4-5 | Active tool discovery | **Complete; accuracy uplift not observed.** The 126-tool campaign completed both control and active-discovery arms with 3/3 task success in each arm. Active discovery reduced exposed schema text and elapsed time, while retained detours and malformed actions remain visible. See the [Chapter 4 ledger](../chapter4/EXPERIMENT_LEDGER.md). |
|
||||
| 5-12 | Local implementation | **Incomplete.** The PEDO core, deterministic PostgreSQL demo, and tests are included in [the companion project](../chapter5/permission-embedded-data-objects/). The optional live Agent-generated-code campaign has not been run as a canonical evidence package. |
|
||||
| 5-13 | Local experiment | **Complete; strict joint-advantage hypothesis not observed.** Both Agent-creation arms passed their acceptance gates. The [formal comparison](../chapter5/agent-creator/runs/exp5-12-kimi-k3-20260730-v1/comparison.json) found equal deterministic quality and greater template-arm efficiency, but not strictly higher quality and efficiency together. |
|
||||
| 6-1 | External mailbox experiment | **Incomplete.** The Unipile credential probe returned 401 before mailbox mutation, so the three required real inbound-mail cases have not run. See the [project evidence](../chapter6/agent-with-event-trigger/validation/experiment_6_1/). |
|
||||
| 6-2 | Interruptible asynchronous Agent | **Complete.** All four manuscript scenarios passed with real subprocesses: non-blocking work, queued instruction integration, interruption and recovery, and progress-aware cancellation. See the [canonical summary](../chapter6/async-agent/validation/experiment_6_2/real_subprocess_20260730T052500Z/summary.json). |
|
||||
| 附加 | Local WebRTC speech project | **Complete.** Direct and ReAct arms each pass 20/20 gates over browser-microphone RTP, local Whisper, a real external LLM, TTS, and downlink RTP. PSTN/E.164 is outside the manuscript's local call-user gate. See the [stable-ID manifest](../chapter6/phone-agent/validation/runs/phone-agent-webrtc-audio-20260731-v1/manifest.json). |
|
||||
| 6-5 | Local omni-speech experiment | **Complete; the two paths tie overall with complementary failures.** Pinned MiniCPM-o 4.5 ran locally on one RTX PRO 6000. Native end-to-end and same-model self-cascade each scored 3/4: self-cascade fixed one semantic perception error, while end-to-end preserved speaking-rate evidence erased by the transcript. The [canonical evidence](../chapter6/end-to-end-speech/validation/runs/exp6-5-minicpmo45-20260801-v1/evidence.json) also retains a real 24kHz speech output and passes all acceptance checks. |
|
||||
| 6-6 | Local controllable-TTS experiment | **Complete; the full subjective ordering was not reproduced.** Fish Audio S1 produced the 24-reference library and A/B/C media, and three position-balanced Voxtral listening passes rated the multi-reference arm highest. C > B > A did not reproduce because A outscored B. See the [acceptance evidence](../chapter6/controllable-tts/validation/acceptance.json). |
|
||||
| 6-7 | External reference implementation | **Complete for the bounded read-only task.** The official source and Dockerfile were pinned, the image was built locally with retained image/base digests, and Anthropic returned the requested `claude-sonnet-4-5-20250929` on 16/16 calls. The Agent executed 15 native `computer` actions, did not interact with Google reCAPTCHA, recovered through visible Open-Meteo JSON, and reported 70.2°F / clear sky with `end_turn`. The [canonical acceptance](../chapter6/claude-computer-use-native/validation/runs/exp6-7-anthropic-native-20260803-v2/acceptance.json) passes every source, receipt, action, screenshot, grounding, safety, hash, and credential gate; the historical 401 and two failed task attempts remain separately retained. |
|
||||
| 6-8 | Provider-portable Computer Use | **Complete on the open-model arm.** OpenRouter returned `qwen/qwen3-vl-32b-instruct` for 16/16 real calls; the Agent recovered from a Google CAPTCHA through weather.com and completed in 16 one-action steps. The [canonical evidence](../chapter6/computer-use-open-model/validation/latest.json) retains 15 screenshots, raw responses, the action trajectory, deterministic answer grounding, hashes, and a clean credential scan. |
|
||||
| 6-9 | External hardware track | **Incomplete.** The XLeRobot source and non-actuating preflight are pinned, but no authorized physical teleoperation or book task has run. See the [experiment record](../chapter6/xlerobot-teleoperation/README.md). |
|
||||
| 6-11 | External API and hardware track | **Incomplete.** The exact Gemini Robotics-ER request failed authentication and no robot navigation occurred. A successful planning response, authorized navigation run, and the remaining evidence gates are still required. See the [experiment record](../chapter6/gemini-xlerobot-navigation/README.md). |
|
||||
| 6-13 | External Sim2Real track | **Incomplete.** No local ManiSkill environment, RGB-only PPO checkpoint, >90% simulation evaluation, or real deployment exists. Stages 1–2 require real-scene hardware inputs, stages 3–4 require a suitable GPU environment, and stage 5 requires authorized SO-100 actuation. See the [experiment record](../chapter6/rgb-sim2real-grasping/README.md). |
|
||||
| 7-1 | External benchmark execution | **Complete for the manuscript's bounded five-task campaign.** The pinned τ²-bench telecom run scored 4/5 (Pass@1 0.80), retained all raw trajectories and costs, and traces the failed task to a phone/line mismatch that skipped the required data refuel. Upstream format and trial-count verification pass; full-domain task coverage is explicitly outside this bounded claim. See the [manifest](../chapter7/tau2-bench-eval/validation/runs/exp7-1-openrouter-gpt41mini-telecom-20260802-v1/manifest.json). |
|
||||
| 7-2 | Human benchmark | **Complete.** The retained case set covers easy, medium, and hard tasks from GAIA, AndroidWorld, SWE-bench Verified, τ²-bench, Terminal-Bench, and OSWorld-Verified, with 18/18 first-run trajectories and official verification outcomes. See the [completed case set](../chapter7/experiment-7-2-human-benchmark/README.md). |
|
||||
| 7-3 | Local implementation | **Complete.** The four-grade memory rubric has 60 cases and 180/180 structured judgments with full scope in the [saved evidence](../chapter7/user-memory-system-evaluation/results/full_7_3_structured_rubric_evidence.json). |
|
||||
| 7-4 | Local experiment | **Complete.** JSON Cards, RAG, and hybrid systems produced 180/180 real trajectories across 60 cases, with complete cost and failure analysis in the [saved campaign](../chapter7/user-memory-system-evaluation/results/full_7_4_60_cases_costed.json). |
|
||||
| 7-5 | Local experiment | **Complete.** The known-memory trajectory-prefix campaign ran 33/33 real OpenRouter cells (11 production bad cases × JSON/Markdown/Python-like encodings), with zero API errors and 6/11 deterministic policy passes for each encoding. See the [manifest](../chapter7/user-memory-policy-eval/results/manifest.json) and [report](../chapter7/user-memory-policy-eval/results/policy_prefix_live.json). |
|
||||
| 7-6 | Local experiment | **Complete.** The neutral TTS campaign retained 8/8 content-hashed OpenAI/Fish cells and direct-audio Voxtral judgments across four challenge categories. See the [Chapter 7 ledger](../chapter7/EXPERIMENT_LEDGER.md). |
|
||||
| 7-7 | Local experiment | **Complete.** The Arena Elo/Bradley–Terry campaign processed 1,799,991 public records, retained rankings, matrices, snapshots, plots, and an independently passing manifest. See the [Chapter 7 ledger](../chapter7/EXPERIMENT_LEDGER.md). |
|
||||
| 7-8 | Local experiment | **Complete.** The neutral Coding Harness campaign retained 18/18 cells (two models × three tasks × three trials), zero API errors, full trajectories, summaries, and verified artifact hashes in the [manifest](../chapter7/model-action-threshold/results/exp7-8-action-threshold-20260731-v1/manifest.json). |
|
||||
| 7-9 | Local experiment | **Complete.** The eight-turn Agent cost campaign retains four real token/cache/latency arms and the measured KV-cache/context-compression comparison. See the [Chapter 7 ledger](../chapter7/EXPERIMENT_LEDGER.md). |
|
||||
| 7-10 | Long-running provider benchmark | **Incomplete.** The runner and analyzer exist, but retained evidence contains only 29 smoke/readiness observations: no standard N=100 cells, rate ramp, Agent-cost phase, or 168-hour availability campaign. See the [Chapter 7 ledger](../chapter7/EXPERIMENT_LEDGER.md). |
|
||||
| 7-11 | Local experiment | **Complete.** The full 4 × 3 × 2 × 60 matrix retained 1,440/1,440 real trajectories with zero errors or unpriced usage, complete retrieval/task metrics and factorial analysis, and an independently passing verifier. See the [canonical matrix](../chapter7/user-memory-system-evaluation/results/full_7_11_60_case_matrix.json). |
|
||||
| 7-12 | Emulator evaluation | **Complete evidence; deployment not approved.** The [canonical evidence](../chapter7/android-world/validation/candidate_h5c_api33_local_qwen_20260804/evidence.json) retains all 580/580 unique episodes (116 tasks × five trials), including evaluator failures, with zero runtime errors: 26 strict T3A successes (4.4828%) and mean evaluator reward 0.133621, comprising 77 full-reward states plus one `0.5` partial reward. The completed official Pixel 6/API-33 setup had all 24/24 required apps and ran local Qwen2.5-7B revision `a09a35458c702b33eeacc393d103063234e8bc28` via vLLM 0.19.0 on an RTX PRO 6000 Blackwell 96 GB. Candidate Qwen differs from the paired-source Doubao model, so the result establishes neither same-model uplift nor noninferiority. |
|
||||
| 7-13 | Simulation evaluation | **Complete; action chunking improves a low-success policy.** Pinned OpenVLA-OFT and RoboTwin2 ran two real single-GPU `val_only` arms of 256 episodes each with three RGB views and 14-D proprio/action evidence. Chunk 1 scored 0/256 and chunk 25 scored 26/256 (13/128 IID and 13/128 OOD), a paired +10.15625 pp result. All 486 failures have evidence-backed timeout classifications; the [manifest](../chapter7/openvla-robotwin2-eval/validation/runs/exp7-13-localgpu-20260803-v1/manifest.json) binds 512 rollout-video hashes and passes the strict retained-package verifier. |
|
||||
| 8-6 | Local speech training experiment | **Complete (bounded campaign).** Orpheus and Sesame LoRAs were each trained for 60 optimizer steps on the local RTX PRO 6000, evaluated on held-out examples, and compared against their base arms with 40 retained WAVs. Full adapter identities, hashes, automatic proxy results, and failures are in the [strict report](../chapter8/speech-sft-experiment/validation/exp8-6-20260804-v1/REPORT.md). |
|
||||
| 8-7 | Local multilingual training experiment | **Incomplete.** The SFT implementation exists, but the repository retains no checkpoint or before/after multilingual benchmark. See the [Chapter 8 ledger](../chapter8/EXPERIMENT_LEDGER.md). |
|
||||
| 8-8 | Local training experiment | **Complete.** The retained campaign contains 160/160 training and 80/80 held-out Kimi K3 teacher receipts, a real CUDA-trained SmolLM2-135M-Instruct LoRA checkpoint, and the paired comparison in [`validation/exp8-8-kimi3-smollm2-20260730/`](../chapter8/prompt-distillation/validation/exp8-8-kimi3-smollm2-20260730/). Held-out results: teacher 100%, baseline 0%, trained 95%; ~197× latency speedup; ~75% input-token reduction. All eight evidence gates pass. |
|
||||
| 8-9 | Local training experiment | **Complete; the distillation uplift hypothesis was not supported.** All 24 Kimi K3 teacher cases now retain completed trajectories: 23 passed the deterministic answer verifier and entered SFT, while `aime-2016-9-I` completed under native low-reasoning control with the wrong answer and was correctly rejected. Real CUDA training produced a Qwen2.5-1.5B-Instruct LoRA checkpoint in [`checkpoints/exp8-9-qwen25-1.5b-kimi-k3-20260801-v1/`](../chapter8/cot-distillation/checkpoints/exp8-9-qwen25-1.5b-kimi-k3-20260801-v1/). The [completed three-arm report](../chapter8/cot-distillation/validation/experiment_8_9_complete_20260803_v2.json) records baseline 1/24, student 2/24, teacher 23/24, and nonsignificant paired improvement (p=1.0). |
|
||||
| 8-11–8-16 | External training reproductions | **Incomplete.** The GeneralPoints, V-IRL, SimpleVLA-RL, RLVP, ReTool, and AWorld sources/entrypoints are mapped to varying degrees, but none has a retained full training-and-evaluation campaign satisfying its manuscript gate. See the [Chapter 8 ledger](../chapter8/EXPERIMENT_LEDGER.md). |
|
||||
| 9-8 | External-repository self-evolution experiment | **Complete for the autonomous, review-driven self-update loop; downstream benefit not evaluated.** Pinned Hermes received all ten English chapters and its own source without any supplied candidate gap. It independently chose to add evidence-backed learning signals to persisted trajectories. Three fresh terminal-review rejections were fed back to the original Hermes proposer session; it corrected production-format parsing, persistence-path coverage, and counting-consistency defects until a fourth fresh reviewer returned `VERDICT: ACCEPT`. The accepted patch passes 6 new plus 38 existing focused tests and clean-clone application, but remains unmerged; the proposed downstream ablation campaign was not run. See the [credential-free manifest](../chapter9/hermes-self-evolution/validation/exp9-8-hermes-gpt56luna-autonomous-20260802-v2/manifest.json). |
|
||||
| 9-9 | Longitudinal continual-evolution evaluation | **Complete.** The static, append-only, and evolving arms ran 3 seeds × 14 ordered tasks (126 real model calls). The retained evidence separates transfer, rule replacement, retention, obsolete-rule citation, and paired statistics; only the evolving arm replaces the obsolete 20 kg rule and retains the current 23 kg rule. See the [canonical evidence](../chapter9/self-evolution-eval/validation/latest.json). |
|
||||
| 10-1 | Local architecture comparison | **Complete (bounded comparison).** The repaired Skill arm enforces `load_skill("triage")` before specialist tools while keeping the fixed schema prefix. The canonical v2 campaign retains 30 paired tasks, 12 boundary trajectories, 289 provider receipts, 31 real Tavily receipts, and 60 position-swapped independent judge receipts. Skill passes 15/30 deterministic gates versus Transfer 2/30; Skill is slower and uses more uncached input in this model/configuration. See the [acceptance manifest](../chapter10/multi-role-transfer/validation/comparison/runs/exp10-1-qwen35flash-20260809-v2/manifest.json) and [report](../chapter10/multi-role-transfer/validation/comparison/runs/exp10-1-qwen35flash-20260809-v2/REPORT.md). |
|
||||
| 10-2 | Local multi-agent comparison | **Complete.** The four-role Manager and single-Agent arms translated all 26 units of the retained illustrated/code-heavy technical-book sample, with 12/12 acceptance gates and complete quality, context, token, latency, and resource comparisons. See the [canonical index](../chapter10/book-translation/validation/latest.json). |
|
||||
| 10-3 | External concurrent-agent reproduction | **Complete for the retained Anthropic-caller configuration.** The pinned TalkAct campaign retains 16/16 episodes with no runtime/provider errors and passes all 17 gates. Duplex and strawman tie at 1.0 task success; duplex improves median voice latency from 12.52 s to 2.32 s (5.40×), but strawman has higher probe correctness and lower mean wall time. The invalid Gemini credential required TalkAct's supported Anthropic Sonnet caller override, so this same-family configuration must not be silently pooled with upstream default-Gemini results. See the [acceptance report](../chapter10/talkact-reproduction/validation/runs/exp10-3-talkact-anthropic-caller-20260803-v2/acceptance.json). |
|
||||
| 10-3 | Local WebRTC orchestration experiment | **Complete.** A real LLM autonomously selected the Phone Agent; Playwright, bidirectional RTP, local TTS/Whisper, validation/re-asking, concurrent ask/fill, and one localhost submission pass all 9 gates. PSTN/E.164 is not required by the manuscript. See the [manifest](../chapter10/autonomous-phone-registration/validation/runs/exp10-3-webrtc-raw-20260731-v4/manifest.json). |
|
||||
| 10-5 | External generative-agents reproduction | **Complete; the custom-event diffusion hypothesis was not supported.** The exact pinned 25-persona society completed three 17,280-step, two-virtual-day arms with 148,856 canonical provider receipts and zero logical errors. The custom climate workshop remained limited to its originator, while disabling reflection produced zero evidence-linked reflection thoughts and reduced all four blind plausibility scores; baseline was preferred for 17/25 personas. All 14 gates pass in the [canonical acceptance report](../chapter10/generative-agents/validation/runs/exp10-5-qwen37flash-20260804-v1/acceptance.json). |
|
||||
| 10-6 | Local voice multi-agent experiment | **Complete.** One retained eight-seat v11 game completed three night/day/vote cycles and passed every gate in the same report: six real LLM-tool → macOS `say` → OpenRouter native-audio ASR round trips with exact action agreement, information isolation, a rule-determined winner, and all four strategy criteria. The report retains 13 unique response IDs, 1,650 audio-input tokens, 27 positive-byte TTS events, action history, usage, audio hashes, and judge-attempt provenance; the independent validator rechecked all six audio/action boundaries. See the [canonical report](../chapter10/voice-werewolf/validation/runs/exp10-6-simulated-user-openrouter-20260803-v11/acceptance_report.json). |
|
||||
|
||||
## Detailed ledgers
|
||||
|
||||
The chapter ledgers are the canonical detailed records for acceptance scope,
|
||||
saved evidence, and audit findings:
|
||||
|
||||
- [Chapter 1 experiment ledger](../chapter1/EXPERIMENT_LEDGER.md)
|
||||
- [Chapter 2 experiment ledger](../chapter2/EXPERIMENT_LEDGER.md)
|
||||
- [Chapter 3 experiment ledger](../chapter3/EXPERIMENT_LEDGER.md)
|
||||
- [Chapter 4 experiment ledger](../chapter4/EXPERIMENT_LEDGER.md)
|
||||
- [Chapter 5 experiment ledger](../chapter5/EXPERIMENT_LEDGER.md)
|
||||
- [Chapter 7 experiment coverage ledger](../chapter7/EXPERIMENT_LEDGER.md)
|
||||
- [Chapter 8 experiment coverage ledger](../chapter8/EXPERIMENT_LEDGER.md)
|
||||
|
||||
Update this summary whenever one of the tracked completion gates changes. Git
|
||||
history provides the status change log.
|
||||
@@ -0,0 +1,3 @@
|
||||
# This file has moved
|
||||
|
||||
The English "Learning Suggestions" doc now lives at [en/LEARNING.md](en/LEARNING.md).
|
||||
@@ -0,0 +1,3 @@
|
||||
# このファイルは移動しました
|
||||
|
||||
日本語版「学習のヒント」ドキュメントは [ja/LEARNING.md](ja/LEARNING.md) に移動しました。
|
||||
@@ -0,0 +1,3 @@
|
||||
# 이 파일은 이동했습니다
|
||||
|
||||
한국어판 「학습 가이드」 문서는 [ko/LEARNING.md](ko/LEARNING.md)로 이동했습니다.
|
||||
@@ -0,0 +1,3 @@
|
||||
# 此文件已移动
|
||||
|
||||
中文版「学习建议」现在位于 [zh-CN/LEARNING.md](zh-CN/LEARNING.md)。
|
||||
@@ -0,0 +1,3 @@
|
||||
# இந்தக் கோப்பு நகர்த்தப்பட்டது
|
||||
|
||||
தமிழ் "கற்றல் பரிந்துரைகள்" ஆவணம் இப்போது [ta/LEARNING.md](ta/LEARNING.md) இல் உள்ளது.
|
||||
@@ -0,0 +1,3 @@
|
||||
# Bu dosya taşındı
|
||||
|
||||
Türkçe "Öğrenme Önerileri" belgesi artık [tr/LEARNING.md](tr/LEARNING.md) adresinde bulunuyor.
|
||||
@@ -0,0 +1,3 @@
|
||||
# Tệp này đã được di chuyển
|
||||
|
||||
Tài liệu "Gợi ý học tập" tiếng Việt hiện nằm tại [vi/LEARNING.md](vi/LEARNING.md).
|
||||
@@ -0,0 +1,3 @@
|
||||
# 此檔案已移動
|
||||
|
||||
繁體中文(台灣)「學習建議」現在位於 [zh-TW/LEARNING.md](zh-TW/LEARNING.md)。
|
||||
@@ -0,0 +1,64 @@
|
||||
# Static-site navigation localization
|
||||
|
||||
The website publishes every book edition in one MkDocs build. Because
|
||||
Material for MkDocs accepts only one `theme.language` for that build, the
|
||||
canonical HTML chrome is generated in Chinese and localized in the browser for
|
||||
translated book URLs.
|
||||
|
||||
## Sources of truth
|
||||
|
||||
- `mkdocs.yml` defines the available languages, URL prefixes, filename
|
||||
suffixes, and the canonical Chinese navigation tree.
|
||||
- `extras/site-nav-i18n.json` translates that navigation tree plus the two
|
||||
custom controls (sidebar and color mode).
|
||||
- Material for MkDocs supplies standard UI translations for search, page
|
||||
actions, table of contents, footer links, repository links, and revision
|
||||
labels. A language can correct an upstream value with `ui_overrides` in
|
||||
`extras/site-nav-i18n.json`.
|
||||
- `scripts/site_i18n.py` validates and combines those sources. During a site
|
||||
build it generates `_web/extras/site-i18n.generated.js`; never edit that
|
||||
generated file.
|
||||
|
||||
`extras/lang-switcher.js` applies the resulting catalog to desktop and mobile
|
||||
navigation, the right-hand table of contents, search (including results added
|
||||
after page load), tooltips, page actions, footer controls, color-mode controls,
|
||||
revision dates, accessibility labels, and right-to-left document direction.
|
||||
|
||||
## Adding or changing a language
|
||||
|
||||
1. Add or update the language entry under `extra.languages` in `mkdocs.yml`.
|
||||
2. Ensure the translated book uses the URL contract represented by that entry:
|
||||
`introduction`, `chapter1` through `chapter10`, `afterword`, and
|
||||
`reference-answers`, with its configured filename suffix.
|
||||
3. Add the same language code to `extras/site-nav-i18n.json`. Translate every
|
||||
key under `nav`, `sidebar`, and `palette`; set `material_locale` to a locale
|
||||
shipped by Material for MkDocs.
|
||||
4. If translated `chapterN/README.<locale>.md` experiment indexes exist, set
|
||||
`readmeSuffix` in `mkdocs.yml`. Omit it while they do not exist: the site
|
||||
will hide that unavailable sub-navigation instead of creating a broken or
|
||||
wrong-language link.
|
||||
5. Run the audit:
|
||||
|
||||
```bash
|
||||
pip install -r requirements-docs.txt
|
||||
python scripts/site_i18n.py
|
||||
```
|
||||
|
||||
6. Assemble and build the site normally. The MkDocs hook runs the audit again
|
||||
and refuses to build if the catalog has drifted.
|
||||
|
||||
## What the audit prevents
|
||||
|
||||
The check automatically discovers languages and named navigation entries from
|
||||
`mkdocs.yml`. It fails when:
|
||||
|
||||
- a configured language is absent from the UI catalog, or an obsolete catalog
|
||||
entry remains;
|
||||
- any navigation or custom-control translation is missing or empty;
|
||||
- Chinese text remains in a non-CJK custom catalog;
|
||||
- the selected Material locale or a required Material UI string is missing;
|
||||
- a book URL or translated experiment-index URL generated by the switcher has
|
||||
no corresponding Markdown source.
|
||||
|
||||
The `i18n consistency check` GitHub Actions workflow runs this audit whenever
|
||||
site configuration, translated books, navigation code, or the catalog changes.
|
||||
@@ -0,0 +1,54 @@
|
||||
# اقتراحات التعلم
|
||||
|
||||
← [العودة إلى الملف التمهيدي الرئيسي](README.md)
|
||||
|
||||
|
||||
## المفهوم الأساسي: الوكيل = النموذج + السياق + الأدوات
|
||||
|
||||
الإطار الأساسي لهذا الكتاب هو **الوكيل = النموذج + السياق + الأدوات**. تتعاون هذه المكونات الثلاثة لتحقيق السلوك الذكي للوكيل:
|
||||
|
||||
- **النموذج**: عقل الوكيل، ويوفر قدرات الفهم والاستدلال واتخاذ القرار.
|
||||
- **السياق**: نظام التشغيل للوكيل، يحتوي على تعليمات النظام، تاريخ المحادثات، عمليات التفكير، سجلات تفاعل الأدوات، إلخ.
|
||||
- **الأدوات**: يدا الوكيل، وتمكّنانه من إدراك البيئة وتنفيذ الأفعال والتفاعل مع العالم الخارجي.
|
||||
|
||||
## مسار التعلم
|
||||
|
||||
يتوافق مسار التعلم فصلاً تلو الآخر مع الكتاب بأكمله، ويتكشف طبقة بعد طبقة حول الركائز الثلاث:
|
||||
|
||||
- **الفصل الأول · الأسس**: بناء إطار معرفي متكامل لأنظمة الوكلاء؛ بدءًا من تعريف الوكيل في التعلم المعزز، مرورًا بمقارنة كفاءة العينات بين نماذج التعلم المعزز التقليدية ونماذج LLM+RL، وصولًا إلى فهم نموذج «النموذج بوصفه وكيلًا» وإتقان الصيغة الأساسية **الوكيل = النموذج + السياق + الأدوات**. **الفكرة الأساسية**: قد تفوق أهمية المعرفة المسبقة أهمية الخوارزميات والبيئات.
|
||||
|
||||
- **الفصلان 2 و3 · السياق**: السياق هو نظام تشغيل الوكيل. يغطي الفصل الثاني تعليمات النظام، والتصميم الملائم لذاكرة KV المخبأة، وضغط السياق، ودراسات الاستئصال لهندسة الموجّهات. ويغطي الفصل الثالث ذاكرة المستخدم، والاسترجاع الكثيف والمتناثر والهجين، وRAG القائم على الوكلاء، والاسترجاع المدرك للسياق، واستخراج المعرفة المنظمة. **الفكرة الأساسية**: يشمل السياق الكامل تعليمات النظام، وسجل الحوار، وعمليات الاستدلال، وسجلات تفاعل الأدوات، وذاكرة المستخدم، والمعرفة الخارجية.
|
||||
|
||||
- **الفصلان 4 و5 · الأدوات**: الأدوات هي الجسر الذي يتفاعل الوكيل عبره مع العالم. يغطي الفصل الرابع ثلاثة أنواع من أدوات MCP (الإدراك والتنفيذ والتعاون)، وتشغيل الأحداث، والبنى غير المتزامنة. ويتعمق الفصل الخامس في تنفيذ وكيل برمجة متكامل بمستوى إنتاجي. **الفكرة الأساسية**: ينبغي تصميم الأدوات لتكون عامة؛ فمفسر الأكواد أوسع قدرةً من آلة حاسبة، والكود قدرة فوقية تتيح إنشاء أدوات جديدة.
|
||||
|
||||
- **الفصلان 6 و7 · النموذج**: كيفية قياس الذكاء وتعزيزه. يغطي الفصل السادس معايير مثل Terminal-Bench وSWE-bench وGAIA وOSWorld وTau2-Bench. ويغطي الفصل السابع تقنيات ما بعد التدريب، ومنها SFT وRL وRLHF وكفاءة العينات. **الفكرة الأساسية**: إشارة التحقق المستقلة أوثق من مجرد «مطالبة النموذج بالتفكير مرة أخرى»، ويتعلم «النموذج بوصفه وكيلًا» استدعاء الأدوات كقدرة أصيلة عبر التعلم المعزز.
|
||||
|
||||
- **الفصل الثامن · التطور الذاتي**: تمكين الوكلاء من النمو بالخبرة دون تغيير الأوزان؛ من التعلم من التجارب، إلى تحويل مسارات العمل إلى أدوات، ثم تقطير الموجّهات والملاحظات داخل المعلمات. **الفكرة الأساسية**: التعلم من الخبرة هو مفتاح انتقال الوكيل من «الذكاء» إلى «المهارة».
|
||||
|
||||
- **الفصلان 9 و10 · التوسع والتعاون**: يوسّع الفصل التاسع الإدراك والعمل من النص إلى الصوت وواجهات المستخدم الرسومية والعالم المادي. ويستخدم الفصل العاشر تقسيم العمل بين عدة وكلاء للتعامل مع المهام المعقدة. **الفكرة الأساسية**: لكل قرار تصميم في نظام متعدد الوكلاء نظير ضمن العناصر الثلاثة للوكيل الواحد.
|
||||
|
||||
## تقسيم العمل بين النص والتجارب
|
||||
|
||||
الكتاب ليس برنامجًا تعليميًا خطوة بخطوة لـ SDK واحد. يوضح pseudocode والهياكل القصيرة تدفق الحالة ونقاط التوقف وحدود التحقق؛ أما تجارب الفصول فتقدم التنفيذ والمحولات والاختبارات والسجلات والأدلة.
|
||||
|
||||
| الطبقة | اقرأ أولًا | تخطَّ مؤقتًا | السؤال الذي تجيب عنه |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | README المشروع: الهدف، والأمر الأدنى، وشروط القبول؛ وskeleton المقابل في النص | بيانات الاعتماد وواجهة المستخدم ومحوّلات المزوّدين والسجلات الخام الطويلة | ما الآلية التي يُفترض أن تثبتها التجربة؟ |
|
||||
| **Builder** | نقطة الدخول والحلقة الأساسية ومخطط الحالة/الرسائل والأدوات وأداة التحقق | طبقات التوافق والنشر غير المرتبطة بالآلية | أي متغير غيّر السلوك؟ |
|
||||
| **Maintainer** | الاختبارات ومعالجة الأعطال وتنسيق الأدلة وmanifest/hash ومسار التراجع | تفاصيل الأطراف الثالثة اللازمة فقط عند تعديل التجربة | هل يمكن إعادة إنتاج النتيجة وهل سُجلت الأعطال بصدق؟ |
|
||||
|
||||
## مستويات الصعوبة
|
||||
|
||||
- **المبتدئ** (الفصول 1-2): مناسب للمبتدئين الذين يفهمون المفاهيم الأساسية.
|
||||
- **المستوى المتوسط** (الفصول 3-4): يتطلب بعض أسس البرمجة، ويتضمن تكامل النظام.
|
||||
- **المتقدم** (الفصلان 5 و6): يتطلب مهارات برمجية قوية، ويتناول تصميم منظومات معقدة.
|
||||
- **الخبير** (الفصلان 7 و8): يتطلب معرفة بالتعلم العميق وتدريب النماذج أو خبرة بالتطور الذاتي.
|
||||
- **التطبيقي** (الفصلان 9 و10): يجمع المعارف السابقة لبناء تطبيقات عملية متكاملة.
|
||||
|
||||
## اقتراحات عملية
|
||||
|
||||
1. **التدريب العملي**: صُمم كل مشروع ليعمل مستقلًا؛ شغّل الشفرة وعدّلها بنفسك.
|
||||
2. **اربط التطبيق بالكتاب**: اقرأ الفصل المقابل في [`book-ar/`](../../book-ar/) بالعربية أو في [`book/`](../../book/) بالصينية لفهم الصلة بين النظرية والتطبيق.
|
||||
3. **المقارنة التجريبية**: تتضمن مشاريع كثيرة دراسات استئصال وتجارب مقارنة؛ استخدمها لتعميق فهمك.
|
||||
4. **التعلم التقدمي**: ابدأ بمشروعات بسيطة ثم انتقل تدريجيًا إلى الأنظمة المعقدة.
|
||||
5. **التركيز على البروتوكولات**: يوضح مشروع خادم MCP في الفصل الرابع بروتوكولات الأدوات القياسية، وهي أساس مهم لبناء وكلاء قابلين للتوسع.
|
||||
@@ -0,0 +1,171 @@
|
||||
# فهم وكلاء الذكاء الاصطناعي بعمق: مبادئ التصميم والممارسة الهندسية
|
||||
|
||||
[](#-الكتاب-الإلكتروني) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-الكتاب-الإلكتروني)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · العربية ← الحالية · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> **ملاحظة حول الترجمة:** هذه ترجمة عربية كاملة، خضعت لمراجعة تحريرية وتقنية شملت سلامة المعنى، وطبيعية الأسلوب، واتساق المصطلحات، وبنية النص والرسوم.
|
||||
>
|
||||
> 📥 **[تنزيل PDF / EPUB](#-الكتاب-الإلكتروني)** (موصى به) — توفر نسختا PDF وEPUB أفضل تجربة قراءة؛ ويمكنك أيضًا [القراءة عبر الإنترنت](https://bojieli.github.io/ai-agent-book/) مع تبديل اللغات وشجرة الفصول والبحث في النص الكامل.
|
||||
|
||||
**الوكيل = LLM + السياق + الأدوات** — تنظم هذه المعادلة فصول الكتاب العشرة، التي تنتقل من المبادئ إلى الممارسة الهندسية. والنص الكامل والرسوم و**93 تجربة مصاحبة** كلها مفتوحة المصدر، ويمكنك تشغيل التجارب بنفسك.
|
||||
|
||||
> 📢 **ما الذي تغيّر في الإصدار 2.0 مقارنةً بـ 1.4؟** يدمج الإصدار 2.0 قسم «التفاعل غير المتزامن» من الفصل الرابع السابق مع المحتوى المتعلق بـ«الوكلاء متعددي الوسائط» من الفصل التاسع السابق، ويعيد تنظيمهما في الفصل السادس الجديد «التفاعل: توسيع فضاء الملاحظة وفضاء الفعل». أما الفصول السابقة: السادس «تقييم الوكلاء»، والسابع «مرحلة ما بعد تدريب النموذج»، والثامن «التطور المستمر للوكلاء»، فقد أُزيح كل منها فصلًا واحدًا لتصبح الآن الفصول السابع والثامن والتاسع على التوالي.
|
||||
>
|
||||
> إذا كنت تقرأ نسخة PDF قديمة، فننصحك بـ[تنزيل أحدث نسخة PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf). تتضمن الطبعة الجديدة أيضًا تصحيحات وتعديلات عديدة في المحتوى، لذا يُرجى اعتماد أحدث نسخة.
|
||||
|
||||
| 📚 **10 فصول** من الأساسيات إلى الإنتاج | 📂 **93** مشروعًا مصاحبًا (أكثر من 70 مستقلاً) | 🌐 **14 لغة**: CN / EN / ES / ID / AR / zh-TW / RU / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 الكتاب الإلكتروني
|
||||
|
||||
> 📥 **تنزيل** (موصى به؛ نص كامل، مجاني ومفتوح المصدر). تشير هذه الروابط دائمًا إلى أحدث إصدار لفرع `main`؛ الإصدارات الثابتة موجودة في صفحة [الإصدارات](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **الصينية (الأصل)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **الإنجليزية** (ترجمة المجتمع، بواسطة [@nsdevaraj](https://github.com/nsdevaraj) و[@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **الإسبانية** (ترجمة المجتمع، بواسطة [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **الصينية التقليدية (تايوان)** (ترجمة المجتمع، بواسطة [@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **الروسية** (ترجمة المجتمع، بواسطة [@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **التاميلية** (ترجمة المجتمع، بواسطة [@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **الفيتنامية** (ترجمة المجتمع، بواسطة [@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **اليابانية** (ترجمة المجتمع، بواسطة [@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **العربية** (ترجمة مجتمعية بواسطة [@TheSyBuilder](https://github.com/TheSyBuilder) — النسخة الحالية): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **التركية** (ترجمة المجتمع، بواسطة [@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **الكورية** (ترجمة المجتمع، بواسطة [@JeongJaeSoon](https://github.com/JeongJaeSoon)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 يمكنك أيضًا [القراءة عبر الإنترنت](https://bojieli.github.io/ai-agent-book/) عبر واجهة متعددة اللغات، وشجرة فصول قابلة للطي، وبحث في النص الكامل، وروابط مباشرة للتجارب المصاحبة. ويُعاد بناء الموقع تلقائيًا عند كل دفع إلى الفرع `main`.
|
||||
|
||||
يوجد المصدر الصيني في [`book/`](../../book/)، وتوجد النسخة العربية الحالية في [`book-ar/`](../../book-ar/). أما النسخ الإنجليزية والإسبانية والصينية التقليدية والروسية والتاميلية والفيتنامية واليابانية والتركية والكورية فهي مساهمات مجتمعية قد تتأخر عن الأصل الصيني، وتوجد في [`book-en/`](../../book-en/)، و[`book-es/`](../../book-es/)، و[`book-zhtw/`](../../book-zhtw/)، و[`book-ru/`](../../book-ru/)، و[`book-ta/`](../../book-ta/)، و[`book-vi/`](../../book-vi/)، و[`book-ja/`](../../book-ja/)، و[`book-tr/`](../../book-tr/)، و[`book-ko/`](../../book-ko/) على الترتيب.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 بناء ملفات PDF / EPUB محليًا</b> (يتطلب PDF أدوات pandoc وxelatex وElegantBook)</summary>
|
||||
|
||||
- **EPUB**: استخدم سكربت البناء الموحّد؛ راجع [تعليمات إنشاء EPUB](../../EPUB.md)
|
||||
- **مصدر النص العربي**: `book-ar/introduction.ar.md`، و`book-ar/chapter1.ar.md` إلى `book-ar/chapter10.ar.md`، و`book-ar/afterword.ar.md`
|
||||
- **البناء**: ثبّت pandoc وxelatex وفئة ElegantBook والخطوط المطلوبة، ثم شغّل:
|
||||
|
||||
```bash
|
||||
cd book-ar && bash build_pdf.sh
|
||||
```
|
||||
|
||||
توجد الرسوم العربية في `book-ar/images/`؛ راجع `book-ar/preamble.tex` و`book-ar/*.lua` لتفاصيل التنضيد واتجاه RTL.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 نظرة عامة على المحتوى (الفصول 1-10)
|
||||
|
||||
يدور الكتاب حول المعادلة الأساسية **الوكيل = LLM + السياق + الأدوات**، وتتدرج موضوعاته عبر عشرة فصول:
|
||||
|
||||
| الفصل | الموضوع | ملخص من سطر واحد | نص | الكود |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **أساسيات الوكيل** | **الوكيل = LLM + السياق + الأدوات**; هندسة منظومة التشغيل هي الميزة التنافسية الحقيقية | [اقرأ](../../book-ar/chapter1.ar.md) | [4](../../chapter1/README.ar.md) |
|
||||
| 2 | 🎯 **هندسة السياق** | يحدد السياق سقف قدرة الوكيل: KV Cache، وهندسة الموجّهات، ومهارات الوكيل، وضغط السياق | [اقرأ](../../book-ar/chapter2.ar.md) | [9](../../chapter2/README.ar.md) |
|
||||
| 3 | 📚 **ذاكرة المستخدم وقواعد المعرفة** | ذاكرة المستخدم عبر الجلسات + المعرفة الخارجية: ذاكرة المستخدم، RAG، الفهارس المنظمة، الرسوم البيانية المعرفية | [اقرأ](../../book-ar/chapter3.ar.md) | [12](../../chapter3/README.ar.md) |
|
||||
| 4 | 🛠️ **الأدوات** | الأدوات هي أيدي الوكيل: بروتوكول MCP، وأدوات الإدراك/التنفيذ/التعاون، والوكلاء غير المتزامنين القائمين على الأحداث، والاكتشاف الاستباقي للأدوات | [اقرأ](../../book-ar/chapter4.ar.md) | [8](../../chapter4/README.ar.md) |
|
||||
| 5 | 💻 **وكيل البرمجة وتوليد الشفرة** | الشفرة «أداة تنشئ أدوات جديدة»؛ من وكيل البرمجة الأساسي إلى منظومة جاهزة للإنتاج | [اقرأ](../../book-ar/chapter5.ar.md) | [13](../../chapter5/README.ar.md) |
|
||||
| 6 | 🎙️ **التفاعل: توسيع فضاء الملاحظة وفضاء الفعل** | توسيع فضاءَي الملاحظة والفعل عبر الوسائط والزمن: الأنظمة غير المتزامنة والموجهة بالأحداث، والصوت، واستخدام الحاسوب، والروبوتات | [اقرأ](../../book-ar/chapter6.ar.md) | [13](../../chapter6/README.ar.md) |
|
||||
| 7 | 🎯 **تقييم الوكلاء** | تحويل الأداء إلى إشارات قابلة للمقارنة: البيئات، والمقاييس، والأهمية الإحصائية، والاختيار القائم على التقييم | [اقرأ](../../book-ar/chapter7.ar.md) | [13](../../chapter7/README.ar.md) |
|
||||
| 8 | 🧠 **مرحلة ما بعد تدريب النموذج** | ثلاث مراحل—التدريب المسبق وSFT وRL: متى نختار SFT أو RL، وكيف يستبطن النموذج استدعاء الأدوات، وكيف نحسن كفاءة العينات | [اقرأ](../../book-ar/chapter8.ar.md) | [19](../../chapter8/README.ar.md) |
|
||||
| 9 | 🔄 **التطور المستمر للوكلاء** | استخراج إشارات التعلم من مسارات التنفيذ، وتحديث المعرفة والتعليمات والبرامج والمعلمات | [اقرأ](../../book-ar/chapter9.ar.md) | [9](../../chapter9/README.ar.md) |
|
||||
| 10 | 🤝 **التعاون متعدد الوكلاء** | الذكاء الجماعي أكبر من الفردي: أطر التعاون، ومشاركة السياق أو عزله، ومجتمعات الوكلاء الناشئة | [اقرأ](../../book-ar/chapter10.ar.md) | [7](../../chapter10/README.ar.md) |
|
||||
|
||||
> 💡 **اقرأ** = افتح نص الفصل بصيغة Markdown على GitHub؛ و**N** = عدد المشاريع المصاحبة، ويمكن النقر عليه للوصول إلى الشفرة. تُشرح أنواع المشاريع (✅ مستقل / 📖 إعادة إنتاج / 🚧 تصميم) في ملف README الخاص بكل فصل.
|
||||
>
|
||||
> 📚 كيف تقرأ هذا الكتاب بكفاءة؟ راجع **[اقتراحات التعلم](LEARNING.md)** (الأفكار الأساسية، ومسار التعلم، ومستويات الصعوبة، ونصائح التدريب).
|
||||
|
||||
## 🔑 مفاتيح API
|
||||
|
||||
يُستحسن الحصول على مفاتيح API من أكثر من منصة لتيسير التجربة. راجع [هذا الدليل](https://01.me/2025/07/llm-api-setup/) لاختيار النموذج المناسب.
|
||||
|
||||
| منصة | رابط | ملاحظات | الوصول إلى نقاط النهاية |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | سلسلة Kimi قوية في السياق الطويل وقدرات الوكلاء | البر الرئيسي للصين |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | نماذج GLM، ومنها GLM-4.6، قوية في الصينية ومنافسة من حيث الكلفة | البر الرئيسي للصين |
|
||||
| **SiliconFlow** | <https://siliconflow.cn/> | مجموعة واسعة من النماذج المفتوحة، مثل DeepSeek وQwen، مع وصول سريع من الصين | البر الرئيسي للصين |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | واجهة DeepSeek الرسمية | عالمي + البر الرئيسي للصين |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | وصول موحد إلى نماذج عالمية وصينية، منها OpenAI وClaude وGemini وKimi وGLM وDeepSeek وQwen | عالمي + البر الرئيسي للصين |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | وصول موحد إلى عدد كبير من النماذج العالمية والمفتوحة | عالمي |
|
||||
|
||||
## 💎 الرعاة
|
||||
|
||||
شكرًا لـ **Krill AI** على رعاية المشروع. توفر المنصة بوابة API مستقرة وسريعة لنماذج GPT وClaude وGemini وعدد من النماذج الصينية، إلى جانب خيارات للمؤسسات والفوترة والدعم الفني واتصال WebSocket محسّن لخفض زمن وصول الرمز الأول.
|
||||
|
||||
تقدم Krill عرضًا لقراء الكتاب: سجّل عبر [هذا الرابط](https://www.krill-ai.net/register?invite=Q8D3L35725)، ثم أدخل الرمز الترويجي `ai-agent-book` عند إضافة الرصيد للحصول على خصم 23% على أول خطة Codex.
|
||||
|
||||
> 🧪 تُسجَّل حالة تنفيذ التجارب والأدلة والبوابات المتبقية بصورة منفصلة في [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md)؛ ولا يُعد استنساخ الشفرة أو تثبيتها دليلاً على اكتمال التجربة.
|
||||
|
||||
## 📦 الملحق · جلب المستودعات الخارجية
|
||||
|
||||
لا يتضمن هذا المستودع المستودعات الخارجية الـ23 الخاصة بالمعايير وأطر التدريب ومنصات الروبوتات في الفصول 6 و7 و9 و10، وذلك بسبب الحجم وشروط الترخيص. لذا يجب استنساخها في الأدلة المقابلة.
|
||||
|
||||
### سكربت للاستنساخ دفعة واحدة
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 عرض أوامر الاستنساخ</b> (23 مستودعًا خارجيًا)</summary>
|
||||
|
||||
```bash
|
||||
# Chapter 6 · Evaluation Benchmarks
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# Chapter 7 · Training Frameworks (bojieli/* are book-adapted forks)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # Exp 7-3 train LLM from scratch
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # Exp 7-4 train VLM from scratch (projection layer)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # Exp 7-14 RLVP paper code
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # Exp 7-13 vision-language-action RL
|
||||
|
||||
# Chapter 9 · Browser Automation & Claude Examples
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# Chapter 10 · Dual-Agent Architecture (now independent TalkAct project) + Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # Exp 10-5 Stanford AI Town
|
||||
```
|
||||
|
||||
> إذا حدد ملف README لمشروع ما معرّف commit بعينه، فنفّذ `git checkout` لذلك الإصدار لضمان قابلية إعادة النتائج. وقد تطور مشروع الفصل العاشر `use-computer-while-calling` إلى [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct)، وهو يُصان بصورة مستقلة ولا يُضمَّن في هذا المستودع؛ استخدم أمر الاستنساخ أعلاه لجلبه.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 المساهمة
|
||||
|
||||
الكتاب والكود المصاحب له مفتوح المصدر بالكامل. طلبات السحب موضع ترحيب كبير:
|
||||
|
||||
| النوع | ملاحظات |
|
||||
| --- | --- |
|
||||
| 📝 **محتوى الكتاب** | الأخطاء أو الإضافات أو تحسين الصياغة أو التطورات الجديدة (النص العربي في `book-ar/chapter*.ar.md`) |
|
||||
| 🐛 **تحسينات على الكود وإصلاحات للأخطاء** | اجعل المشاريع المصاحبة أكثر قوة وقابلة للاستخدام وجاهزة للإنتاج |
|
||||
| 🧪 **مشاريع تدريبية جديدة** | إضافة/استبدال تطبيقات أفضل للتجارب، أو المساهمة بأمثلة جديدة |
|
||||
| 🎨 **تصميم الشكل** | تحسين مخططات SVG المحفوظة في المستودع ضمن `book/images/` مباشرةً |
|
||||
| 🌐 **ترجمات جديدة** | نرحب بالترجمات إلى المزيد من اللغات؛ انظر العربية (`book-ar/`)، والإنجليزية (`book-en/`)، والصينية التقليدية/تايوان (`book-zhtw/`)، والروسية (`book-ru/`)، والتاميلية (`book-ta/`)، والفيتنامية (`book-vi/`)، واليابانية (`book-ja/`)، والتركية (`book-tr/`)، والكورية (`book-ko/`) كمرجع |
|
||||
|
||||
قبل إرسال مساهمتك، شغّل التجارب ذات الصلة للتأكد من قابلية إعادة النتائج. ويمكنك فتح issue لمناقشة الفكرة أولًا.
|
||||
|
||||
## 📄 الترخيص
|
||||
|
||||
هذا المشروع مرخص بموجب [Apache License 2.0](../../LICENSE). راجع ملف [`LICENSE`](../../LICENSE) للتفاصيل. وقد تتضمن بعض المشاريع الفرعية تراخيص مستقلة؛ ارجع إلى كل مشروع لمعرفة شروطه.
|
||||
|
||||
## ⭐ تاريخ النجوم
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>أنشأه السكربت [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py)، ويُحدَّث يوميًا عبر [GitHub Actions](../../.github/workflows/star-history.yml) · انقر على الصورة لعرض البيانات الحية.</sub>
|
||||
@@ -0,0 +1,54 @@
|
||||
# Learning Suggestions
|
||||
|
||||
← [Back to main README](README.md)
|
||||
|
||||
|
||||
### Core Concept: Agent = Model + Context + Tools
|
||||
|
||||
The core framework of this book is **Agent = Model + Context + Tools**. These three components collaborate to realize the intelligent behavior of an agent:
|
||||
|
||||
- **Model**: The brain of the agent, providing understanding, reasoning, and decision-making capabilities.
|
||||
- **Context**: The operating system of the agent, containing system instructions, dialogue history, reasoning processes, tool interaction records, etc.
|
||||
- **Tools**: The hands of the agent, enabling it to perceive the environment, execute actions, and interact with the external world.
|
||||
|
||||
### Learning Path
|
||||
|
||||
The learning path corresponds chapter by chapter to the entire book, unfolding layer by layer around the three pillars:
|
||||
|
||||
- **Chapter 1 · Foundations**: Establish a complete cognitive framework for agent systems—understand the definition of an agent in RL, compare the sample efficiency differences between traditional RL and LLM+RL paradigms, grasp the new paradigm of "model as agent," and master the core framework of **Agent = Model + Context + Tools**. **Key Insight**: The importance of prior knowledge surpasses algorithms and environments.
|
||||
|
||||
- **Chapters 2–3 · Context**: Context is the agent's operating system. Chapter 2 covers system prompts, KV Cache-friendly design, context compression, and prompt engineering ablation. Chapter 3 covers user memory, dense/sparse/hybrid retrieval, Agentic RAG, context-aware retrieval, and structured knowledge extraction. **Key Insight**: Complete context includes system instructions, dialogue history, reasoning processes, tool interaction records, user memory, and external knowledge.
|
||||
|
||||
- **Chapters 4–5 · Tools**: Tools are the bridge for the agent to interact with the world. Chapter 4 covers three types of MCP tools (perception/execution/collaboration), event triggering, and asynchronous architecture. Chapter 5 delves into the complete implementation of a production-grade Coding Agent. **Key Insight**: Tool design should be generalized (a code interpreter is better than a calculator); code is the meta-ability to create new tools.
|
||||
|
||||
- **Chapters 6–7 · Model**: How to measure and amplify intelligence. Chapter 6 covers evaluation benchmarks like Terminal-Bench, SWE-bench, GAIA, OSWorld, and Tau2-Bench. Chapter 7 covers post-training techniques like SFT, RL, RLHF, and sample efficiency. **Key Insight**: An independent verification signal is more reliable than "asking the model to think again"; "model as agent" internalizes tool calls as native capabilities through RL.
|
||||
|
||||
- **Chapter 8 · Self-Evolution**: Enable agents to grow from experience without changing weights—experience learning, externalizing workflows as tools, distilling prompts and observations into parameters. **Key Insight**: Learning from experience is the key for an agent to move from being "smart" to being "skilled."
|
||||
|
||||
- **Chapters 9–10 · Expansion and Collaboration**: Chapter 9 expands perception and action from text to speech, GUI, and the physical world. Chapter 10 uses multi-agent division of labor to handle complex tasks. **Key Insight**: Every design decision in a multi-agent system can find its counterpart in the three elements of a single agent.
|
||||
|
||||
## Prose and experiments
|
||||
|
||||
The book is not a step-by-step tutorial for one SDK. Short pseudocode and skeletons explain state flow, stopping points, and verification boundaries; chapter experiments contain complete implementations, model/environment adapters, tests, logs, and evidence.
|
||||
|
||||
| Layer | Read first | Skip for now | Question it answers |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | Project README: goal, minimum command, acceptance conditions; matching prose skeleton | credentials, UI, provider adapters, long raw logs | Which mechanism is this experiment meant to demonstrate? |
|
||||
| **Builder** | entry point, core loop, state/message schema, tools, verifier | compatibility/deployment layers unrelated to the mechanism | Which variable changed the behavior? |
|
||||
| **Maintainer** | tests, failure handling, evidence format, manifest/hash, rollback path | third-party details needed only when changing the experiment | Can the result be reproduced, and are failures recorded honestly? |
|
||||
|
||||
### Difficulty Levels
|
||||
|
||||
- **Beginner** (Chapters 1–2): Suitable for beginners, understanding basic concepts.
|
||||
- **Intermediate** (Chapters 3–4): Requires some programming foundation, involves system integration.
|
||||
- **Advanced** (Chapters 5–6): Requires strong programming skills, involves complex system design.
|
||||
- **Expert** (Chapters 7–8): Requires deep learning and training/self-evolution experience.
|
||||
- **Application** (Chapters 9–10): Comprehensive application of previous knowledge to build practical applications.
|
||||
|
||||
### Practical Suggestions
|
||||
|
||||
1. **Hands-on Practice**: Each project is designed to be run independently. It is recommended to run and modify the code yourself.
|
||||
2. **Combine with the Book**: Read the corresponding chapters in the manuscript in the [`book-en/`](../../book-en/) directory (English) or [`book/`](../../book/) directory (Chinese original) of this repository to understand the combination of theory and practice.
|
||||
3. **Experimental Comparison**: Many projects include ablation studies and comparative experiments. Deepen understanding through comparison.
|
||||
4. **Progressive Learning**: Start with simple projects and gradually delve into complex systems.
|
||||
5. **Focus on Protocols**: The MCP server project in Chapter 4 demonstrates standardized tool protocols, which are key to building scalable agents.
|
||||
@@ -0,0 +1,195 @@
|
||||
# AI Agents in Depth: Design Principles and Engineering Practice
|
||||
|
||||
[](#-e-book) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-e-book)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · English ← current · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[Download PDF / EPUB](#-e-book)** (recommended) — the PDF / EPUB editions offer the best reading experience; you can also [read online](https://bojieli.github.io/ai-agent-book/) (multi-language switcher, collapsible chapter tree, full-text search, auto-rebuilt on every push to main).
|
||||
|
||||
**Agent = LLM + Context + Tools** — This book builds on this core formula across 10 chapters, taking AI Agents from principles to engineering practice. The full text, illustrations, and **93 accompanying experiments** are all open source. You are welcome to run the experiments yourself.
|
||||
|
||||
> 📢 **What changed in version 2.0 (compared with 1.4):** Version 2.0 combines the “asynchronous interaction” section from the former Chapter 4 with the material on “multimodal Agents” from the former Chapter 9, reorganizing them into the new Chapter 6, “Interaction: Expanding the Observation and Action Spaces.” The former Chapters 6 (“Evaluating Agents”), 7 (“Model Post-Training”), and 8 (“Continual Evolution of Agents”) each move back one chapter and are now Chapters 7, 8, and 9, respectively.
|
||||
>
|
||||
> If you are reading an older PDF, we recommend [downloading the latest PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf). The new edition also includes many corrections and content adjustments, so please use the latest version.
|
||||
|
||||
| 📚 **10 chapters** of text, from basics to production | 📂 **93** companion projects (70+ standalone) | 🌐 **14 languages**: CN / EN / ES / ID / AR / zh-TW / RU / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 E-Book
|
||||
|
||||
> 📥 **Download** (recommended; full text, free and open source). These links always point to the latest build of the `main` branch; fixed editions are on the [Releases](https://github.com/bojieli/ai-agent-book/releases) page:
|
||||
> - **Chinese (original)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **English** (community translation, by [@nsdevaraj](https://github.com/nsdevaraj) and [@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **Spanish** (community translation, by [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Traditional Chinese (Taiwan)** (community translation, by [@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **Russian** (community translation, by [@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Tamil** (community translation, by [@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Vietnamese** (community translation, by [@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Japanese** (community translation, by [@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Arabic** (community translation, by [@TheSyBuilder](https://github.com/TheSyBuilder)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Turkish** (community translation, by [@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Korean** (community translation, by [@JeongJaeSoon](https://github.com/JeongJaeSoon)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 You can also [read online](https://bojieli.github.io/ai-agent-book/) — multi-language switcher, collapsible chapter tree, full-text search, and direct links to companion experiments. Auto-rebuilt on every push to main.
|
||||
|
||||
Chinese text source is in [`book/`](../../book/); English/Spanish/Arabic/Traditional Chinese (Taiwan)/Russian/Tamil/Vietnamese/Japanese/Turkish/Korean versions are community contributions (may lag behind the Chinese original), located in [`book-en/`](../../book-en/), [`book-es/`](../../book-es/), [`book-ar/`](../../book-ar/), [`book-zhtw/`](../../book-zhtw/), [`book-ru/`](../../book-ru/), [`book-ta/`](../../book-ta/), [`book-vi/`](../../book-vi/), [`book-ja/`](../../book-ja/), [`book-tr/`](../../book-tr/), [`book-ko/`](../../book-ko/) respectively.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Build PDF / EPUB yourself?</b> (PDF requires pandoc / xelatex / ElegantBook)</summary>
|
||||
|
||||
- **EPUB**: Use the shared builder; see the [EPUB build instructions](../../EPUB.md)
|
||||
- **Text source**: `book/introduction.md` (intro), `book/chapter1.md` ~ `book/chapter10.md` (Chapters 1–10), `book/afterword.md` (afterword)
|
||||
- **Build**: Install pandoc, xelatex, ElegantBook document class and required fonts, then run
|
||||
|
||||
```bash
|
||||
cd book && bash build_pdf.sh
|
||||
```
|
||||
|
||||
Figures are stored as SVG files in `book/images/` and used directly by the build; see `book/preamble.tex` and `book/*.lua` for typography details.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 Content Overview (Chapters 1–10)
|
||||
|
||||
The book revolves around the core formula **Agent = LLM + Context + Tools**, with ten chapters building progressively:
|
||||
|
||||
| Ch | Topic | One-line Summary | Text | Code |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Agent Fundamentals** | **Agent = LLM + Context + Tools**; Harness engineering is the real competitive edge | [Read](../../book-en/chapter1.md) | [4](../../chapter1/README.en.md) |
|
||||
| 2 | 🎯 **Context Engineering** | Context caps Agent ability: KV Cache, prompt engineering, Agent Skills, context compression | [Read](../../book-en/chapter2.md) | [9](../../chapter2/README.en.md) |
|
||||
| 3 | 📚 **User Memory & Knowledge Bases** | Cross-session user memory + external knowledge: user memory, RAG, structured indexes, knowledge graphs | [Read](../../book-en/chapter3.md) | [12](../../chapter3/README.en.md) |
|
||||
| 4 | 🛠️ **Tools** | Tools are the Agent's hands: MCP protocol, perception/execution/collaboration tools, event-driven async Agents, proactive tool discovery | [Read](../../book-en/chapter4.md) | [8](../../chapter4/README.en.md) |
|
||||
| 5 | 💻 **Coding Agent & Code Generation** | Code is a "tool that creates new tools"; production-grade Coding Agent in full | [Read](../../book-en/chapter5.md) | [13](../../chapter5/README.en.md) |
|
||||
| 6 | 🎙️ **Interaction: Expanding the Observation and Action Spaces** | Expand the Agent's observation and action spaces across modality and time: asynchronous and event-driven systems, voice, Computer Use, and robotics | [Read](../../book-en/chapter6.md) | [13](../../chapter6/README.en.md) |
|
||||
| 7 | 🎯 **Evaluating Agents** | Turn performance into comparable signals: evaluation environments, metrics, statistical significance, and evaluation-driven selection | [Read](../../book-en/chapter7.md) | [13](../../chapter7/README.en.md) |
|
||||
| 8 | 🧠 **Model Post-Training** | Three stages—pre-training, SFT, and RL: when to choose SFT or RL, internalizing tool calls, and sample efficiency | [Read](../../book-en/chapter8.md) | [19](../../chapter8/README.en.md) |
|
||||
| 9 | 🔄 **Continual Evolution of Agents** | Derive learning signals from execution trajectories and update knowledge, instructions, programs, and parameters | [Read](../../book-en/chapter9.md) | [9](../../chapter9/README.en.md) |
|
||||
| 10 | 🤝 **Multi-Agent Collaboration** | Collective intelligence > individual: collaboration frameworks, context sharing/isolation, emergent "Agent Society" | [Read](../../book-en/chapter10.md) | [7](../../chapter10/README.en.md) |
|
||||
|
||||
> 💡 **Read** = read the chapter text on GitHub (markdown); **N** = number of companion projects, click for code. Project types (✅ Standalone / 📖 Reproduction / 🚧 Design) are explained in each chapter's README.
|
||||
>
|
||||
> 📚 How to read this book efficiently? See **[Learning Suggestions](LEARNING.md)** (core ideas, learning path, difficulty levels, practice tips).
|
||||
|
||||
## 💻 Run the Companion Experiments
|
||||
|
||||
The shared supported range is **Python 3.11–3.13**. Install dependencies by chapter from the repository root; replace `ch1` with `ch2` through `ch10` for another chapter:
|
||||
|
||||
```bash
|
||||
# Recommended: use the committed uv.lock for a reproducible chapter environment
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# Without uv: resolve from pyproject.toml with pip
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
Before running an experiment that calls a model, follow that experiment's README for credentials. Experiments that support root-level configuration can use `.env.example` copied to `.env` with at least one provider key; some experiments instead require an adjacent `.env` or exported environment variables. Use local Ollama with `--provider ollama` only when that experiment's README or CLI lists it.
|
||||
|
||||
Then run an experiment from the repository root, for example:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# After a pip install, you can also run: python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- See the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/). `pip` remains supported but resolves fresh instead of using the lockfile.
|
||||
- Existing experiment-level `requirements.txt` files remain supported during migration, especially for isolated projects or special version constraints.
|
||||
- `all` is broad and CPU-friendly, not literally every experiment. `uv sync` exactly syncs the current selection each time, so combine special extras in one command, such as `uv sync --locked --extra ch2 --extra vllm` or `uv sync --locked --extra ch7 --extra unsloth`; the pip equivalent is `python -m pip install -e ".[ch2,vllm]"`.
|
||||
- Follow each experiment's README for system dependencies such as browsers, CUDA, FFmpeg, Ollama, Playwright browsers, and external repositories. Some vendored Chapter 8 components require Python 3.12+.
|
||||
|
||||
## 🔑 API Keys
|
||||
|
||||
It is recommended to apply for API keys from several platforms for convenient learning. See [this guide](https://01.me/2025/07/llm-api-setup/) for model selection.
|
||||
|
||||
| Platform | Link | Notes | Access endpoints |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | Kimi series, strong in long context and Agent capabilities | Mainland China |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6 etc., strong Chinese ability, cost-effective | Mainland China |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | Various open-source models (DeepSeek, Qwen, etc.), fast access from mainland China | Mainland China |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | Official DeepSeek API | Global + Mainland China |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | One-stop access to major global and China-domestic models (OpenAI, Claude, Gemini, Grok, Kimi, GLM, DeepSeek, Qwen, Minimax) | Global + Mainland China |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | One-stop access to major global and China-domestic models (GPT, Claude, Gemini, Kimi, GLM, DeepSeek, Qwen, etc.) | Global |
|
||||
|
||||
## 💎 Sponsors
|
||||
|
||||
Thanks to **Krill AI** for sponsoring this project! Krill provides an official, stable, and ultra-fast API relay for GPT / Claude / Gemini and many Chinese models, with enterprise-grade customization, invoicing, and 7×16h dedicated technical support, plus an exclusively adapted WebSocket connection for blazing-fast time to first token.
|
||||
|
||||
Krill offers a special deal for readers of this book: register via [this link](https://www.krill-ai.net/register?invite=Q8D3L35725) and enter the promo code "ai-agent-book" when topping up to get 23% off your first Codex plan!
|
||||
|
||||
> 🧪 Experiment execution status, evidence, and outstanding gates are tracked separately in [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md); cloning or installing source code does not establish completion.
|
||||
|
||||
## 📦 Appendix · Obtaining External Repositories
|
||||
|
||||
The 23 external repos for benchmarks, training frameworks, and robot platforms in Chapters 6, 7, 9, 10 are **not bundled** (due to size and licensing) and must be cloned into the corresponding directories.
|
||||
|
||||
### One-shot Clone Script
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Expand clone commands</b> (23 external repos)</summary>
|
||||
|
||||
```bash
|
||||
# Chapter 6 · Evaluation Benchmarks
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# Chapter 7 · Training Frameworks (bojieli/* are book-adapted forks)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # Exp 7-3 train LLM from scratch
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # Exp 7-4 train VLM from scratch (projection layer)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # Exp 7-14 RLVP paper code
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # Exp 7-13 vision-language-action RL
|
||||
|
||||
# Chapter 9 · Browser Automation & Claude Examples
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# Chapter 10 · Dual-Agent Architecture (now independent TalkAct project) + Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # Exp 10-5 Stanford AI Town
|
||||
```
|
||||
|
||||
> If a project README specifies a particular commit, `git checkout` to that version for reproducibility. Chapter 10's `use-computer-while-calling` has evolved into the independently maintained [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct); this repo does not bundle that directory — use the clone command above to fetch it.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
The book and accompanying code are fully open source. Pull Requests are very welcome:
|
||||
|
||||
| Type | Notes |
|
||||
| --- | --- |
|
||||
| 📝 **Book content** | Errata, additions, clearer wording, or new developments (text in `book/chapter*.md`) |
|
||||
| 🐛 **Code improvements & bug fixes** | Make companion projects more robust, usable, and production-ready |
|
||||
| 🧪 **New practice projects** | Add/replace better implementations for experiments, or contribute new examples |
|
||||
| 🎨 **Figure design** | Directly improve the checked-in SVG charts under `book/images/` |
|
||||
| 🌐 **New translations** | Translations into more languages are welcome; see English (`book-en/`), Arabic (`book-ar/`), Traditional Chinese/Taiwan (`book-zhtw/`), Russian (`book-ru/`), Tamil (`book-ta/`), Vietnamese (`book-vi/`), Japanese (`book-ja/`), Turkish (`book-tr/`), and Korean (`book-ko/`) for reference |
|
||||
|
||||
Before submitting, please run the relevant experiments to confirm reproducibility; feel free to open an issue to discuss ideas first.
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under [Apache License 2.0](../../LICENSE). See the [`LICENSE`](../../LICENSE) file for details. Some sub-projects may include their own license information; refer to the sub-project for specifics.
|
||||
|
||||
## ⭐ Star History
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>Generated by [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py), updated daily by [GitHub Actions](../../.github/workflows/star-history.yml) · Click image for live data</sub>
|
||||
@@ -0,0 +1,54 @@
|
||||
# Sugerencias de Aprendizaje
|
||||
|
||||
← [Volver al README principal](README.md)
|
||||
|
||||
|
||||
## Concepto Central: Agente = LLM + Contexto + Herramientas
|
||||
|
||||
El marco central de este libro es **Agente = LLM + Contexto + Herramientas**. Estos tres componentes colaboran para realizar el comportamiento inteligente de un agente:
|
||||
|
||||
- **LLM**: El cerebro del agente, que proporciona capacidades de comprensión, razonamiento y toma de decisiones.
|
||||
- **Contexto**: El sistema operativo del agente, que contiene instrucciones del sistema, historial de diálogo, procesos de razonamiento, registros de interacción con herramientas, etc.
|
||||
- **Herramientas**: Las manos del agente, que le permiten percibir el entorno, ejecutar acciones e interactuar con el mundo exterior.
|
||||
|
||||
### Ruta de Aprendizaje
|
||||
|
||||
La ruta de aprendizaje se corresponde capítulo por capítulo con todo el libro, desplegándose capa por capa alrededor de los tres pilares:
|
||||
|
||||
- **Capítulo 1 · Fundamentos**: Establecer un marco cognitivo completo para los sistemas de agentes — comprender la definición de un agente en RL, comparar las diferencias de eficiencia de muestra entre el RL tradicional y el paradigma LLM+RL, captar el nuevo paradigma de "modelo como agente" y dominar el marco central de **Agente = LLM + Contexto + Herramientas**. **Idea clave**: La importancia del conocimiento previo supera a los algoritmos y entornos.
|
||||
|
||||
- **Capítulos 2–3 · Contexto**: El contexto es el sistema operativo del agente. El Capítulo 2 cubre prompts del sistema, diseño optimizado para KV Cache, compresión de contexto y ablación de ingeniería de prompts. El Capítulo 3 cubre memoria de usuario, recuperación densa/dispersa/híbrida, Agentic RAG, recuperación consciente del contexto y extracción de conocimiento estructurado. **Idea clave**: El contexto completo incluye instrucciones del sistema, historial de diálogo, procesos de razonamiento, registros de interacción con herramientas, memoria de usuario y conocimiento externo.
|
||||
|
||||
- **Capítulos 4–5 · Herramientas**: Las herramientas son el puente para que el agente interactúe con el mundo. El Capítulo 4 cubre tres tipos de herramientas MCP (percepción/ejecución/colaboración), activación por eventos y arquitectura asíncrona. El Capítulo 5 profundiza en la implementación completa de un Coding Agent de grado de producción. **Idea clave**: El diseño de herramientas debe ser generalizado (un intérprete de código es mejor que una calculadora); el código es la meta-capacidad para crear nuevas herramientas.
|
||||
|
||||
- **Capítulos 6–7 · Modelo**: Cómo medir y amplificar la inteligencia. El Capítulo 6 cubre benchmarks de evaluación como Terminal-Bench, SWE-bench, GAIA, OSWorld y Tau2-Bench. El Capítulo 7 cubre técnicas de post-entrenamiento como SFT, RL, RLHF y eficiencia de muestra. **Idea clave**: Una señal de verificación independiente es más confiable que "pedirle al modelo que vuelva a pensar"; el "modelo como agente" internaliza las llamadas a herramientas como capacidades nativas mediante RL.
|
||||
|
||||
- **Capítulo 8 · Auto-Evolución**: Permitir que los agentes crezcan a partir de la experiencia sin cambiar los pesos — aprendizaje de la experiencia, externalización de flujos de trabajo como herramientas, destilación de prompts y observaciones en parámetros. **Idea clave**: Aprender de la experiencia es la clave para que un agente pase de ser "inteligente" a estar "capacitado".
|
||||
|
||||
- **Capítulos 9–10 · Expansión y Colaboración**: El Capítulo 9 expande la percepción y la acción del texto a la voz, GUI y el mundo físico. El Capítulo 10 utiliza la división del trabajo multi-agente para manejar tareas complejas. **Idea clave**: Cada decisión de diseño en un sistema multi-agente puede encontrar su homólogo en los tres elementos de un solo agente.
|
||||
|
||||
## Reparto entre texto y experimentos
|
||||
|
||||
El libro no es un tutorial paso a paso de un SDK. El pseudocódigo y los skeletons explican el flujo de estados, los puntos de parada y los límites de verificación; los experimentos contienen implementación, adaptadores, pruebas, registros y evidencias.
|
||||
|
||||
| Capa | Leer primero | Omitir por ahora | Pregunta que responde |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | README del proyecto: objetivo, comando mínimo y condiciones de aceptación; skeleton correspondiente del texto | credenciales, interfaz, adaptadores de proveedores y registros sin procesar extensos | ¿Qué mecanismo pretende demostrar este experimento? |
|
||||
| **Builder** | punto de entrada, bucle central, esquema de estado/mensajes, herramientas y verificador | capas de compatibilidad y despliegue no relacionadas con el mecanismo | ¿Qué variable cambió el comportamiento? |
|
||||
| **Maintainer** | pruebas, gestión de fallos, formato de evidencias, manifest/hash y ruta de rollback | detalles de terceros necesarios solo al modificar el experimento | ¿Se puede reproducir el resultado y se registran honestamente los fallos? |
|
||||
|
||||
### Niveles de Dificultad
|
||||
|
||||
- **Principiante** (Capítulos 1–2): Adecuado para principiantes, para entender conceptos básicos.
|
||||
- **Intermedio** (Capítulos 3–4): Requiere cierta base de programación e involucra integración de sistemas.
|
||||
- **Avanzado** (Capítulos 5–6): Requiere sólidas habilidades de programación e involucra diseño de sistemas complejos.
|
||||
- **Experto** (Capítulos 7–8): Requiere experiencia en aprendizaje profundo y entrenamiento/auto-evolución.
|
||||
- **Aplicación** (Capítulos 9–10): Aplicación integral de conocimientos previos para construir aplicaciones prácticas.
|
||||
|
||||
### Sugerencias Prácticas
|
||||
|
||||
1. **Práctica directa**: Cada proyecto está diseñado para ejecutarse de forma independiente. Se recomienda ejecutar y modificar el código por uno mismo.
|
||||
2. **Combinar con el libro**: Lee los capítulos correspondientes en la carpeta [`book-es/`](../../book-es/) (español) o [`book/`](../../book/) (chino original) de este repositorio para entender la combinación de teoría y práctica.
|
||||
3. **Comparación experimental**: Muchos proyectos incluyen estudios de ablación y experimentos comparativos. Profundiza la comprensión mediante la comparación.
|
||||
4. **Aprendizaje progresivo**: Comienza con proyectos simples y profundiza gradualmente en sistemas complejos.
|
||||
5. **Enfoque en protocolos**: El proyecto del servidor MCP en el Capítulo 4 demuestra protocolos de herramientas estandarizados, que son clave para construir agentes escalables.
|
||||
@@ -0,0 +1,169 @@
|
||||
# Agentes de IA en Profundidad: Principios de Diseño y Práctica de Ingeniería
|
||||
|
||||
[](#-libro-electrónico) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-libro-electrónico)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · Español ← actual · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[Descargar PDF / EPUB](#-libro-electrónico)** (recomendado) — las ediciones en PDF / EPUB ofrecen la mejor experiencia de lectura; también puedes [leer en línea](https://bojieli.github.io/ai-agent-book/) (conmutador de idiomas, árbol de capítulos desplegable, búsqueda de texto completo, recompilado automáticamente en cada push a main).
|
||||
|
||||
**Agente = LLM + Contexto + Herramientas** — Este libro se desarrolla en torno a esta fórmula central a lo largo de 10 capítulos, llevando los Agentes de IA desde los principios teóricos hasta la práctica de ingeniería. El texto completo, las ilustraciones y los **95 experimentos complementarios** son de código abierto. Te invitamos a ejecutar los experimentos por ti mismo.
|
||||
|
||||
> 📢 **Cambios de la versión 2.0 (respecto a la 1.4):** La versión 2.0 combina la sección «interacción asíncrona» del antiguo capítulo 4 con el contenido sobre «Agentes multimodales» del antiguo capítulo 9, y los reorganiza como el nuevo capítulo 6, «Interacción: la expansión de los espacios de observación y de acción». Los antiguos capítulos 6 («Evaluación de Agentes»), 7 («Post-entrenamiento de Modelos») y 8 («La Evolución Continua del Agente») se desplazan un capítulo y ahora son, respectivamente, los capítulos 7, 8 y 9.
|
||||
>
|
||||
> Si estás leyendo un PDF antiguo, te recomendamos [descargar el PDF más reciente](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf). La nueva edición también incorpora numerosas correcciones y ajustes de contenido; utiliza siempre la versión más reciente.
|
||||
|
||||
| 📚 **10 capítulos** de texto, desde lo básico hasta producción | 📂 **95 experimentos** complementarios, incluidos proyectos locales y rutas de reproducción externas | 🌐 **14 idiomas**: CN / EN / ES / ID / AR / zh-TW / RU / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 Libro electrónico
|
||||
|
||||
> 📥 **Descarga directa** (recomendada; texto completo, libre y de código abierto). Estos enlaces siempre apuntan a la última compilación de la rama `main`; las ediciones fijas están en la página de [Releases](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **Chino (original)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **Español** (traducción de la comunidad, por [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Inglés** (traducción de la comunidad, por [@nsdevaraj](https://github.com/nsdevaraj) y [@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **Chino Tradicional (Taiwán)** (traducción de la comunidad, por [@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **Ruso** (traducción de la comunidad, por [@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Tamil** (traducción de la comunidad, por [@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Vietnamita** (traducción de la comunidad, por [@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Japonés** (traducción de la comunidad, por [@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Árabe** (traducción de la comunidad, por [@TheSyBuilder](https://github.com/TheSyBuilder)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Turco** (traducción de la comunidad, por [@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Coreano** (traducción de la comunidad): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 También puedes [leer en línea](https://bojieli.github.io/ai-agent-book/) — conmutador multilingüe, árbol de capítulos desplegable, búsqueda de texto completo y enlaces directos a los experimentos complementarios. Recompilado automáticamente con cada push a main.
|
||||
|
||||
El código fuente en chino está en [`book/`](../../book/); las versiones en inglés, español, árabe, chino tradicional (Taiwán), ruso, tamil, vietnamita, japonés, turco y coreano son contribuciones de la comunidad (pueden ir por detrás del original en chino), ubicadas en [`book-en/`](../../book-en/), [`book-es/`](../../book-es/), [`book-ar/`](../../book-ar/), [`book-zhtw/`](../../book-zhtw/), [`book-ru/`](../../book-ru/), [`book-ta/`](../../book-ta/), [`book-vi/`](../../book-vi/), [`book-ja/`](../../book-ja/), [`book-tr/`](../../book-tr/) y [`book-ko/`](../../book-ko/) respectivamente.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 ¿Quieres compilar PDF / EPUB tú mismo?</b> (el PDF requiere pandoc / xelatex / ElegantBook)</summary>
|
||||
|
||||
- **EPUB**: Usa el generador compartido; consulta las [instrucciones de compilación de EPUB](../../EPUB.md)
|
||||
- **Fuente del texto**: `book-es/introduction.es.md` (introducción), `book-es/chapter1.es.md` ~ `book-es/chapter10.es.md` (Capítulos 1–10), `book-es/afterword.es.md` (epílogo)
|
||||
- **Compilación**: Instala pandoc, xelatex, la clase de documento ElegantBook y las fuentes necesarias, luego ejecuta:
|
||||
|
||||
```bash
|
||||
cd book-es && bash build_pdf.sh
|
||||
```
|
||||
|
||||
Las figuras se almacenan como archivos SVG en `book-es/images/` y se utilizan directamente en la compilación; consulta `book-es/preamble.tex` y `book-es/*.lua` para detalles de tipografía.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 Resumen del contenido (Capítulos 1–10)
|
||||
|
||||
El libro se desarrolla en torno a la fórmula central **Agente = LLM + Contexto + Herramientas**, con diez capítulos que se construyen progresivamente:
|
||||
|
||||
| Cap | Tema | Resumen en una línea | Texto | Código |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Fundamentos de Agentes** | **Agente = LLM + Contexto + Herramientas**; La ingeniería del Harness es la verdadera ventaja competitiva | [Leer](../../book-es/chapter1.es.md) | [4](../../chapter1/README.es.md) |
|
||||
| 2 | 🎯 **Ingeniería del Contexto** | El contexto limita la capacidad del Agente: KV Cache, ingeniería de prompts, Agent Skills, compresión de contexto | [Leer](../../book-es/chapter2.es.md) | [8](../../chapter2/README.es.md) |
|
||||
| 3 | 📚 **Memoria de Usuario y Bases de Conocimiento** | Memoria de usuario entre sesiones + conocimiento externo: memoria de usuario, RAG, índices estructurados, grafos de conocimiento | [Leer](../../book-es/chapter3.es.md) | [12](../../chapter3/README.es.md) |
|
||||
| 4 | 🛠️ **Herramientas** | Las herramientas son las manos del Agente: protocolo MCP, herramientas de percepción/ejecución/colaboración, Agentes asíncronos orientados a eventos, descubrimiento activo de herramientas | [Leer](../../book-es/chapter4.es.md) | [8](../../chapter4/README.es.md) |
|
||||
| 5 | 💻 **Coding Agent y Generación de Código** | El código es una "herramienta para crear nuevas herramientas"; panorama completo de un Coding Agent de grado de producción | [Leer](../../book-es/chapter5.es.md) | [13](../../chapter5/README.es.md) |
|
||||
| 6 | 🎙️ **Interacción: la expansión de los espacios de observación y de acción** | Ampliar los espacios de observación y acción del Agente en modalidad y tiempo: sistemas asíncronos y dirigidos por eventos, voz, Computer Use y robótica | [Leer](../../book-es/chapter6.es.md) | [13](../../chapter6/README.es.md) |
|
||||
| 7 | 🎯 **Evaluación de Agentes** | Convertir el rendimiento en señales comparables: entornos, métricas, significación estadística y selección guiada por evaluación | [Leer](../../book-es/chapter7.es.md) | [13](../../chapter7/README.es.md) |
|
||||
| 8 | 🧠 **Post-entrenamiento de Modelos** | Tres etapas—preentrenamiento, SFT y RL: cuándo elegir SFT o RL, internalización de llamadas a herramientas y eficiencia de muestra | [Leer](../../book-es/chapter8.es.md) | [19](../../chapter8/README.es.md) |
|
||||
| 9 | 🔄 **La Evolución Continua del Agente** | Obtener señales de aprendizaje de las trayectorias de ejecución y actualizar conocimientos, instrucciones, programas y parámetros | [Leer](../../book-es/chapter9.es.md) | [9](../../chapter9/README.es.md) |
|
||||
| 10 | 🤝 **Colaboración Multi-Agente** | Inteligencia colectiva > individual: marcos de colaboración, compartición/aislamiento de contexto, "Sociedad de Agentes" emergente | [Leer](../../book-es/chapter10.es.md) | [8](../../chapter10/README.es.md) |
|
||||
|
||||
> 💡 **Leer** = leer el texto del capítulo en GitHub (markdown); **N** = número de proyectos complementarios, haz clic para ver el código. Los tipos de proyecto (✅ Independiente / 📖 Reproducción / 🚧 Diseño) se explican en el README de cada capítulo.
|
||||
>
|
||||
> 📚 ¿Cómo leer este libro de manera eficiente? Consulta las **[Sugerencias de aprendizaje](LEARNING.md)** (ideas clave, ruta de aprendizaje, niveles de dificultad, consejos prácticos).
|
||||
|
||||
## 🔑 Claves de API (API Keys)
|
||||
|
||||
Se recomienda solicitar claves de API en varias plataformas para facilitar el aprendizaje. Consulta [esta guía](https://01.me/2025/07/llm-api-setup/) para la selección de modelos.
|
||||
|
||||
| Plataforma | Enlace | Notas | Puntos de acceso |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | Serie Kimi, fuerte en contexto largo y capacidades de Agente | China continental |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6 etc., gran capacidad en chino, rentable | China continental |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | Diversos modelos de código abierto (DeepSeek, Qwen, etc.), acceso rápido desde China continental | China continental |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | API oficial de DeepSeek | Global + China continental |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | Acceso integral a los principales modelos globales y de China (OpenAI, Claude, Gemini, Grok, Kimi, GLM, DeepSeek, Qwen, Minimax) | Global + China continental |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | Acceso integral a los principales modelos globales y de China (GPT, Claude, Gemini, Kimi, GLM, DeepSeek, Qwen, etc.) | Global |
|
||||
|
||||
## 💎 Patrocinadores
|
||||
|
||||
¡Gracias a **Krill AI** por patrocinar este proyecto! Krill proporciona un servicio de retransmisión de API oficial, estable y ultrarrápido para GPT / Claude / Gemini y muchos modelos chinos, con personalización de nivel empresarial, facturación y soporte técnico dedicado de 7×16h, además de una conexión WebSocket adaptada exclusivamente para un tiempo hasta el primer token extremadamente rápido.
|
||||
|
||||
Krill ofrece una oferta especial para los lectores de este libro: regístrate mediante [este enlace](https://www.krill-ai.net/register?invite=Q8D3L35725) e ingresa el código de promoción "ai-agent-book" al recargar para obtener un 23% de descuento en tu primer plan Codex.
|
||||
|
||||
> 🧪 El estado de ejecución de los experimentos, sus evidencias y los criterios pendientes se registran por separado en [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md); clonar o instalar el código fuente no demuestra que un experimento esté completo.
|
||||
|
||||
## 📦 Apéndice · Obtención de repositorios externos
|
||||
|
||||
Los 23 *checkouts* externos para benchmarks, marcos de entrenamiento y plataformas robóticas en los Capítulos 6, 7, 9 y 10 **no están incluidos** en el paquete (debido al tamaño y a las licencias) y deben clonarse en los directorios correspondientes.
|
||||
|
||||
### Script de clonación en un solo paso
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Desplegar comandos de clonación</b> (23 checkouts: 22 asignados a experimentos + 1 cookbook auxiliar)</summary>
|
||||
|
||||
```bash
|
||||
# Capítulo 6 · Benchmarks de evaluación
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world && git -C chapter6/android_world checkout --detach 0e95d641e244504c22087cc29b013f3b2428a261
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA && git -C chapter6/GAIA checkout --detach 682dd723ee1e1697e00360edccf2366dc8418dd9
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld && git -C chapter6/OSWorld checkout --detach 8365edc975efd0477a0d62444a5beed562ab5a7b
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench && git -C chapter6/SWE-bench checkout --detach 5cd4be9fb23971679cbbafe5a0ecade27cef99be
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench && git -C chapter6/tau2-bench checkout --detach 8d005b0e5b9e4af0bc055886fa7f95fc86d1710e
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench && git -C chapter6/terminal-bench checkout --detach 8384a179b1b8688f6ea5233a4d9d51218df1ac96
|
||||
|
||||
# Capítulo 7 · Marcos de entrenamiento (bojieli/* son ramas adaptadas para el libro)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind && git -C chapter7/MiniMind-pretrain/minimind fetch origin 8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795 && git -C chapter7/MiniMind-pretrain/minimind checkout --detach 8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795 && test "$(git -C chapter7/MiniMind-pretrain/minimind rev-parse HEAD)" = "8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795" # Experimento 7-3
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v && git -C chapter7/MiniMind-pretrain/minimind-v fetch origin ead791c530fa5f9a3549dbfe9e11ec732d18d2e5 && git -C chapter7/MiniMind-pretrain/minimind-v checkout --detach ead791c530fa5f9a3549dbfe9e11ec732d18d2e5 && test "$(git -C chapter7/MiniMind-pretrain/minimind-v rev-parse HEAD)" = "ead791c530fa5f9a3549dbfe9e11ec732d18d2e5" # Experimento 7-4
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original && git -C chapter7/AdaptThink-original checkout --detach 0033ad172dd53ac64004b763477407014f21b838 # Experimento 7-10
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL && git -C chapter7/SFTvsRL checkout --detach fef0a4a3367260a0934be1e40b01e4021698e023 # Experimentos 7-11 y 7-12
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld && git -C chapter7/AWorld checkout --detach a52d61d6d483e66b22ef16970eae5bbf4f4ab2ec # Experimento 7-16
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl && git -C chapter7/verl checkout --detach 1593fc3a8cf894debdc3dece2a23ed739c282789 # Experimento 7-15: receta ReTool; 7-16: backend de entrenamiento
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Experimento 7-15: sandbox de código
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook && git -C chapter7/tinker-cookbook checkout --detach fc8449187041cf102905f3f751e6d2eac7f9f754
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp && git -C chapter7/RLVP/rlvp fetch origin 1ad30bc7e338911fb733739393d92c420f4d8bee && git -C chapter7/RLVP/rlvp checkout --detach 1ad30bc7e338911fb733739393d92c420f4d8bee && test "$(git -C chapter7/RLVP/rlvp rev-parse HEAD)" = "1ad30bc7e338911fb733739393d92c420f4d8bee" # Experimento 7-14
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL && git -C chapter7/SimpleVLA-RL/SimpleVLA-RL checkout --detach 7c51662df27b586f9e8a1ab35fcf849f2b8852f9 # Experimento 7-13
|
||||
|
||||
# Capítulo 9 · Rutas externas de reproducción de GUI y robótica
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts && git -C chapter9/claude-quickstarts checkout --detach 9bcc95e316e5ef6542b4c9d0469f4078829eead5 # El experimento 9-5 usa computer-use-demo/
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use && git -C chapter9/browser-use checkout --detach ec9277c5001f2cb78ee419c927775a3cfc227ff8 # Experimento 9-6
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Compartido por los experimentos 9-7 y 9-9
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Experimentos 9-8 y 9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Experimento 9-11
|
||||
|
||||
# Capítulo 10 · Arquitectura de Agente dual (ahora proyecto independiente TalkAct) + Ciudad AI de Stanford
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling && git -C chapter10/use-computer-while-calling fetch origin 7d70007f72d45ddfc1a14e8e229b6d444e4919a2 && git -C chapter10/use-computer-while-calling checkout --detach 7d70007f72d45ddfc1a14e8e229b6d444e4919a2 && test "$(git -C chapter10/use-computer-while-calling rev-parse HEAD)" = "7d70007f72d45ddfc1a14e8e229b6d444e4919a2" # Experimento 10-3
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents && git -C chapter10/generative_agents fetch origin fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4 && git -C chapter10/generative_agents checkout --detach fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4 && test "$(git -C chapter10/generative_agents rev-parse HEAD)" = "fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4" # Experimento 10-5
|
||||
```
|
||||
|
||||
> Los nueve *checkouts* ausentes en este momento (7-3, 7-4, 7-14, SandboxFusion para 7-15, XLeRobot compartido por 9-7/9-9, RoboCrew para 9-8/9-9, `lerobot-sim2real` para 9-11, la línea base paralela fija del capítulo 10 y 10-5) también están fijados a SHA inmutables; los comandos realizan un *checkout* separado y comprueban la igualdad mediante `rev-parse HEAD`. El directorio `use-computer-while-calling` del Capítulo 10 ha evolucionado hacia el proyecto mantenido de forma independiente [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct). Que el código fuente exista o se instale correctamente no constituye una declaración de que el experimento esté completo.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Contribuciones
|
||||
|
||||
El libro y el código complementario son totalmente de código abierto. Las Pull Requests son muy bienvenidas:
|
||||
|
||||
| Tipo | Notas |
|
||||
| --- | --- |
|
||||
| 📝 **Contenido del libro** | Erratas, adiciones, redacción más clara o nuevos desarrollos (texto en `book-es/chapter*.es.md` o `book/chapter*.md`) |
|
||||
| 🐛 **Mejoras de código y corrección de errores** | Hacer que los proyectos complementarios sean más robustos, utilizables y listos para producción |
|
||||
| 🧪 **Nuevos proyectos prácticos** | Añadir/reemplazar mejores implementaciones para los experimentos, o contribuir nuevos ejemplos |
|
||||
| 🎨 **Diseño de figuras** | Mejorar directamente los gráficos SVG incluidos bajo `book-es/images/` |
|
||||
| 🌐 **Nuevas traducciones** | Las traducciones a más idiomas son bienvenidas; consulta inglés (`book-en/`), chino tradicional/Taiwán (`book-zhtw/`), tamil (`book-ta/`), vietnamita (`book-vi/`), japonés (`book-ja/`), turco (`book-tr/`) como referencia |
|
||||
|
||||
Antes de realizar la entrega, ejecuta los experimentos pertinentes para confirmar la reproducibilidad; no dudes en abrir una issue para discutir ideas primero.
|
||||
|
||||
## 📄 Licencia
|
||||
|
||||
Este proyecto está bajo la licencia [Apache License 2.0](../../LICENSE). Consulta el archivo [`LICENSE`](../../LICENSE) para más detalles. Algunos subproyectos pueden incluir su propia información de licencia; consulta el subproyecto para más especificaciones.
|
||||
|
||||
## ⭐ Star History
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>Generado por [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py), actualizado diariamente por [GitHub Actions](../../.github/workflows/star-history.yml) · Haz clic en la imagen para ver datos en tiempo real</sub>
|
||||
@@ -0,0 +1,53 @@
|
||||
# Tanulási javaslatok
|
||||
|
||||
← [Vissza a magyar főoldalhoz](README.md)
|
||||
|
||||
## Alapgondolat: Ágens = Modell + Kontextus + Eszközök
|
||||
|
||||
A könyv központi kerete az **Ágens = Modell + Kontextus + Eszközök** képlet. A három összetevő együtt hoz létre intelligens viselkedést:
|
||||
|
||||
| Összetevő | Hasonlat | Feladat |
|
||||
| :--: | :--: | --- |
|
||||
| 🧠 **Modell** | Agy | Megértési, következtetési és döntéshozatali képességet biztosít |
|
||||
| 💾 **Kontextus** | Operációs rendszer | Tartalmazza a rendszerutasításokat, a párbeszéd előzményeit, a következtetési folyamatot, az eszközhasználat nyomait és minden egyéb releváns információt |
|
||||
| 🤲 **Eszközök** | Kéz | Érzékelik a környezetet, műveleteket hajtanak végre, és kapcsolatot teremtenek a külvilággal |
|
||||
|
||||
## Tanulási útvonal
|
||||
|
||||
| Szakasz | Fejezet | Témakör | Legfontosabb felismerés |
|
||||
| --- | :--: | --- | --- |
|
||||
| **Alapok** | 1. fejezet | Az ágens definíciója az RL-ben, a hagyományos RL és az LLM+RL mintahatékonysága, a „modell mint ágens” paradigma | Az előzetes tudás gyakran fontosabb, mint az algoritmus vagy a környezet |
|
||||
| **Kontextus** | 2–3. fejezet | Rendszerprompt, KV Cache, kontextustömörítés, prompttervezés; felhasználói memória, sűrű/ritka/hibrid keresés, Agentic RAG | A teljes kontextus az utasításokat, előzményeket, következtetést, eszközhasználatot, memóriát és külső tudást egyaránt magában foglalja |
|
||||
| **Eszközök** | 4–5. fejezet | MCP-alapú érzékelési, végrehajtási és együttműködési eszközök, eseményvezérelt aszinkron architektúra, kódoló ágensek | Az eszközök legyenek általánosak; a kód metaképesség új eszközök létrehozására |
|
||||
| **Értékelés és evolúció** | 6–8. fejezet | Ágensértékelés, SFT és RL, tanulás a nyomvonalakból, a tudás, utasítások, programok és paraméterek frissítése | Ellenőrizhető tanulási jel nélkül nincs megbízható fejlődés; a frissítés hordozója attól függ, hogyan fejeződik ki és hogyan tesztelhető a képesség |
|
||||
| **Kiterjesztés és együttműködés** | 9–10. fejezet | Beszéd, GUI, fizikai világ és több ágens munkamegosztása | Minden többágenses tervezési döntésnek van egyágenses megfelelője |
|
||||
|
||||
## A törzsszöveg és a kísérletek felosztása
|
||||
|
||||
A könyv nem egyetlen SDK lépésről lépésre követhető oktatóanyaga. A rövid pseudocode és skeleton az állapotáramlást, a megállási pontokat és az ellenőrzési határokat mutatja; a fejezetek kísérletei teljes megvalósítást, adaptereket, teszteket, naplókat és bizonyítékot adnak.
|
||||
|
||||
| Réteg | Először olvasd | Egyelőre hagyd ki | Milyen kérdésre válaszol? |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | A projekt README-je: cél, minimális parancs, elfogadási feltételek és a hozzá tartozó szöveges skeleton | hitelesítő adatok, UI, szolgáltatói adapterek és hosszú nyers naplók | Melyik mechanizmust hivatott bemutatni ez a kísérlet? |
|
||||
| **Builder** | belépési pont, magciklus, állapot-/üzenetséma, eszközök és ellenőrző | a mechanizmustól független kompatibilitási/deploy rétegek | Melyik változó változtatta meg a viselkedést? |
|
||||
| **Maintainer** | tesztek, hibakezelés, bizonyítékformátum, manifest/hash és visszaállítási útvonal | csak a kísérlet módosításakor szükséges külső részletek | Reprodukálható az eredmény, és őszintén vannak rögzítve a hibák? |
|
||||
|
||||
## Nehézségi szintek
|
||||
|
||||
| Szint | Fejezet | Kinek ajánlott? |
|
||||
| --- | :--: | --- |
|
||||
| 🟢 Kezdő | 1–2. fejezet | Az alapfogalmakat megismerni kívánó olvasóknak |
|
||||
| 🔵 Középhaladó | 3–4. fejezet | Programozási alapismeretekkel és rendszerintegrációs érdeklődéssel rendelkezőknek |
|
||||
| 🟣 Haladó | 5–6. fejezet | Erős programozási és összetett rendszertervezési tapasztalattal rendelkezőknek |
|
||||
| 🔴 Szakértő | 7–8. fejezet | Mélytanulásban, modellképzésben vagy önfejlődő rendszerekben jártas olvasóknak |
|
||||
| 🟠 Alkalmazott | 9–10. fejezet | Az előző részeket valós alkalmazássá összeépíteni kívánóknak |
|
||||
|
||||
## Gyakorlati tanácsok
|
||||
|
||||
| # | Tanács | Magyarázat |
|
||||
| :--: | --- | --- |
|
||||
| 1 | 🛠️ **Gyakorolj közvetlenül** | Futtasd és módosítsd a kapcsolódó projekteket, hogy az elmélet gyakorlati tudássá váljon |
|
||||
| 2 | 📚 **Olvasd együtt a kézirattal** | A projektek kipróbálása közben olvasd el a megfelelő fejezetet a [`book-hu/`](../../book-hu/) könyvtárban |
|
||||
| 3 | 🔬 **Hasonlítsd össze a kísérleteket** | Ablációs és összehasonlító vizsgálatokkal értsd meg az egyes összetevők hatását |
|
||||
| 4 | 🪜 **Haladj fokozatosan** | Kezdd az egyszerű projektekkel, majd lépj tovább az összetettebb rendszerekre |
|
||||
| 5 | 🔌 **Figyelj a protokollokra** | A 4. fejezet MCP-szerverei megmutatják, miért fontos a szabványosított eszközprotokoll a bővíthető ágensekhez |
|
||||
@@ -0,0 +1,168 @@
|
||||
# Az AI-ügynökök mélyreható megértése: tervezési alapelvek és mérnöki gyakorlat
|
||||
|
||||
[](#-e-könyv) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-e-könyv)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · Magyar ← jelenlegi · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[PDF / EPUB letöltése](#-e-könyv)** (ajánlott) — a PDF- és EPUB-kiadás nyújtja a legjobb olvasási élményt; a könyv [online is olvasható](https://bojieli.github.io/ai-agent-book/), nyelvváltóval, összecsukható fejezetfával és teljes szövegű kereséssel.
|
||||
|
||||
**Ágens = NYM + Kontextus + Eszközök** — a könyv erre az alapképletre építve, tíz fejezeten keresztül vezet el az AI-ügynökök alapelveitől a mérnöki gyakorlatig. A teljes szöveg, az ábrák és a **104 kapcsolódó projekt** nyílt forráskódú.
|
||||
|
||||
> 📢 **A 2.0-s verzió változásai az 1.4-eshez képest:** A 2.0-s verzió a korábbi 4. fejezet „aszinkron interakció” részét és a korábbi 9. fejezet „multimodális ágensekről” szóló anyagát egyesíti, majd új 6. fejezetként, „Interakció: a megfigyelési és a cselekvési tér kiterjesztése” címmel rendezi át. A korábbi 6. („Ügynökök kiértékelése”), 7. („Modell poszt-tréning”) és 8. („Az ágensek folyamatos evolúciója”) fejezet egy-egy hellyel hátrébb került, így most rendre a 7., 8. és 9. fejezet.
|
||||
>
|
||||
> Ha egy régebbi PDF-et olvas, javasoljuk, hogy [töltse le a legújabb PDF-et](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-hu.pdf). Az új kiadás számos javítást és tartalmi módosítást is tartalmaz; kérjük, mindig a legfrissebb verziót használja.
|
||||
|
||||
| 📚 **10 fejezet** az alapoktól az éles rendszerekig | 📂 **104 kapcsolódó projekt**, helyi projektekkel és külső reprodukciós útvonalakkal | 🌐 **14 nyelv**: ZH / EN / ES / ID / AR / zh-TW / RU / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 E-könyv
|
||||
|
||||
> 📥 **Letöltés offline olvasáshoz** (teljes szöveg, ingyenes és nyílt forráskódú). Az alábbi hivatkozások mindig a `main` ág legfrissebb buildjére mutatnak; a rögzített verziók a [Releases](https://github.com/bojieli/ai-agent-book/releases) oldalon érhetők el:
|
||||
> - **Magyar** (közösségi fordítás, [@barmivalami0-ux](https://github.com/barmivalami0-ux)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-hu.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-hu.epub)
|
||||
> - **Kínai (eredeti)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **Angol**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **Spanyol**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Indonéz**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-id.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-id.epub)
|
||||
> - **Arab**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Hagyományos kínai (Tajvan)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **Orosz**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Tamil**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Vietnámi**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Japán**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Török**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Koreai**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 A könyv [online is olvasható](https://bojieli.github.io/ai-agent-book/). A webhely a `main` ág minden frissítése után automatikusan újraépül.
|
||||
|
||||
A magyar kézirat forrása a [`book-hu/`](../../book-hu/) könyvtárban található. Ez közösségi fordítás, ezért előfordulhat, hogy lemarad a kínai eredeti mögött.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Saját PDF / EPUB build készítése</b> (a PDF-hez pandoc / xelatex / ElegantBook szükséges)</summary>
|
||||
|
||||
- **EPUB**: használd a közös buildrendszert; lásd az [EPUB buildelési útmutatót](../../EPUB.md)
|
||||
- **Szövegforrás**: `book-hu/introduction.md`, `book-hu/chapter1.md`–`book-hu/chapter10.md` és `book-hu/afterword.md`
|
||||
- **PDF build**: telepítsd a pandoc, xelatex és ElegantBook eszközöket, valamint a szükséges betűkészleteket, majd futtasd:
|
||||
|
||||
```bash
|
||||
cd book-hu && bash build_pdf.sh
|
||||
```
|
||||
|
||||
Az ábrák a `book-hu/images/` könyvtárban találhatók; a tördelési beállításokat a `book-hu/preamble.tex` és a `book-hu/*.lua` fájlok tartalmazzák.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 Tartalmi áttekintés (1–10. fejezet)
|
||||
|
||||
| Fejezet | Téma | Rövid összefoglaló | Szöveg | Kód |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Ismerkedés az AI-ügynökökkel** | **Ágens = NYM + Kontextus + Eszközök**; a harness-mérnökség teremti meg a valódi versenyelőnyt | [Olvasás](../../book-hu/chapter1.md) | [4](../../chapter1/README.hu.md) |
|
||||
| 2 | 🎯 **Kontextustervezés** | KV Cache, prompttervezés, Agent Skills és kontextustömörítés | [Olvasás](../../book-hu/chapter2.md) | [8](../../chapter2/README.hu.md) |
|
||||
| 3 | 📚 **Felhasználói memória és tudásbázis** | Munkameneteken átívelő memória, RAG, strukturált indexek és tudásgráfok | [Olvasás](../../book-hu/chapter3.md) | [12](../../chapter3/README.hu.md) |
|
||||
| 4 | 🛠️ **Eszközök** | MCP, érzékelési, végrehajtási és együttműködési eszközök, eseményvezérelt aszinkron ágensek | [Olvasás](../../book-hu/chapter4.md) | [8](../../chapter4/README.hu.md) |
|
||||
| 5 | 💻 **Kódoló ágens és kódgenerálás** | A kód mint új eszközöket létrehozó eszköz; éles környezetre kész kódoló ágensek | [Olvasás](../../book-hu/chapter5.md) | [13](../../chapter5/README.hu.md) |
|
||||
| 6 | 🎙️ **Interakció: a megfigyelési és a cselekvési tér kiterjesztése** | Az ágens megfigyelési és cselekvési terének kiterjesztése modalitásban és időben: aszinkron és eseményvezérelt rendszerek, beszéd, Computer Use és robotika | [Olvasás](../../book-hu/chapter6.md) | [13](../../chapter6/README.hu.md) |
|
||||
| 7 | 🎯 **Ügynökök kiértékelése** | A teljesítmény összehasonlítható jelekké alakítása: környezetek, mérőszámok, statisztikai szignifikancia és értékelésvezérelt kiválasztás | [Olvasás](../../book-hu/chapter7.md) | [13](../../chapter7/README.hu.md) |
|
||||
| 8 | 🧠 **Modell poszt-tréning** | Három szakasz—előképzés, SFT és RL: mikor válasszunk SFT-t vagy RL-t, az eszközhívások internalizálása és a mintahatékonyság | [Olvasás](../../book-hu/chapter8.md) | [19](../../chapter8/README.hu.md) |
|
||||
| 9 | 🔄 **Az ágensek folyamatos evolúciója** | Tanulási jelek kinyerése a végrehajtási nyomvonalakból, majd a tudás, utasítások, programok és paraméterek frissítése | [Olvasás](../../book-hu/chapter9.md) | [9](../../chapter9/README.hu.md) |
|
||||
| 10 | 🤝 **Többügynökös együttműködés** | Együttműködési struktúrák, kontextusmegosztás és -elszigetelés, ágenstársadalmak | [Olvasás](../../book-hu/chapter10.md) | [8](../../chapter10/README.hu.md) |
|
||||
|
||||
> 💡 Az **Olvasás** hivatkozások megnyitják a fejezet magyar szövegét a GitHubon; a **Kód** oszlop számai a kapcsolódó projektek magyar jegyzékére mutatnak.
|
||||
>
|
||||
> 📚 A javasolt tanulási sorrendet és gyakorlati tippeket a **[Tanulási javaslatok](LEARNING.md)** tartalmazza.
|
||||
|
||||
## 💻 A kapcsolódó kísérletek futtatása
|
||||
|
||||
A közösen támogatott tartomány a **Python 3.11–3.13**. A függőségeket a repository gyökeréből, fejezetenként telepítsd; másik fejezethez a `ch1` helyére `ch2`–`ch10` kerüljön:
|
||||
|
||||
```bash
|
||||
# Ajánlott: reprodukálható környezet a repository-ban tárolt uv.lock alapján
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# uv nélkül: telepítés pip segítségével a pyproject.toml fájlból
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
Egy kísérlet futtatása előtt olvasd el az adott projekt README-jét az API-kulcsokról, a rendszerfüggőségekről és az esetleges további Python-verziókövetelményekről. Például:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
```
|
||||
|
||||
## 🔑 API-kulcsok
|
||||
|
||||
A modellt használó kísérletekhez legalább egy szolgáltatói API-kulcs szükséges. A modellválasztáshoz lásd [ezt az útmutatót](https://01.me/2025/07/llm-api-setup/); az egyes kísérletek pontos beállításait mindig a saját README-jük tartalmazza.
|
||||
|
||||
> 🧪 A kísérletek futtatási állapotát, bizonyítékait és még teljesítendő kapuit külön az [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md) tartalmazza; a forráskód klónozása vagy telepítése önmagában nem igazolja a kísérlet befejezését.
|
||||
|
||||
## 📦 Függelék · Külső repository-k beszerzése
|
||||
|
||||
A 6., 7., 9. és 10. fejezethez tartozó 22 külső repository, valamint egy kiegészítő tanítási cookbook méret- és licencokokból nincs a projektbe csomagolva. Az alábbi parancsok reprodukálható kiindulópontként rögzített commitokat töltenek le.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 A klónozási parancsok megjelenítése</b> (23 checkout)</summary>
|
||||
|
||||
```bash
|
||||
# 6. fejezet · Értékelési benchmarkok
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world && git -C chapter6/android_world checkout --detach 0e95d641e244504c22087cc29b013f3b2428a261
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA && git -C chapter6/GAIA checkout --detach 682dd723ee1e1697e00360edccf2366dc8418dd9
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld && git -C chapter6/OSWorld checkout --detach 8365edc975efd0477a0d62444a5beed562ab5a7b
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench && git -C chapter6/SWE-bench checkout --detach 5cd4be9fb23971679cbbafe5a0ecade27cef99be
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench && git -C chapter6/tau2-bench checkout --detach 8d005b0e5b9e4af0bc055886fa7f95fc86d1710e
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench && git -C chapter6/terminal-bench checkout --detach 8384a179b1b8688f6ea5233a4d9d51218df1ac96
|
||||
|
||||
# 7. fejezet · Tanítási keretrendszerek (a bojieli/* ágak a könyvhöz igazított változatok)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind && git -C chapter7/MiniMind-pretrain/minimind fetch origin 8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795 && git -C chapter7/MiniMind-pretrain/minimind checkout --detach 8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795 && test "$(git -C chapter7/MiniMind-pretrain/minimind rev-parse HEAD)" = "8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795" # 7-3. kísérlet
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v && git -C chapter7/MiniMind-pretrain/minimind-v fetch origin ead791c530fa5f9a3549dbfe9e11ec732d18d2e5 && git -C chapter7/MiniMind-pretrain/minimind-v checkout --detach ead791c530fa5f9a3549dbfe9e11ec732d18d2e5 && test "$(git -C chapter7/MiniMind-pretrain/minimind-v rev-parse HEAD)" = "ead791c530fa5f9a3549dbfe9e11ec732d18d2e5" # 7-4. kísérlet
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original && git -C chapter7/AdaptThink-original checkout --detach 0033ad172dd53ac64004b763477407014f21b838 # 7-10. kísérlet
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL && git -C chapter7/SFTvsRL checkout --detach fef0a4a3367260a0934be1e40b01e4021698e023 # 7-11. és 7-12. kísérlet
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld && git -C chapter7/AWorld checkout --detach a52d61d6d483e66b22ef16970eae5bbf4f4ab2ec # 7-16. kísérlet
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl && git -C chapter7/verl checkout --detach 1593fc3a8cf894debdc3dece2a23ed739c282789 # 7-15. ReTool-recept és 7-16. tanítási háttérrendszer
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # 7-15. kísérlet, kódsandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook && git -C chapter7/tinker-cookbook checkout --detach fc8449187041cf102905f3f751e6d2eac7f9f754
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp && git -C chapter7/RLVP/rlvp fetch origin 1ad30bc7e338911fb733739393d92c420f4d8bee && git -C chapter7/RLVP/rlvp checkout --detach 1ad30bc7e338911fb733739393d92c420f4d8bee && test "$(git -C chapter7/RLVP/rlvp rev-parse HEAD)" = "1ad30bc7e338911fb733739393d92c420f4d8bee" # 7-14. kísérlet
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL && git -C chapter7/SimpleVLA-RL/SimpleVLA-RL checkout --detach 7c51662df27b586f9e8a1ab35fcf849f2b8852f9 # 7-13. kísérlet
|
||||
|
||||
# 9. fejezet · GUI és robotikai reprodukciós útvonalak
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts && git -C chapter9/claude-quickstarts checkout --detach 9bcc95e316e5ef6542b4c9d0469f4078829eead5 # 9-5. kísérlet, computer-use-demo/
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use && git -C chapter9/browser-use checkout --detach ec9277c5001f2cb78ee419c927775a3cfc227ff8 # 9-6. kísérlet
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # a 9-7. és 9-9. kísérlet közös függősége
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # 9-8/9-9. kísérlet; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # 9-11. kísérlet
|
||||
|
||||
# 10. fejezet · Kettős ágensarchitektúra és Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling && git -C chapter10/use-computer-while-calling fetch origin 7d70007f72d45ddfc1a14e8e229b6d444e4919a2 && git -C chapter10/use-computer-while-calling checkout --detach 7d70007f72d45ddfc1a14e8e229b6d444e4919a2 && test "$(git -C chapter10/use-computer-while-calling rev-parse HEAD)" = "7d70007f72d45ddfc1a14e8e229b6d444e4919a2" # 10-3. kísérlet (historikus 10-4)
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents && git -C chapter10/generative_agents fetch origin fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4 && git -C chapter10/generative_agents checkout --detach fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4 && test "$(git -C chapter10/generative_agents rev-parse HEAD)" = "fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4" # 10-5. kísérlet (historikus 10-7)
|
||||
```
|
||||
|
||||
> A rögzített forráskód csak reprodukálható kiindulópont; nem bizonyítja, hogy a tanítási, hardveres, böngészős vagy többágenses kísérlet sikeresen lefutott.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Közreműködés
|
||||
|
||||
A könyv és a kapcsolódó kód teljes egészében nyílt forráskódú; örömmel fogadjuk a Pull Requesteket.
|
||||
|
||||
| Típus | Leírás |
|
||||
| --- | --- |
|
||||
| 📝 **Könyvszöveg** | Elírások javítása, kiegészítések, világosabb megfogalmazás és új fejlemények |
|
||||
| 🐛 **Kódjavítások** | A kapcsolódó projektek robusztusabbá és könnyebben használhatóvá tétele |
|
||||
| 🧪 **Új gyakorlóprojektek** | Jobb implementációk vagy új példák hozzáadása |
|
||||
| 🎨 **Ábrák** | A `book-hu/images/` magyar ábráinak javítása |
|
||||
| 🌐 **Fordítások** | Új nyelvek hozzáadása vagy a meglévő fordítások fejlesztése |
|
||||
|
||||
## 📄 Licenc
|
||||
|
||||
A projekt az [Apache License 2.0](../../LICENSE) feltételei szerint érhető el. Egyes alprojektek saját licencinformációkat tartalmazhatnak; ezeknél az adott alprojekt feltételei érvényesek.
|
||||
|
||||
## ⭐ Star-előzmények
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>A diagramot a [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py) hozza létre, és a [GitHub Actions](../../.github/workflows/star-history.yml) naponta frissíti.</sub>
|
||||
@@ -0,0 +1,53 @@
|
||||
# Saran Belajar
|
||||
|
||||
← [Kembali ke halaman utama Bahasa Indonesia](README.md)
|
||||
|
||||
## Gagasan Inti: Agent = Model + Konteks + Alat
|
||||
|
||||
Kerangka utama buku ini adalah **Agent = Model + Konteks + Alat**. Ketiga komponen tersebut bekerja bersama untuk menghasilkan perilaku cerdas:
|
||||
|
||||
| Komponen | Analogi | Tanggung jawab |
|
||||
| :--: | :--: | --- |
|
||||
| 🧠 **Model** | Otak | Memberikan kemampuan memahami, menalar, dan mengambil keputusan |
|
||||
| 💾 **Konteks** | Sistem operasi | Memuat instruksi sistem, riwayat dialog, proses penalaran, catatan interaksi alat, dan informasi terkait lainnya |
|
||||
| 🤲 **Alat** | Tangan | Mengamati lingkungan, menjalankan tindakan, dan berinteraksi dengan dunia luar |
|
||||
|
||||
## Jalur Belajar
|
||||
|
||||
| Bagian | Bab | Cakupan | Wawasan utama |
|
||||
| --- | :--: | --- | --- |
|
||||
| **Dasar** | Bab 1 | Definisi Agent dalam RL, efisiensi sampel RL tradisional dibanding LLM+RL, paradigma “model sebagai Agent” | Pengetahuan awal dapat lebih menentukan daripada algoritma dan lingkungan |
|
||||
| **Konteks** | Bab 2–3 | Prompt sistem, KV Cache, kompresi konteks, rekayasa prompt; memori pengguna, pencarian padat/jarang/hibrida, Agentic RAG | Konteks lengkap mencakup instruksi, riwayat, penalaran, interaksi alat, memori pengguna, dan pengetahuan eksternal |
|
||||
| **Alat** | Bab 4–5 | Alat MCP untuk persepsi/eksekusi/kolaborasi, arsitektur asinkron berbasis peristiwa, implementasi Coding Agent | Alat sebaiknya bersifat umum; kode merupakan kemampuan meta untuk membuat alat baru |
|
||||
| **Evaluasi dan Evolusi** | Bab 6–8 | Evaluasi Agent, SFT dan RL, pembelajaran dari jejak untuk memperbarui pengetahuan, instruksi, program, dan parameter | Sinyal yang dapat diverifikasi harus ada sebelum pembelajaran; media pembaruan bergantung pada bagaimana kemampuan dinyatakan dan diuji |
|
||||
| **Perluasan dan Kolaborasi** | Bab 9–10 | Interaksi suara/GUI/dunia fisik dan pembagian kerja multi-Agent | Setiap keputusan desain multi-Agent memiliki padanan dalam unsur Agent tunggal |
|
||||
|
||||
## Pembagian teks utama dan eksperimen
|
||||
|
||||
Buku ini bukan tutorial langkah demi langkah untuk satu SDK. Pseudocode dan skeleton menjelaskan aliran status, titik penghentian, dan batas verifikasi; eksperimen menyediakan implementasi, adapter, pengujian, log, dan bukti.
|
||||
|
||||
| Lapisan | Baca terlebih dahulu | Lewati dulu | Pertanyaan yang dijawab |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | README proyek: tujuan, perintah minimum, dan syarat penerimaan; skeleton teks yang sesuai | kredensial, UI, adapter provider, dan log mentah yang panjang | Mekanisme apa yang hendak dibuktikan eksperimen ini? |
|
||||
| **Builder** | entry point, loop inti, skema state/pesan, tool, dan verifier | lapisan kompatibilitas/deployment yang tidak terkait mekanisme | Variabel mana yang mengubah perilaku? |
|
||||
| **Maintainer** | test, penanganan kegagalan, format bukti, manifest/hash, dan jalur rollback | detail pihak ketiga yang hanya diperlukan saat mengubah eksperimen | Apakah hasil dapat direproduksi dan kegagalan dicatat dengan jujur? |
|
||||
|
||||
## Tingkat Kesulitan
|
||||
|
||||
| Tingkat | Bab | Cocok untuk |
|
||||
| --- | :--: | --- |
|
||||
| 🟢 Pemula | Bab 1–2 | Pembaca yang ingin memahami konsep dasar |
|
||||
| 🔵 Menengah | Bab 3–4 | Pembaca dengan dasar pemrograman dan minat pada integrasi sistem |
|
||||
| 🟣 Lanjutan | Bab 5–6 | Pembaca dengan kemampuan pemrograman kuat dan pengalaman desain sistem kompleks |
|
||||
| 🔴 Ahli | Bab 7–8 | Pembaca yang memahami pembelajaran mendalam, pelatihan, atau evolusi mandiri |
|
||||
| 🟠 Terapan | Bab 9–10 | Pembaca yang ingin menggabungkan materi sebelumnya menjadi aplikasi nyata |
|
||||
|
||||
## Saran Praktis
|
||||
|
||||
| # | Saran | Penjelasan |
|
||||
| :--: | --- | --- |
|
||||
| 1 | 🛠️ **Praktik langsung** | Jalankan dan ubah proyek pendamping agar konsep tidak berhenti pada teori |
|
||||
| 2 | 📚 **Padukan dengan naskah** | Baca bab terkait di [`book-id/`](../../book-id/) sambil mengerjakan proyeknya |
|
||||
| 3 | 🔬 **Bandingkan eksperimen** | Gunakan studi ablasi dan eksperimen perbandingan untuk memahami pengaruh setiap komponen |
|
||||
| 4 | 🪜 **Belajar bertahap** | Mulai dari proyek sederhana, kemudian lanjutkan ke sistem yang lebih kompleks |
|
||||
| 5 | 🔌 **Perhatikan protokol** | Proyek server MCP pada Bab 4 menunjukkan mengapa protokol alat terstandar penting bagi Agent yang dapat diperluas |
|
||||
@@ -0,0 +1,119 @@
|
||||
# Memahami AI Agent secara Mendalam: Prinsip Desain dan Praktik Rekayasa
|
||||
|
||||
[](#-buku-elektronik) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-buku-elektronik)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · Bahasa Indonesia ← saat ini · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[Unduh PDF / EPUB](#-buku-elektronik)** (direkomendasikan) — edisi PDF dan EPUB memberikan pengalaman membaca terbaik. Anda juga dapat [membaca secara daring](https://bojieli.github.io/ai-agent-book/) dengan pemilih bahasa, navigasi bab, dan pencarian teks lengkap.
|
||||
|
||||
**Agent = LLM + Konteks + Alat** — buku ini memakai rumus inti tersebut untuk membahas AI Agent, dari prinsip dasar hingga praktik rekayasa, dalam sepuluh bab. Naskah, ilustrasi, dan proyek pendampingnya tersedia sebagai sumber terbuka.
|
||||
|
||||
> 📢 **Perubahan pada versi 2.0 (dibandingkan 1.4):** Versi 2.0 menggabungkan bagian “interaksi asinkron” dari Bab 4 lama dengan materi tentang “Agent multimodal” dari Bab 9 lama, lalu menatanya ulang menjadi Bab 6 baru, “Interaksi: Perluasan Ruang Observasi dan Ruang Aksi”. Bab 6 lama (“Mengevaluasi Agent”), Bab 7 (“Pascapelatihan Model”), dan Bab 8 (“Evolusi Kontinual pada Agent”) masing-masing bergeser satu bab menjadi Bab 7, 8, dan 9.
|
||||
>
|
||||
> Jika Anda membaca PDF lama, sebaiknya [unduh PDF terbaru](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-id.pdf). Edisi baru juga memuat banyak koreksi dan penyesuaian isi; gunakan versi terbaru sebagai acuan.
|
||||
|
||||
| 📚 **10 bab** dari dasar hingga produksi | 📂 **104 proyek** pendamping | 🌐 **14 bahasa**: ZH / EN / ES / ID / AR / zh-TW / RU / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 Buku Elektronik
|
||||
|
||||
> 📥 **Unduh untuk dibaca luring** (lengkap, gratis, dan bersumber terbuka). Tautan berikut selalu menunjuk ke hasil build terbaru dari cabang `main`; versi tetap tersedia di halaman [Releases](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **Bahasa Tionghoa (asli)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **Bahasa Inggris**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **Bahasa Spanyol** (terjemahan komunitas oleh [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Bahasa Indonesia** (terjemahan komunitas oleh [@jojixyz666](https://github.com/jojixyz666)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-id.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-id.epub)
|
||||
> - **Bahasa Tionghoa Tradisional (Taiwan)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **Bahasa Rusia**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Bahasa Tamil**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Bahasa Vietnam**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Bahasa Jepang**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Bahasa Arab**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Bahasa Turki**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Bahasa Korea**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
|
||||
Sumber naskah Bahasa Indonesia berada di [`book-id/`](../../book-id/). Edisi ini merupakan terjemahan komunitas dan mungkin tertinggal dari naskah asli berbahasa Tionghoa.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Ingin membuat PDF / EPUB sendiri?</b> (PDF memerlukan pandoc, XeLaTeX, ElegantBook, dan librsvg)</summary>
|
||||
|
||||
- **EPUB**: Gunakan pembuat bersama; lihat [petunjuk build EPUB](../../EPUB.md)
|
||||
- **Sumber teks**: `book-id/introduction.md`, `book-id/chapter1.md` sampai `book-id/chapter10.md`, dan `book-id/afterword.md`.
|
||||
- **Build**:
|
||||
|
||||
```bash
|
||||
cd book-id && bash build_pdf.sh
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 Ringkasan Isi (Bab 1–10)
|
||||
|
||||
| Bab | Topik | Inti Pembahasan | Naskah | Kode |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Dasar-dasar Agent** | **Agent = LLM + Konteks + Alat**; rekayasa harness merupakan sumber daya saing | [Baca](../../book-id/chapter1.md) | [4](../../chapter1/README.id.md) |
|
||||
| 2 | 🎯 **Rekayasa Konteks** | KV Cache, rekayasa prompt, Agent Skills, dan kompresi konteks | [Baca](../../book-id/chapter2.md) | [8](../../chapter2/README.id.md) |
|
||||
| 3 | 📚 **Memori Pengguna dan Basis Pengetahuan** | Memori lintas sesi, RAG, indeks terstruktur, dan graf pengetahuan | [Baca](../../book-id/chapter3.md) | [12](../../chapter3/README.id.md) |
|
||||
| 4 | 🛠️ **Alat** | MCP, alat persepsi/eksekusi/kolaborasi, Agent asinkron berbasis peristiwa | [Baca](../../book-id/chapter4.md) | [8](../../chapter4/README.id.md) |
|
||||
| 5 | 💻 **Coding Agent dan Pembuatan Kode** | Kode sebagai alat yang dapat membuat alat baru; implementasi Coding Agent tingkat produksi | [Baca](../../book-id/chapter5.md) | [13](../../chapter5/README.id.md) |
|
||||
| 6 | 🎙️ **Interaksi: Perluasan Ruang Observasi dan Ruang Aksi** | Memperluas ruang observasi dan aksi Agent dalam modalitas dan waktu: sistem asinkron dan berbasis peristiwa, suara, Computer Use, dan robotika | [Baca](../../book-id/chapter6.md) | [13](../../chapter6/README.id.md) |
|
||||
| 7 | 🎯 **Mengevaluasi Agent** | Mengubah kinerja menjadi sinyal yang dapat dibandingkan: lingkungan, metrik, signifikansi statistik, dan pemilihan berbasis evaluasi | [Baca](../../book-id/chapter7.md) | [13](../../chapter7/README.id.md) |
|
||||
| 8 | 🧠 **Pascapelatihan Model** | Tiga tahap—prapelatihan, SFT, dan RL: kapan memilih SFT atau RL, internalisasi pemanggilan alat, dan efisiensi sampel | [Baca](../../book-id/chapter8.md) | [19](../../chapter8/README.id.md) |
|
||||
| 9 | 🔄 **Evolusi Kontinual pada Agent** | Mengambil sinyal pembelajaran dari jejak eksekusi dan memperbarui pengetahuan, instruksi, program, serta parameter | [Baca](../../book-id/chapter9.md) | [9](../../chapter9/README.id.md) |
|
||||
| 10 | 🤝 **Kolaborasi Multi-Agent** | Kerangka kolaborasi, berbagi/isolasi konteks, dan kemunculan “masyarakat Agent” | [Baca](../../book-id/chapter10.md) | [8](../../chapter10/README.id.md) |
|
||||
|
||||
> 💡 **Baca** membuka naskah bab di GitHub; angka pada kolom **Kode** membuka daftar proyek pendamping.
|
||||
>
|
||||
> 📚 Untuk jalur belajar yang disarankan, lihat **[Saran Belajar](LEARNING.md)**.
|
||||
|
||||
> 🧪 Status pelaksanaan eksperimen, bukti, dan gerbang penerimaan yang belum terpenuhi dicatat secara terpisah di [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md); mengkloning atau memasang kode sumber tidak membuktikan bahwa eksperimen telah selesai.
|
||||
|
||||
## 📦 Lampiran · Mengambil Repositori Eksternal
|
||||
|
||||
Beberapa eksperimen memakai repositori eksternal yang tidak disertakan langsung karena ukuran dan lisensinya. Perintah berikut mengunci setiap checkout ke revisi yang dapat direproduksi.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Tampilkan 23 perintah checkout</b></summary>
|
||||
|
||||
```bash
|
||||
# Bab 6 · Tolok ukur evaluasi
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world && git -C chapter6/android_world checkout --detach 0e95d641e244504c22087cc29b013f3b2428a261
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA && git -C chapter6/GAIA checkout --detach 682dd723ee1e1697e00360edccf2366dc8418dd9
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld && git -C chapter6/OSWorld checkout --detach 8365edc975efd0477a0d62444a5beed562ab5a7b
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench && git -C chapter6/SWE-bench checkout --detach 5cd4be9fb23971679cbbafe5a0ecade27cef99be
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench && git -C chapter6/tau2-bench checkout --detach 8d005b0e5b9e4af0bc055886fa7f95fc86d1710e
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench && git -C chapter6/terminal-bench checkout --detach 8384a179b1b8688f6ea5233a4d9d51218df1ac96
|
||||
|
||||
# Bab 7 · Kerangka pelatihan
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind && git -C chapter7/MiniMind-pretrain/minimind fetch origin 8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795 && git -C chapter7/MiniMind-pretrain/minimind checkout --detach 8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795 && test "$(git -C chapter7/MiniMind-pretrain/minimind rev-parse HEAD)" = "8bdc5d97d5845a8c1ac2ed56a5b8b4c0d0fb0795"
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v && git -C chapter7/MiniMind-pretrain/minimind-v fetch origin ead791c530fa5f9a3549dbfe9e11ec732d18d2e5 && git -C chapter7/MiniMind-pretrain/minimind-v checkout --detach ead791c530fa5f9a3549dbfe9e11ec732d18d2e5 && test "$(git -C chapter7/MiniMind-pretrain/minimind-v rev-parse HEAD)" = "ead791c530fa5f9a3549dbfe9e11ec732d18d2e5"
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original && git -C chapter7/AdaptThink-original checkout --detach 0033ad172dd53ac64004b763477407014f21b838
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL && git -C chapter7/SFTvsRL checkout --detach fef0a4a3367260a0934be1e40b01e4021698e023
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld && git -C chapter7/AWorld checkout --detach a52d61d6d483e66b22ef16970eae5bbf4f4ab2ec
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl && git -C chapter7/verl checkout --detach 1593fc3a8cf894debdc3dece2a23ed739c282789
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c"
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook && git -C chapter7/tinker-cookbook checkout --detach fc8449187041cf102905f3f751e6d2eac7f9f754
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp && git -C chapter7/RLVP/rlvp fetch origin 1ad30bc7e338911fb733739393d92c420f4d8bee && git -C chapter7/RLVP/rlvp checkout --detach 1ad30bc7e338911fb733739393d92c420f4d8bee && test "$(git -C chapter7/RLVP/rlvp rev-parse HEAD)" = "1ad30bc7e338911fb733739393d92c420f4d8bee"
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL && git -C chapter7/SimpleVLA-RL/SimpleVLA-RL checkout --detach 7c51662df27b586f9e8a1ab35fcf849f2b8852f9
|
||||
|
||||
# Bab 9 · GUI dan robotika
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts && git -C chapter9/claude-quickstarts checkout --detach 9bcc95e316e5ef6542b4c9d0469f4078829eead5
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use && git -C chapter9/browser-use checkout --detach ec9277c5001f2cb78ee419c927775a3cfc227ff8
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6"
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994"
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a"
|
||||
|
||||
# Bab 10 · Arsitektur multi-Agent
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling && git -C chapter10/use-computer-while-calling fetch origin 7d70007f72d45ddfc1a14e8e229b6d444e4919a2 && git -C chapter10/use-computer-while-calling checkout --detach 7d70007f72d45ddfc1a14e8e229b6d444e4919a2 && test "$(git -C chapter10/use-computer-while-calling rev-parse HEAD)" = "7d70007f72d45ddfc1a14e8e229b6d444e4919a2"
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents && git -C chapter10/generative_agents fetch origin fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4 && git -C chapter10/generative_agents checkout --detach fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4 && test "$(git -C chapter10/generative_agents rev-parse HEAD)" = "fe05a71d3e4ed7d10bf68aa4eda6dd995ec070f4"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Kontribusi
|
||||
|
||||
Naskah dan kode pendamping buku ini bersumber terbuka. Koreksi, perbaikan terjemahan, peningkatan proyek, dan ilustrasi yang lebih jelas dipersilakan melalui Pull Request.
|
||||
|
||||
## 📄 Lisensi
|
||||
|
||||
Proyek ini menggunakan [Lisensi Apache 2.0](../../LICENSE). Beberapa subproyek mungkin memiliki lisensinya sendiri; ikuti ketentuan yang tercantum di direktori masing-masing.
|
||||
@@ -0,0 +1,54 @@
|
||||
# 学習のヒント
|
||||
|
||||
← [メイン README に戻る](README.md)
|
||||
|
||||
|
||||
### コアコンセプト: Agent = モデル + コンテキスト + ツール
|
||||
|
||||
本書の中核となるフレームワークは **Agent = モデル + コンテキスト + ツール** です。これら3つの要素が連携し、エージェントの知的な振る舞いを実現します。
|
||||
|
||||
- **モデル**: エージェントの頭脳。理解・推論・意思決定の能力を提供します。
|
||||
- **コンテキスト**: エージェントのオペレーティングシステム。システム指示、対話履歴、推論過程、ツールとのやり取りの記録などを含みます。
|
||||
- **ツール**: エージェントの手。環境を知覚し、アクションを実行し、外界とやり取りできるようにします。
|
||||
|
||||
### 学習パス
|
||||
|
||||
学習パスは本書全体と章ごとに対応しており、3本柱を軸に段階的に展開します。
|
||||
|
||||
- **第1章 · 基礎**: エージェントシステムの完全な認知フレームワークを構築します。強化学習におけるエージェントの定義を理解し、従来の RL と LLM+RL パラダイムのサンプル効率の違いを比較し、「モデルこそがエージェント」という新しいパラダイムを把握し、**Agent = モデル + コンテキスト + ツール** という中核フレームワークを習得します。**キーインサイト**: 事前知識の重要性はアルゴリズムや環境を上回ります。
|
||||
|
||||
- **第2〜3章 · コンテキスト**: コンテキストはエージェントのオペレーティングシステムです。第2章ではシステムプロンプト、KV Cache に配慮した設計、コンテキスト圧縮、プロンプトエンジニアリングのアブレーションを扱います。第3章ではユーザーメモリ、密/疎/ハイブリッド検索、Agentic RAG、コンテキストを踏まえた検索、構造化された知識抽出を扱います。**キーインサイト**: 完全なコンテキストには、システム指示、対話履歴、推論過程、ツールとのやり取りの記録、ユーザーメモリ、外部知識が含まれます。
|
||||
|
||||
- **第4〜5章 · ツール**: ツールはエージェントが世界とやり取りするための架け橋です。第4章では MCP ツールの3種類(知覚/実行/協調)、イベントトリガー、非同期アーキテクチャを扱います。第5章では本番グレードの Coding Agent の完全な実装を掘り下げます。**キーインサイト**: ツールの設計は汎用化すべきです(電卓よりもコードインタプリタが優れています)。コードは新しいツールを生み出すメタ能力です。
|
||||
|
||||
- **第6〜7章 · モデル**: 知能をどのように測定し、増幅するか。第6章では Terminal-Bench、SWE-bench、GAIA、OSWorld、Tau2-Bench などの評価ベンチマークを扱います。第7章では SFT、RL、RLHF、サンプル効率などのポストトレーニング技術を扱います。**キーインサイト**: 独立した検証シグナルは「モデルにもう一度考えさせる」よりも信頼できます。「モデルこそがエージェント」は、RL を通じてツール呼び出しをネイティブな能力として内在化させます。
|
||||
|
||||
- **第8章 · 自己進化**: 重みを変えずに経験から成長できるエージェントを実現します。経験学習、ワークフローのツール化、プロンプトや観察のパラメータへの蒸留などです。**キーインサイト**: 経験からの学習は、エージェントが「賢い」から「熟練している」へと移行するための鍵です。
|
||||
|
||||
- **第9〜10章 · 拡張と協調**: 第9章では知覚とアクションをテキストから音声、GUI、物理世界へと拡張します。第10章ではマルチエージェントの分業によって複雑なタスクに対処します。**キーインサイト**: マルチエージェントシステムにおけるあらゆる設計上の判断は、単一エージェントの3要素の中に対応物を見出すことができます。
|
||||
|
||||
## 本文と実験の分担
|
||||
|
||||
本書は特定 SDK の手順書ではありません。短い pseudocode と skeleton は状態の流れ、停止点、検証境界を示し、章ごとの実験が完全な実装、adapter、テスト、ログ、証拠を提供します。
|
||||
|
||||
| レイヤー | まず読む | いったん飛ばす | 答える問い |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | プロジェクト README:目的・最小コマンド・受け入れ条件、および対応する本文の skeleton | 認証情報、UI、プロバイダーアダプター、長い生ログ | この実験が示す mechanism は何か? |
|
||||
| **Builder** | エントリーポイント、コア・ループ、状態/メッセージ schema、ツール、検証器 | メカニズムに関係しない互換性・デプロイ層 | どの変数が挙動を変えたか? |
|
||||
| **Maintainer** | テスト、失敗処理、証拠形式、manifest/hash、ロールバック経路 | 実験を変更するときだけ必要なサードパーティー詳細 | 結果は再現でき、失敗は正直に記録されているか? |
|
||||
|
||||
### 難易度レベル
|
||||
|
||||
- **入門**(第1〜2章): 初心者に適しており、基本概念を理解します。
|
||||
- **中級**(第3〜4章): ある程度のプログラミングの基礎が必要で、システム統合を含みます。
|
||||
- **上級**(第5〜6章): 高いプログラミング能力が必要で、複雑なシステム設計を含みます。
|
||||
- **エキスパート**(第7〜8章): 深層学習と訓練/自己進化の経験が必要です。
|
||||
- **応用**(第9〜10章): これまでの知識を総合的に応用し、実用的なアプリケーションを構築します。
|
||||
|
||||
### 実践のヒント
|
||||
|
||||
1. **手を動かして実践する**: 各プロジェクトは独立して実行できるように設計されています。自分でコードを実行し、変更してみることをおすすめします。
|
||||
2. **本書と組み合わせる**: 本リポジトリの [`book-ja/`](../../book-ja/) ディレクトリ(日本語)または [`book/`](../../book/) ディレクトリ(中国語原版)で対応する章を読み、理論と実践の組み合わせを理解しましょう。
|
||||
3. **実験による比較**: 多くのプロジェクトにはアブレーション研究や比較実験が含まれています。比較を通じて理解を深めましょう。
|
||||
4. **段階的な学習**: シンプルなプロジェクトから始め、徐々に複雑なシステムへと踏み込みましょう。
|
||||
5. **プロトコルに注目する**: 第4章の MCP サーバープロジェクトは、標準化されたツールプロトコルを示しています。これはスケーラブルなエージェントを構築する鍵です。
|
||||
@@ -0,0 +1,185 @@
|
||||
# AI Agent 徹底解説: 設計原理とエンジニアリング実践
|
||||
|
||||
[](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-電子書籍) [](#-電子書籍)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · 日本語 ← 現在 · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
**Agent = LLM + コンテキスト + ツール** — 本書はこの中核となる公式を軸に、全10章を通じて AI エージェントを原理からエンジニアリング実践まで解説します。本文、図版、**93 個の付随実験**はすべてオープンソースです。ぜひ自分の手で実験を動かしてみてください。
|
||||
|
||||
> 📢 **バージョン2.0の変更点(1.4との比較):** 2.0では、旧第4章の「非同期インタラクション」部分と、旧第9章の「マルチモーダルAgent」に関する内容を統合し、新しい第6章「交互:観察空間と動作空間の拡張」として再構成しました。旧第6章「Agent の評価」、第7章「モデルのポストトレーニング」、第8章「Agent の継続的進化」はそれぞれ1章ずつ後ろに移り、現在は順に第7章、第8章、第9章となっています。
|
||||
>
|
||||
> 古いPDFをお読みの場合は、[最新版のPDFをダウンロード](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf)することをお勧めします。新版には内容の修正や調整も数多く含まれるため、最新版をご利用ください。
|
||||
|
||||
| 📚 基礎から本番まで **10 章** の本文 | 📂 **93 個** の付随プロジェクト(70 個以上が単独実行可能) | 🌐 **14 言語**: 中 / 英 / 西 / インドネシア / アラビア / 繁體中文(台灣) / 露 / タミル / 越 / 日 / 土 / 韓 / ハンガリー / ヘブライ |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 電子書籍
|
||||
|
||||
> 📥 **ダウンロード**(全文、無料でオープンソース)。以下のリンクは常に `main` ブランチの最新ビルドを指します。固定版は [Releases](https://github.com/bojieli/ai-agent-book/releases) ページを参照してください。
|
||||
> - **中国語(原版)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **英語**(コミュニティ翻訳、[@nsdevaraj](https://github.com/nsdevaraj)、[@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **スペイン語**(コミュニティ翻訳、[@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **アラビア語**(コミュニティ翻訳、[@TheSyBuilder](https://github.com/TheSyBuilder)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **繁体字中国語(台湾)**(コミュニティ翻訳、[@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **ロシア語**(コミュニティ翻訳、[@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **タミル語**(コミュニティ翻訳、[@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **ベトナム語**(コミュニティ翻訳、[@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **日本語**(コミュニティ翻訳、[@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **トルコ語**(コミュニティ翻訳、[@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **韓国語**(コミュニティ翻訳、[@JeongJaeSoon](https://github.com/JeongJaeSoon)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
|
||||
中国語の本文ソースは [`book/`](../../book/) にあります。英語/スペイン語/アラビア語/繁体字中国語(台湾)/ロシア語/タミル語/ベトナム語/日本語/トルコ語/韓国語版はコミュニティによる貢献であり(中国語原版より遅れる場合があります)、それぞれ [`book-en/`](../../book-en/)、[`book-es/`](../../book-es/)、[`book-ar/`](../../book-ar/)、[`book-zhtw/`](../../book-zhtw/)、[`book-ru/`](../../book-ru/)、[`book-ta/`](../../book-ta/)、[`book-vi/`](../../book-vi/)、[`book-ja/`](../../book-ja/)、[`book-tr/`](../../book-tr/)、[`book-ko/`](../../book-ko/) にあります。
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 自分で PDF / EPUB をビルドしますか?</b>(PDF には pandoc / xelatex / ElegantBook が必要)</summary>
|
||||
|
||||
- **EPUB**: 共通のビルドスクリプトを使用します。[EPUB ビルド手順](../../EPUB.md) を参照してください
|
||||
- **アラビア語 PDF**: `cd book-ar && bash build_pdf.sh` でビルドできます
|
||||
- **本文ソース**: `book/introduction.md`(引言)、`book/chapter1.md` ~ `book/chapter10.md`(第1〜10章)、`book/afterword.md`(後記)
|
||||
- **ビルド**: pandoc、xelatex、ElegantBook ドキュメントクラスと必要なフォントをインストールしてから、次を実行します
|
||||
|
||||
```bash
|
||||
cd book && bash build_pdf.sh
|
||||
```
|
||||
|
||||
図版は SVG ファイルとして `book/images/` に保存され、ビルド時に直接使用されます。組版の詳細は `book/preamble.tex` と `book/*.lua` を参照してください。
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 内容早わかり(第1〜10章)
|
||||
|
||||
本書は中核となる公式 **Agent = LLM + コンテキスト + ツール** を軸に展開し、10章が段階的に積み上がります。
|
||||
|
||||
| 章 | テーマ | 一言でいうと | 本文 | コード |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Agent の基礎知識** | 「モデルこそが Agent」というパラダイム + **Agent = LLM + コンテキスト + ツール**。Harness エンジニアリングこそが真の競争力 | [読む](../../book-ja/chapter1.ja.md) | [4](../../chapter1/README.ja.md) |
|
||||
| 2 | 🎯 **コンテキストエンジニアリング** | コンテキストが能力の上限を決める: KV Cache、プロンプトエンジニアリング、Agent Skills、コンテキスト圧縮 | [読む](../../book-ja/chapter2.ja.md) | [9](../../chapter2/README.ja.md) |
|
||||
| 3 | 📚 **ユーザーメモリと知識ベース** | セッションをまたいでユーザーを記憶し、外部知識を接続する: ユーザーメモリ、RAG、構造化インデックス、ナレッジグラフ | [読む](../../book-ja/chapter3.ja.md) | [12](../../chapter3/README.ja.md) |
|
||||
| 4 | 🛠️ **ツール** | ツールは Agent の両手: MCP プロトコル、知覚/実行/協調の3種類のツール、イベント駆動の非同期 Agent、能動的なツール発見 | [読む](../../book-ja/chapter4.ja.md) | [8](../../chapter4/README.ja.md) |
|
||||
| 5 | 💻 **Coding Agent とコード生成** | コードは「新しいツールを生み出せるツール」。本番グレードの Coding Agent の全体像 | [読む](../../book-ja/chapter5.ja.md) | [13](../../chapter5/README.ja.md) |
|
||||
| 6 | 🎙️ **交互:観察空間と動作空間の拡張** | モダリティと時間の両面から Agent の観察・動作空間を拡張する:非同期・イベント駆動システム、音声、Computer Use、ロボティクス | [読む](../../book-ja/chapter6.ja.md) | [13](../../chapter6/README.ja.md) |
|
||||
| 7 | 🎯 **Agent の評価** | パフォーマンスを比較可能なシグナルに変える:評価環境、指標、統計的有意性、評価駆動の選定 | [読む](../../book-ja/chapter7.ja.md) | [13](../../chapter7/README.ja.md) |
|
||||
| 8 | 🧠 **モデルのポストトレーニング** | 事前学習、SFT、RL の3段階:いつ SFT または RL を選ぶか、ツール呼び出しの内在化、サンプル効率 | [読む](../../book-ja/chapter8.ja.md) | [19](../../chapter8/README.ja.md) |
|
||||
| 9 | 🔄 **Agent の継続的進化** | 実行軌跡から学習シグナルを得て、知識、指示、プログラム、パラメータを更新する | [読む](../../book-ja/chapter9.ja.md) | [9](../../chapter9/README.ja.md) |
|
||||
| 10 | 🤝 **マルチ Agent 協調** | 集合知は個を上回る: 協調フレームワーク、コンテキストの共有/隔離、創発する「Agent 社会」 | [読む](../../book-ja/chapter10.ja.md) | [6](../../chapter10/README.ja.md) |
|
||||
|
||||
> 💡 **読む** = GitHub 上で章の本文(markdown)を読む。**N** = その章の付随プロジェクト数。クリックでコードを表示。プロジェクトの種類(✅ 単独実行 / 📖 再現 / 🚧 設計)は各章の README で説明しています。
|
||||
>
|
||||
> 📚 本書を効率的に読むには? **[学習のヒント](LEARNING.md)**(中核となる考え方、学習パス、難易度レベル、実践のヒント)を参照してください。
|
||||
|
||||
## 💻 付属実験を実行する
|
||||
|
||||
共通の対応範囲は **Python 3.11~3.13** です。リポジトリのルートで章ごとに依存関係をインストールします。別の章では `ch1` を `ch2` ~ `ch10` に置き換えてください。
|
||||
|
||||
```bash
|
||||
# 推奨:コミット済みの uv.lock を使用し、再現可能な章別環境を構築
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# uv を使わない場合:pip で pyproject.toml から再解決
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
モデルを呼び出す実験を実行する前に、その実験の README に従って認証情報を設定してください。ルート設定に対応する実験では `.env.example` を `.env` にコピーして少なくとも1つの provider key を入力できますが、一部の実験では実験ディレクトリ内の `.env` または環境変数の export が必要です。ローカル Ollama と `--provider ollama` は、その実験の README または CLI が明示している場合にのみ使用してください。
|
||||
|
||||
インストール後はリポジトリのルートから実験を実行できます。
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# pip でインストールした場合:python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- `uv` の導入方法は[公式ガイド](https://docs.astral.sh/uv/getting-started/installation/)を参照してください。`pip` も引き続き利用できますが、ロックファイルは使用しません。
|
||||
- 移行期間中は各実験の `requirements.txt` も引き続きサポートします。単独プロジェクトや特殊なバージョン制約に適しています。
|
||||
- `all` は CPU 向けの広範な構成であり、すべての実験を含むわけではありません。`uv sync` は毎回現在の選択に正確に同期するため、特殊な extra は同じコマンドにまとめてください。例: `uv sync --locked --extra ch2 --extra vllm` または `uv sync --locked --extra ch7 --extra unsloth`。pip では `python -m pip install -e ".[ch2,vllm]"` です。
|
||||
- ブラウザ、CUDA、FFmpeg、Ollama、Playwright ブラウザ、外部リポジトリなどのシステム依存関係は各実験の README に従ってください。第8章の一部の同梱サードパーティコンポーネントには Python 3.12 以上が必要です。
|
||||
|
||||
## 🔑 API キー
|
||||
|
||||
学習を円滑に進めるため、いくつかのプラットフォームで API キーを申請することをおすすめします。モデル選定については [このガイド](https://01.me/2025/07/llm-api-setup/) を参照してください。
|
||||
|
||||
| プラットフォーム | リンク | 備考 |
|
||||
| --- | --- | --- |
|
||||
| **Kimi**(Moonshot) | <https://platform.moonshot.cn/> | Kimi シリーズ。長文コンテキストと Agent 能力に強い |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6 など。中国語能力が高くコストパフォーマンスに優れる |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | さまざまなオープンソースモデル(DeepSeek、Qwen など) |
|
||||
| **Volcano Engine** | <https://www.volcengine.com/product/ark> | ByteDance Doubao(クローズドソース)。中国国内で低レイテンシ |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | Gemini / Claude / GPT-5 などにワンストップでアクセス(公式 API は海外 IP/決済が必要。OpenAI は海外での本人確認も必要) |
|
||||
|
||||
> 🧪 実験の実行状況、証拠、未達の受け入れ条件は [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md) で別途管理しています。ソースコードの clone やインストールだけでは実験完了の証明になりません。
|
||||
|
||||
## 📦 付録 · 外部リポジトリの取得
|
||||
|
||||
第6・7・9・10章のベンチマーク、訓練フレームワーク、ロボットプラットフォーム向けの23個の外部リポジトリは(サイズとライセンスの都合上)**同梱されていません**。対応するディレクトリに clone する必要があります。
|
||||
|
||||
### 一括 clone スクリプト
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 clone コマンドを展開</b>(23個の外部リポジトリ)</summary>
|
||||
|
||||
```bash
|
||||
# 第6章 · 評価ベンチマーク
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# 第7章 · 訓練フレームワーク(bojieli/* は書籍向けに調整された fork)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # 実験 7-3 LLM をゼロから訓練
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # 実験 7-4 VLM をゼロから訓練(投影層)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # 実験 7-14 RLVP 論文コード
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # 実験 7-13 vision-language-action RL
|
||||
|
||||
# 第9章 · ブラウザ自動化と Claude サンプル
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# 第10章 · デュアル Agent アーキテクチャ(現在は独立した TalkAct プロジェクト)+ Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # 実験 10-5 Stanford AI Town
|
||||
```
|
||||
|
||||
> プロジェクトの README が特定のコミットを指定している場合は、再現性のためにそのバージョンへ `git checkout` してください。第10章の `use-computer-while-calling` は独立して保守される [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct) へと発展しました。本リポジトリにはポインタのドキュメントのみを残しています。
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 コントリビュート
|
||||
|
||||
本書と付随コードは完全にオープンソースです。Pull Request を大歓迎します。
|
||||
|
||||
| 種類 | 備考 |
|
||||
| --- | --- |
|
||||
| 📝 **本文の内容** | 誤字修正、加筆、より分かりやすい表現、あるいは新しい動向(本文は `book/chapter*.md`) |
|
||||
| 🐛 **コードの改善とバグ修正** | 付随プロジェクトをより堅牢に、使いやすく、本番対応にする |
|
||||
| 🧪 **新しい実践プロジェクト** | 実験のより良い実装を追加/置換、あるいは新しいサンプルを提供 |
|
||||
| 🎨 **図版の設計** | `book/images/` にコミット済みの SVG 図版を直接改善する |
|
||||
| 🌐 **新しい翻訳** | より多くの言語への翻訳を歓迎します。英語(`book-en/`)、アラビア語(`book-ar/`)、繁体字中国語/台湾(`book-zhtw/`)、ロシア語(`book-ru/`)、タミル語(`book-ta/`)、ベトナム語(`book-vi/`)、日本語(`book-ja/`)、トルコ語(`book-tr/`)、韓国語(`book-ko/`)を参考にしてください |
|
||||
|
||||
提出前に、該当する実験を実行して再現性を確認してください。まず issue を立ててアイデアを議論するのも歓迎です。
|
||||
|
||||
## 📄 ライセンス
|
||||
|
||||
本プロジェクトは [Apache License 2.0](../../LICENSE) の下でライセンスされています。詳細は [`LICENSE`](../../LICENSE) ファイルを参照してください。一部のサブプロジェクトには独自のライセンス情報が含まれる場合があります。詳しくは各サブプロジェクトを参照してください。
|
||||
|
||||
## ⭐ Star 履歴
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>[`scripts/gen_star_history.py`](../../scripts/gen_star_history.py) によって生成され、[GitHub Actions](../../.github/workflows/star-history.yml) によって毎日更新されます · 画像をクリックするとライブデータを表示</sub>
|
||||
@@ -0,0 +1,55 @@
|
||||
# 학습 가이드
|
||||
|
||||
← [한국어 메인 README로 돌아가기](README.md)
|
||||
|
||||
## 핵심 개념: 에이전트 = LLM + 컨텍스트 + 도구
|
||||
|
||||
이 책의 핵심 틀은 **에이전트 = LLM + 컨텍스트 + 도구**입니다. 세 요소가 함께 작동해 에이전트의 지능적 행동을 구현합니다.
|
||||
|
||||
| 요소 | 비유 | 역할 |
|
||||
| :--: | :--: | --- |
|
||||
| 🧠 **LLM** | 두뇌 | 이해, 사고(reasoning), 의사결정 능력을 제공합니다. |
|
||||
| 💾 **컨텍스트** | 운영체제 | 시스템 지침, 대화 기록, 사고 과정, 도구 상호작용 기록 등을 담습니다. |
|
||||
| 🤲 **도구** | 양손 | 환경을 인식하고 작업을 실행하며 외부 세계와 상호작용합니다. |
|
||||
|
||||
## 학습 경로
|
||||
|
||||
이 책은 ‘모델 / 컨텍스트 / 도구’라는 세 축을 중심으로 단계별로 전개됩니다. 각 부분에서 얻을 수 있는 핵심 통찰은 다음과 같습니다.
|
||||
|
||||
| 부분 | 장 | 주요 내용 | 핵심 통찰 |
|
||||
| --- | :--: | --- | --- |
|
||||
| **기초** | 제1장 | 강화 학습에서의 에이전트 정의, 전통적 RL과 LLM+RL의 샘플 효율성 비교, ‘모델이 곧 에이전트’라는 새로운 패러다임 | 사전 지식의 중요성은 알고리즘과 환경을 뛰어넘습니다. |
|
||||
| **컨텍스트** | 제2~3장 | 시스템 프롬프트, KV Cache, 컨텍스트 압축, 프롬프트 엔지니어링, 사용자 메모리, 밀집/희소/하이브리드 검색, Agentic RAG | 완전한 컨텍스트 = 시스템 지침 + 대화 기록 + 사고 과정 + 도구 상호작용 기록 + 사용자 메모리 + 외부 지식 |
|
||||
| **도구** | 제4~5장 | 세 가지 유형의 MCP 도구(인식/실행/협업), 이벤트 기반 비동기 아키텍처, 프로덕션급 코딩 에이전트의 전체 구현 | 도구는 범용적으로 설계해야 하며(계산기보다 코드 인터프리터가 낫습니다), 코드는 새로운 도구를 만드는 메타 역량입니다. |
|
||||
| **평가와 진화** | 제6~8장 | 에이전트 평가, SFT와 RL, 실행 궤적의 신호를 바탕으로 지식·지침·프로그램·파라미터 갱신 | 학습에 앞서 신뢰할 수 있는 신호를 확보해야 합니다. 갱신 매체는 역량을 어떻게 표현하고 검증할 수 있는지에 따라 달라집니다. |
|
||||
| **확장과 협업** | 제9~10장 | 음성/GUI/물리 세계를 아우르는 멀티모달 상호작용, 멀티 에이전트의 분업과 협업 | 멀티 에이전트의 모든 설계 결정은 단일 에이전트의 세 요소와 대응시킬 수 있습니다. |
|
||||
|
||||
## 본문과 실험의 역할 분담
|
||||
|
||||
이 책은 특정 SDK의 단계별 튜토리얼이 아닙니다. 짧은 pseudocode와 skeleton은 상태 흐름·중지 지점·검증 경계를 설명하고, 장별 실험은 완전한 구현·adapter·테스트·로그·증거를 제공합니다.
|
||||
|
||||
| 계층 | 먼저 읽기 | 우선 건너뛰기 | 답하는 질문 |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | 프로젝트 README: 목표·최소 명령·인수 조건과 대응하는 본문 skeleton | 자격 증명, UI, provider adapter, 긴 원시 로그 | 이 실험이 증명하려는 메커니즘은 무엇인가? |
|
||||
| **Builder** | 진입점, 핵심 루프, state/message schema, tool, verifier | 메커니즘과 무관한 호환성/배포 계층 | 어떤 변수가 동작을 바꾸었는가? |
|
||||
| **Maintainer** | 테스트, 실패 처리, 증거 형식, manifest/hash, 롤백 경로 | 실험을 수정할 때만 필요한 서드파티 세부 사항 | 결과를 재현할 수 있고 실패가 정직하게 기록되었는가? |
|
||||
|
||||
## 난이도
|
||||
|
||||
| 수준 | 장 | 추천 독자 |
|
||||
| --- | :--: | --- |
|
||||
| 🟢 입문 | 제1~2장 | 기본 개념을 익히려는 초심자 |
|
||||
| 🔵 중급 | 제3~4장 | 프로그래밍 기초가 있고 시스템 통합을 배우려는 독자 |
|
||||
| 🟣 고급 | 제5~6장 | 프로그래밍 역량이 높고 복잡한 시스템 설계를 다루려는 독자 |
|
||||
| 🔴 전문가 | 제7~8장 | 딥러닝 및 모델 훈련·자기 진화 경험이 있는 독자 |
|
||||
| 🟠 응용 | 제9~10장 | 앞에서 배운 내용을 종합해 실제 애플리케이션을 만들려는 독자 |
|
||||
|
||||
## 실습 팁
|
||||
|
||||
| # | 팁 | 설명 |
|
||||
| :--: | --- | --- |
|
||||
| 1 | 🛠️ **직접 실습하기** | ✅ 프로젝트는 독립적으로 실행할 수 있습니다. 📖 프로젝트는 외부 저장소나 재현 가이드를 따르고, 🚧 프로젝트는 설계 문서이거나 아직 작업 중입니다. 각 장의 README에서 유형을 확인한 뒤 코드를 직접 실행하고 수정해 보세요. |
|
||||
| 2 | 📚 **책과 함께 보기** | 한국어판 [`book-ko/`](../../book-ko/)에서 해당 장을 함께 읽으며 이론과 실습의 연결을 이해해 보세요. 표현이 모호할 때는 영어판 [`book-en/`](../../book-en/)이나 중국어 원문 [`book/`](../../book/)도 함께 참고할 수 있습니다. |
|
||||
| 3 | 🔬 **실험으로 비교하기** | 여러 프로젝트에 구성 요소 제거 실험(어블레이션)과 비교 실험이 포함되어 있습니다. 결과를 비교하며 이해를 넓혀 보세요. |
|
||||
| 4 | 🪜 **단계적으로 학습하기** | 간단한 프로젝트에서 시작해 점차 복잡한 시스템으로 나아가세요. |
|
||||
| 5 | 🔌 **프로토콜에 주목하기** | 제4장의 MCP 서버 프로젝트는 표준화된 도구 프로토콜을 보여 줍니다. 이는 확장 가능한 에이전트를 만드는 핵심입니다. |
|
||||
@@ -0,0 +1,165 @@
|
||||
# AI 에이전트를 깊이 이해하기: 설계 원리와 엔지니어링 실전
|
||||
|
||||
[](#-전자책) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-전자책)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · 한국어 ← 현재 · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[PDF / EPUB 다운로드](#-전자책)**(권장) — PDF와 EPUB 판본에서 가장 좋은 읽기 경험을 제공합니다. [온라인 판본](https://bojieli.github.io/ai-agent-book/)에서는 언어 전환, 접을 수 있는 장별 탐색, 전체 텍스트 검색을 이용할 수 있습니다.
|
||||
|
||||
**에이전트 = LLM + 컨텍스트 + 도구** — 이 책은 이 핵심 공식을 중심으로 10개 장에 걸쳐 AI 에이전트의 원리부터 엔지니어링 실전까지 설명합니다. 본문과 그림, **94개의 연계 실습**을 모두 오픈 소스로 공개합니다.
|
||||
|
||||
> 📢 **1.4 대비 2.0 버전의 변경 사항:** 2.0 버전은 기존 4장의 “비동기 상호작용” 부분과 기존 9장의 “멀티모달 에이전트” 내용을 합쳐, 새로운 6장 “상호작용: 관찰 공간과 행동 공간의 확장”으로 재구성했습니다. 기존 6장 “에이전트 평가”, 7장 “모델 사후 학습”, 8장 “에이전트의 지속적 진화”는 각각 한 장씩 뒤로 이동하여 현재 7장, 8장, 9장이 되었습니다.
|
||||
>
|
||||
> 이전 PDF를 읽고 계시다면 [최신 PDF를 다운로드](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf)하시기를 권장합니다. 신판에는 많은 내용 수정과 조정도 포함되어 있으므로 최신 버전을 이용해 주세요.
|
||||
|
||||
| 📚 기초부터 프로덕션까지 **10개 장** | 📂 **94개** 연계 실습(로컬 프로젝트와 외부 재현 트랙 포함) | 🌐 **14개 언어**: 중 / 영 / 스페인 / 인도네시아 / 아랍 / 번체 중국어(대만) / 러 / 타밀 / 베트남 / 일 / 터키 / 한 / 헝가리 / 히브리 |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 전자책
|
||||
|
||||
> 📥 **다운로드**(전체 본문, 무료·오픈 소스). 아래 링크는 항상 `main` 브랜치의 최신 빌드를 가리킵니다. 고정 버전은 [Releases](https://github.com/bojieli/ai-agent-book/releases)에서 확인할 수 있습니다.
|
||||
> - **한국어**(커뮤니티 번역, [@JeongJaeSoon](https://github.com/JeongJaeSoon)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
> - **중국어 원문**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **영어**([@nsdevaraj](https://github.com/nsdevaraj), [@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **스페인어**(커뮤니티 번역, [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **번체 중국어(대만)**([@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **러시아어**([@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **타밀어**([@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **베트남어**([@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **일본어**([@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **아랍어**([@TheSyBuilder](https://github.com/TheSyBuilder)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **터키어**([@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
>
|
||||
> 🌐 [온라인으로도 읽을 수 있습니다](https://bojieli.github.io/ai-agent-book/). `main` 브랜치가 갱신될 때마다 사이트가 자동으로 다시 빌드됩니다.
|
||||
|
||||
중국어 원문은 [`book/`](../../book/)에 있으며, 한국어판은 [`book-ko/`](../../book-ko/)에 있습니다. 다른 언어판은 각 언어 디렉터리에 있는 커뮤니티 번역으로, 중국어 원문보다 갱신이 늦을 수 있습니다.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 PDF / EPUB를 직접 빌드하려면?</b> (PDF는 pandoc / xelatex / ElegantBook 필요)</summary>
|
||||
|
||||
- **EPUB**: 공통 빌더를 사용합니다. 자세한 내용은 [EPUB 빌드 안내](../../EPUB.md)를 참고하세요
|
||||
- **본문 소스**: `book-ko/introduction.ko.md`, `book-ko/chapter1.ko.md` ~ `book-ko/chapter10.ko.md`, `book-ko/afterword.ko.md`
|
||||
- **빌드**: pandoc, xelatex, ElegantBook 문서 클래스와 Noto CJK KR 글꼴을 설치한 뒤 다음을 실행합니다.
|
||||
|
||||
```bash
|
||||
cd book-ko && bash build_pdf.sh
|
||||
```
|
||||
|
||||
그림은 `book-ko/images/`의 SVG 파일을 사용합니다. 조판 설정은 `book-ko/preamble.tex`와 `book-ko/*.lua`에서 확인할 수 있습니다.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 한눈에 보는 구성
|
||||
|
||||
| 장 | 주제 | 핵심 내용 | 본문 | 코드 |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **AI 에이전트 기초** | **에이전트 = LLM + 컨텍스트 + 도구**. 경쟁력의 핵심은 하네스 엔지니어링 | [읽기](../../book-ko/chapter1.ko.md) | [4](../../chapter1/README.ko.md) |
|
||||
| 2 | 🎯 **컨텍스트 엔지니어링** | KV Cache, 프롬프트 엔지니어링, Agent Skills, 컨텍스트 압축 | [읽기](../../book-ko/chapter2.ko.md) | [8](../../chapter2/README.ko.md) |
|
||||
| 3 | 📚 **사용자 메모리와 지식 베이스** | 세션 간 사용자 메모리, RAG, 구조화 색인, 지식 그래프 | [읽기](../../book-ko/chapter3.ko.md) | [12](../../chapter3/README.ko.md) |
|
||||
| 4 | 🛠️ **도구** | MCP, 인식·실행·협업 도구, 이벤트 기반 비동기 에이전트, 능동적 도구 탐색 | [읽기](../../book-ko/chapter4.ko.md) | [8](../../chapter4/README.ko.md) |
|
||||
| 5 | 💻 **코딩 에이전트와 코드 생성** | 코드는 새 도구를 만들 수 있는 도구. 프로덕션급 코딩 에이전트의 전체 구조 | [읽기](../../book-ko/chapter5.ko.md) | [13](../../chapter5/README.ko.md) |
|
||||
| 6 | 🎙️ **상호작용: 관찰 공간과 행동 공간의 확장** | 모달리티와 시간 차원에서 에이전트의 관찰·행동 공간을 확장: 비동기·이벤트 기반 시스템, 음성, Computer Use, 로보틱스 | [읽기](../../book-ko/chapter6.ko.md) | [13](../../chapter6/README.ko.md) |
|
||||
| 7 | 🎯 **에이전트 평가** | 성능을 비교 가능한 신호로 전환: 평가 환경, 지표, 통계적 유의성, 평가 기반 선택 | [읽기](../../book-ko/chapter7.ko.md) | [13](../../chapter7/README.ko.md) |
|
||||
| 8 | 🧠 **모델 사후 학습** | 사전 학습·SFT·RL의 세 단계: SFT와 RL의 선택, 도구 호출 내재화, 샘플 효율성 | [읽기](../../book-ko/chapter8.ko.md) | [19](../../chapter8/README.ko.md) |
|
||||
| 9 | 🔄 **에이전트의 지속적 진화** | 실행 궤적에서 학습 신호를 얻고 지식·지침·프로그램·파라미터를 갱신 | [읽기](../../book-ko/chapter9.ko.md) | [9](../../chapter9/README.ko.md) |
|
||||
| 10 | 🤝 **멀티 에이전트 협업** | 협업 구조, 컨텍스트 공유와 격리, 에이전트 사회 | [읽기](../../book-ko/chapter10.ko.md) | [8](../../chapter10/README.ko.md) |
|
||||
|
||||
> 💡 **읽기**는 GitHub에서 장 본문을 여는 링크이며, **N**은 해당 장의 연계 프로젝트 수입니다. 프로젝트 유형(✅ 독립 실행 / 📖 재현 가이드 / 🚧 진행 중)은 각 장의 README에 설명되어 있습니다.
|
||||
>
|
||||
> 📚 효율적인 학습 순서는 **[학습 가이드](LEARNING.md)**에서 확인하세요.
|
||||
|
||||
## 🔑 API 키
|
||||
|
||||
실습을 원활하게 진행하려면 몇 가지 플랫폼의 API 키를 준비하는 편이 좋습니다. 모델 선택은 [이 안내](https://01.me/2025/07/llm-api-setup/)를 참고하세요.
|
||||
|
||||
| 플랫폼 | 링크 | 비고 | 접속 지역 |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | 긴 컨텍스트와 에이전트 기능에 강한 Kimi 계열 | 중국 본토 |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6 등, 중국어 성능과 비용 효율이 좋음 | 중국 본토 |
|
||||
| **SiliconFlow** | <https://siliconflow.cn/> | DeepSeek, Qwen 등 여러 오픈 소스 모델 | 중국 본토 |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | DeepSeek 공식 API | 글로벌·중국 본토 |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | 주요 글로벌·중국 모델을 한곳에서 제공 | 글로벌·중국 본토 |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | GPT, Claude, Gemini, Kimi, GLM, DeepSeek, Qwen 등을 한곳에서 제공 | 글로벌 |
|
||||
|
||||
## 💎 후원
|
||||
|
||||
이 프로젝트를 후원하는 **Krill AI**에 감사드립니다. Krill은 GPT, Claude, Gemini와 여러 중국 모델을 위한 안정적인 API 중계 서비스, 기업 맞춤 지원, 전용 WebSocket 연결을 제공합니다.
|
||||
|
||||
이 책의 독자는 [이 링크](https://www.krill-ai.net/register?invite=Q8D3L35725)로 가입하고 충전할 때 프로모션 코드 `ai-agent-book`을 입력하면 첫 Codex 플랜을 23% 할인받을 수 있습니다.
|
||||
|
||||
> 🧪 실험 실행 상태, 증거, 미충족 승인 조건은 [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md)에서 별도로 관리합니다. 소스 코드를 복제하거나 설치한 것만으로는 실험 완료를 입증할 수 없습니다.
|
||||
|
||||
## 📦 부록 · 외부 저장소 가져오기
|
||||
|
||||
제6·7·9·10장의 벤치마크, 학습 프레임워크, 로봇 플랫폼에 쓰이는 외부 저장소 23개는 크기와 라이선스 문제로 이 저장소에 포함되어 있지 않습니다.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 clone 명령 펼치기</b> (외부 저장소 23개)</summary>
|
||||
|
||||
```bash
|
||||
# 제6장 · 평가 벤치마크
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# 제7장 · 학습 프레임워크(bojieli/*는 책에 맞춘 fork)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # 실험 7-15 코드 샌드박스
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL
|
||||
|
||||
# 제9장 · 브라우저 자동화와 Claude 예제
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# 제10장 · 듀얼 에이전트 구조와 Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents
|
||||
```
|
||||
|
||||
> `SandboxFusion` 명령은 재현성을 위해 고정된 커밋 SHA를 detached HEAD 상태로 체크아웃하고, 실제 HEAD가 해당 SHA와 일치하는지 확인합니다. 다른 프로젝트 README가 특정 커밋을 지정한다면 해당 버전으로 `git checkout`하세요. 제10장의 `use-computer-while-calling`은 독립 프로젝트 [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct)로 발전했습니다.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 기여하기
|
||||
|
||||
책과 연계 코드는 모두 오픈 소스이며 Pull Request를 환영합니다.
|
||||
|
||||
| 유형 | 내용 |
|
||||
| --- | --- |
|
||||
| 📝 **본문** | 오탈자 수정, 보충 설명, 더 명확한 표현, 최신 동향 반영 |
|
||||
| 🐛 **코드 개선과 버그 수정** | 연계 프로젝트의 견고성·사용성·프로덕션 적합성 개선 |
|
||||
| 🧪 **새 실습 프로젝트** | 더 나은 구현을 추가하거나 기존 구현을 대체 |
|
||||
| 🎨 **그림** | `book-ko/images/`의 한국어 SVG 그림 개선 |
|
||||
| 🌐 **새 번역** | 기존 언어판의 디렉터리 구성을 참고해 새 번역 추가 |
|
||||
|
||||
제출하기 전에 관련 실험을 직접 실행해 재현 가능성을 확인해 주세요. 아이디어를 먼저 Issue로 논의하는 것도 환영합니다.
|
||||
|
||||
## 📄 라이선스
|
||||
|
||||
이 프로젝트는 [Apache License 2.0](../../LICENSE)에 따라 배포됩니다. 일부 하위 프로젝트는 별도 라이선스를 포함할 수 있습니다.
|
||||
|
||||
## ⭐ Star 기록
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>[`scripts/gen_star_history.py`](../../scripts/gen_star_history.py)로 생성하며 [GitHub Actions](../../.github/workflows/star-history.yml)가 매일 갱신합니다.</sub>
|
||||
@@ -0,0 +1,54 @@
|
||||
# Советы по обучению
|
||||
|
||||
← [К оглавлению](README.md)
|
||||
|
||||
|
||||
### Ключевая идея: Агент = Модель + Контекст + Инструменты
|
||||
|
||||
Основа книги — формула **Агент = Модель + Контекст + Инструменты**. Эти три компонента совместно реализуют разумное поведение агента:
|
||||
|
||||
- **Модель**: мозг агента, дающий понимание, рассуждение и принятие решений.
|
||||
- **Контекст**: операционная система агента, включающая системные инструкции, историю диалога, процессы рассуждения, записи взаимодействий с инструментами и т. д.
|
||||
- **Инструменты**: руки агента, позволяющие воспринимать среду, выполнять действия и взаимодействовать с внешним миром.
|
||||
|
||||
### Путь обучения
|
||||
|
||||
Путь обучения глава за главой соответствует всей книге, слой за слоем раскрываясь вокруг трёх опор:
|
||||
|
||||
- **Глава 1 · Основы**: Выстраивает целостную когнитивную рамку агентных систем — понять определение агента в RL, сравнить различия в эффективности выборки между традиционным RL и парадигмой LLM+RL, освоить новую парадигму «модель как агент» и базовую формулу **Агент = Модель + Контекст + Инструменты**. **Ключевой вывод**: важность априорного знания превосходит алгоритмы и среды.
|
||||
|
||||
- **Главы 2–3 · Контекст**: Контекст — операционная система агента. Глава 2 охватывает системные промпты, дружественный к KV Cache дизайн, сжатие контекста и абляции инженерии промптов. Глава 3 — пользовательскую память, плотный/разреженный/гибридный поиск, агентный RAG, контекстное извлечение и структурированное извлечение знаний. **Ключевой вывод**: полный контекст включает системные инструкции, историю диалога, процессы рассуждения, записи взаимодействий с инструментами, память пользователя и внешние знания.
|
||||
|
||||
- **Главы 4–5 · Инструменты**: Инструменты — мост взаимодействия агента с миром. Глава 4 охватывает три типа MCP-инструментов (восприятие/исполнение/сотрудничество), событийные триггеры и асинхронную архитектуру. Глава 5 подробно разбирает полную реализацию промышленного кодинг-агента. **Ключевой вывод**: инструменты стоит проектировать универсально (интерпретатор кода лучше калькулятора); код — это мета-способность создавать новые инструменты.
|
||||
|
||||
- **Главы 6–7 · Модель**: Как измерять и усиливать интеллект. Глава 6 охватывает бенчмарки оценки — Terminal-Bench, SWE-bench, GAIA, OSWorld, Tau2-Bench. Глава 7 — техники постобучения: SFT, RL, RLHF и эффективность выборки. **Ключевой вывод**: независимый сигнал проверки надёжнее, чем «попросить модель подумать ещё раз»; «модель как агент» через RL внедряет вызов инструментов как врождённую способность.
|
||||
|
||||
- **Глава 8 · Самоэволюция**: Позволяет агентам расти на опыте без изменения весов — обучение на опыте, экстернализация рабочих процессов в инструменты, дистилляция промптов и наблюдений в параметры. **Ключевой вывод**: обучение на опыте — ключ к переходу агента от «умного» к «умелому».
|
||||
|
||||
- **Главы 9–10 · Расширение и сотрудничество**: Глава 9 расширяет восприятие и действие с текста на речь, GUI и физический мир. Глава 10 использует разделение труда между агентами для сложных задач. **Ключевой вывод**: каждое проектное решение в мультиагентной системе находит аналог в трёх элементах одиночного агента.
|
||||
|
||||
## Разделение текста и экспериментов
|
||||
|
||||
Книга не является пошаговым руководством по одному SDK. Короткий псевдокод и скелеты показывают поток состояния, точки остановки и границы проверки; эксперименты содержат полные реализации, адаптеры, тесты, журналы и доказательства.
|
||||
|
||||
| Уровень | Сначала прочитать | Пока пропустить | На какой вопрос отвечает |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | README проекта: цель, минимальная команда и критерии приёмки; соответствующий skeleton в тексте | учётные данные, интерфейс, адаптеры провайдеров и длинные необработанные журналы | Какой механизм должен показать этот эксперимент? |
|
||||
| **Builder** | точка входа, основной цикл, схема состояния/сообщений, инструменты и проверяющий модуль | слои совместимости и развёртывания, не относящиеся к механизму | Какая переменная изменила поведение? |
|
||||
| **Maintainer** | тесты, обработка сбоев, формат доказательств, manifest/hash и путь отката | детали сторонних компонентов, нужные только при изменении эксперимента | Воспроизводим ли результат и честно ли записаны сбои? |
|
||||
|
||||
### Уровни сложности
|
||||
|
||||
- **Начальный** (главы 1–2): для новичков, понимание базовых понятий.
|
||||
- **Средний** (главы 3–4): нужна база в программировании, затрагивает интеграцию систем.
|
||||
- **Продвинутый** (главы 5–6): нужны сильные навыки программирования, сложное проектирование систем.
|
||||
- **Экспертный** (главы 7–8): нужен опыт глубокого обучения и обучения/самоэволюции.
|
||||
- **Прикладной** (главы 9–10): комплексное применение предыдущих знаний для создания практических приложений.
|
||||
|
||||
### Практические советы
|
||||
|
||||
1. **Практика руками**: каждый проект рассчитан на самостоятельный запуск. Рекомендуется запускать и модифицировать код самому.
|
||||
2. **Совмещайте с книгой**: читайте соответствующие главы в каталоге [`book-ru/`](../../book-ru/) (русский) или [`book/`](../../book/) (китайский оригинал) этого репозитория, чтобы понять связь теории и практики.
|
||||
3. **Сравнение экспериментов**: многие проекты включают абляции и сравнительные эксперименты. Углубляйте понимание через сравнение.
|
||||
4. **Постепенное обучение**: начинайте с простых проектов и постепенно углубляйтесь в сложные системы.
|
||||
5. **Внимание к протоколам**: проект MCP-сервера в главе 4 демонстрирует стандартизированные протоколы инструментов — ключ к построению масштабируемых агентов.
|
||||
@@ -0,0 +1,196 @@
|
||||
# Глубокое понимание AI Agent: принципы проектирования и инженерная практика
|
||||
|
||||
[](#-электронная-книга) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-электронная-книга)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · Русский ← текущий · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[Скачать PDF / EPUB](#-электронная-книга)** (рекомендуется) — рекомендуем читать книгу в PDF / EPUB, там лучшая вёрстка; также доступно [чтение онлайн](https://bojieli.github.io/ai-agent-book/) (переключатель языков, сворачиваемое оглавление, полнотекстовый поиск; сайт автоматически перестраивается при каждом пуше в main).
|
||||
|
||||
**Агент = LLM + Контекст + Инструменты** — книга строится вокруг этой базовой формулы и за 10 глав ведёт AI Agent от принципов к инженерной практике. Весь текст, иллюстрации и **93 сопутствующих эксперимента** открыты. Приглашаем прогнать эксперименты своими руками.
|
||||
|
||||
> 📢 **Что изменилось в версии 2.0 по сравнению с 1.4:** Версия 2.0 объединяет раздел «асинхронное взаимодействие» из прежней главы 4 с материалом о «мультимодальных агентах» из прежней главы 9 и перестраивает их в новую главу 6 «Взаимодействие: расширение пространства наблюдений и пространства действий». Прежние главы 6 «Оценка агентов», 7 «Постобучение модели» и 8 «Непрерывная эволюция агентов» сдвинулись на одну позицию и теперь являются главами 7, 8 и 9 соответственно.
|
||||
>
|
||||
> Если вы читаете старую версию PDF, рекомендуем [скачать последнюю версию PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf). В новом издании также много исправлений и содержательных изменений; пожалуйста, используйте актуальную версию.
|
||||
|
||||
| 📚 **10 глав** текста, от основ к продакшену | 📂 **93** сопутствующих проектов (70+ автономных) | 🌐 **14 языков**: CN / EN / ES / ID / AR / zh-TW / **RU** / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 Электронная книга
|
||||
|
||||
> 📥 **Скачать** (рекомендуется; полный текст, бесплатно и открыто). Ссылки всегда указывают на свежую сборку ветки `main`; фиксированные издания — на странице [Releases](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **Китайский (оригинал)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **Английский** (перевод сообщества, [@nsdevaraj](https://github.com/nsdevaraj), [@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **Испанский** (перевод сообщества, [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Арабский** (перевод сообщества, [@TheSyBuilder](https://github.com/TheSyBuilder)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Китайский традиционный (Тайвань)** (перевод сообщества, [@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **Русский** (перевод сообщества, [@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Тамильский** (перевод сообщества, [@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Вьетнамский** (перевод сообщества, [@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Японский** (перевод сообщества, [@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Турецкий** (перевод сообщества, [@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Корейский** (перевод сообщества, [@JeongJaeSoon](https://github.com/JeongJaeSoon)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 Также доступно [чтение онлайн](https://bojieli.github.io/ai-agent-book/) — переключатель языков, сворачиваемое оглавление, полнотекстовый поиск и прямые ссылки на сопутствующие эксперименты. Сайт автоматически перестраивается при каждом пуше в main.
|
||||
|
||||
Исходник китайского текста — в [`book/`](../../book/); версии на английском/испанском/арабском/традиционном китайском (Тайвань)/русском/тамильском/вьетнамском/японском/турецком/корейском — вклад сообщества (могут отставать от китайского оригинала), расположены в [`book-en/`](../../book-en/), [`book-es/`](../../book-es/), [`book-ar/`](../../book-ar/), [`book-zhtw/`](../../book-zhtw/), [`book-ru/`](../../book-ru/), [`book-ta/`](../../book-ta/), [`book-vi/`](../../book-vi/), [`book-ja/`](../../book-ja/), [`book-tr/`](../../book-tr/), [`book-ko/`](../../book-ko/) соответственно.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Собрать PDF / EPUB самому?</b> (для PDF нужны pandoc / xelatex / ElegantBook)</summary>
|
||||
|
||||
- **EPUB**: используйте общий сборщик; см. [инструкцию по сборке EPUB](../../EPUB.md)
|
||||
- **Арабский PDF**: можно собрать командой `cd book-ar && bash build_pdf.sh`
|
||||
- **Исходник текста**: `book-ru/introduction.md` (введение), `book-ru/chapter1.md` ~ `book-ru/chapter10.md` (главы 1–10), `book-ru/afterword.md` (послесловие)
|
||||
- **Сборка**: установите pandoc, xelatex, класс документа ElegantBook и нужные шрифты, затем выполните
|
||||
|
||||
```bash
|
||||
cd book-ru && bash build_pdf.sh
|
||||
```
|
||||
|
||||
Иллюстрации лежат в `book-ru/images/`; детали типографики — в `book-ru/preamble.tex` и `book-ru/*.lua`.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 Обзор содержания (главы 1–10)
|
||||
|
||||
Книга строится вокруг базовой формулы **Агент = LLM + Контекст + Инструменты**, и десять глав раскрывают её постепенно:
|
||||
|
||||
| Гл | Тема | Кратко | Текст | Код |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Основы агентов** | Парадигма «модель как агент» + **Агент = LLM + Контекст + Инструменты**; harness-инженерия — вот настоящее преимущество | [Читать](../../book-ru/chapter1.md) | [4](../../chapter1/README.ru.md) |
|
||||
| 2 | 🎯 **Инженерия контекста** | Контекст ограничивает возможности агента: KV Cache, инженерия промптов, Agent Skills, сжатие контекста | [Читать](../../book-ru/chapter2.md) | [9](../../chapter2/README.ru.md) |
|
||||
| 3 | 📚 **Память пользователя и базы знаний** | Кросс-сессионная память + внешние знания: пользовательская память, RAG, структурированные индексы, графы знаний | [Читать](../../book-ru/chapter3.md) | [12](../../chapter3/README.ru.md) |
|
||||
| 4 | 🛠️ **Инструменты** | Инструменты — руки агента: протокол MCP, инструменты восприятия/исполнения/сотрудничества, событийные асинхронные агенты, активное обнаружение инструментов | [Читать](../../book-ru/chapter4.md) | [8](../../chapter4/README.ru.md) |
|
||||
| 5 | 💻 **Кодинг-агент и генерация кода** | Код — «инструмент, создающий новые инструменты»; промышленный кодинг-агент целиком | [Читать](../../book-ru/chapter5.md) | [13](../../chapter5/README.ru.md) |
|
||||
| 6 | 🎙️ **Взаимодействие: расширение пространства наблюдений и пространства действий** | Расширяем пространства наблюдений и действий по модальности и времени: асинхронные и событийные системы, голос, Computer Use и робототехника | [Читать](../../book-ru/chapter6.md) | [13](../../chapter6/README.ru.md) |
|
||||
| 7 | 🎯 **Оценка агентов** | Превращаем качество в сравнимые сигналы: среды, метрики, статистическая значимость и выбор на основе оценки | [Читать](../../book-ru/chapter7.md) | [13](../../chapter7/README.ru.md) |
|
||||
| 8 | 🧠 **Постобучение модели** | Три стадии—предобучение, SFT и RL: когда выбирать SFT или RL, внедрение вызова инструментов и эффективность выборки | [Читать](../../book-ru/chapter8.md) | [19](../../chapter8/README.ru.md) |
|
||||
| 9 | 🔄 **Непрерывная эволюция агентов** | Получаем сигналы обучения из траекторий выполнения и обновляем знания, инструкции, программы и параметры | [Читать](../../book-ru/chapter9.md) | [9](../../chapter9/README.ru.md) |
|
||||
| 10 | 🤝 **Многоагентное взаимодействие** | Коллективный интеллект > индивидуального: фреймворки сотрудничества, разделение/изоляция контекста, эмерджентное «общество агентов» | [Читать](../../book-ru/chapter10.md) | [7](../../chapter10/README.ru.md) |
|
||||
|
||||
> 💡 **Читать** = читать текст главы на GitHub (markdown); **N** = число сопутствующих проектов, кликните для кода. Типы проектов (✅ автономный / 📖 воспроизведение / 🚧 проектный) поясняются в README каждой главы.
|
||||
>
|
||||
> 📚 Как читать книгу эффективно? См. **[Советы по обучению](LEARNING.md)** (ключевые идеи, путь обучения, уровни сложности, советы по практике).
|
||||
|
||||
## 💻 Запуск сопутствующих экспериментов
|
||||
|
||||
Общий поддерживаемый диапазон — **Python 3.11–3.13**. Устанавливайте зависимости по главам из корня репозитория; для другой главы замените `ch1` на `ch2` — `ch10`:
|
||||
|
||||
```bash
|
||||
# Рекомендуется: воспроизводимое окружение главы из сохранённого uv.lock
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# Без uv: заново разрешить зависимости из pyproject.toml через pip
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
Перед запуском эксперимента, который обращается к модели, настройте ключи по README этого эксперимента. Эксперименты с поддержкой корневой конфигурации могут использовать `.env.example`, скопированный в `.env`, с хотя бы одним ключом провайдера; некоторым экспериментам нужен соседний `.env` или экспорт переменных окружения. Используйте локальный Ollama с `--provider ollama` только если это явно указано в README или CLI конкретного эксперимента.
|
||||
|
||||
После установки запускайте эксперимент из корня репозитория, например:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# После установки через pip: python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- Установку `uv` описывает [официальное руководство](https://docs.astral.sh/uv/getting-started/installation/). `pip` по-прежнему поддерживается, но не использует lock-файл.
|
||||
- Файлы `requirements.txt` отдельных экспериментов остаются рабочими на время миграции, особенно для изолированных проектов и особых ограничений версий.
|
||||
- `all` — широкий CPU-дружественный набор, а не буквально все эксперименты. `uv sync` каждый раз точно синхронизирует текущий выбор, поэтому специальные extra нужно объединять в одной команде, например `uv sync --locked --extra ch2 --extra vllm` или `uv sync --locked --extra ch7 --extra unsloth`; для pip это `python -m pip install -e ".[ch2,vllm]"`.
|
||||
- Системные зависимости — браузеры, CUDA, FFmpeg, Ollama, браузеры Playwright и внешние репозитории — устанавливайте по README конкретного эксперимента. Некоторым встроенным сторонним компонентам главы 8 нужен Python 3.12+.
|
||||
|
||||
## 🔑 API-ключи
|
||||
|
||||
Для удобства обучения рекомендуется получить API-ключи на нескольких платформах. По выбору модели см. [этот гайд](https://01.me/2025/07/llm-api-setup/).
|
||||
|
||||
| Платформа | Ссылка | Примечания | Точки доступа |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | Серия Kimi, сильна в длинном контексте и возможностях агента | Материковый Китай |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6 и др., сильный китайский, выгодная цена | Материковый Китай |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | Разные открытые модели (DeepSeek, Qwen и др.), быстрый доступ из материкового Китая | Материковый Китай |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | Официальный API DeepSeek | Весь мир + материковый Китай |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | Единый доступ к основным мировым и китайским моделям (OpenAI, Claude, Gemini, Grok, Kimi, GLM, DeepSeek, Qwen, Minimax) | Весь мир + материковый Китай |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | Единый доступ к основным мировым и китайским моделям (GPT, Claude, Gemini, Kimi, GLM, DeepSeek, Qwen и др.) | Весь мир |
|
||||
|
||||
## 💎 Спонсоры
|
||||
|
||||
Благодарим **Krill AI** за спонсорство проекта! Krill предоставляет официальный, стабильный и сверхбыстрый API-шлюз для GPT / Claude / Gemini и множества китайских моделей, с корпоративной настройкой, счетами для возмещения расходов, выделенной технической поддержкой 7×16 ч, а также эксклюзивным подключением по WebSocket для молниеносного времени до первого токена.
|
||||
|
||||
Krill предлагает читателям книги специальную скидку: зарегистрируйтесь по [этой ссылке](https://www.krill-ai.net/register?invite=Q8D3L35725) и укажите промокод «ai-agent-book» при пополнении счёта, чтобы получить скидку 23% на первую покупку пакета Codex!
|
||||
|
||||
> 🧪 Статус выполнения экспериментов, доказательства и невыполненные критерии приёмки отслеживаются отдельно в [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md); клонирование или установка исходного кода сами по себе не подтверждают завершение эксперимента.
|
||||
|
||||
## 📦 Приложение · Получение внешних репозиториев
|
||||
|
||||
23 внешних репозитория для бенчмарков, обучающих фреймворков и робо-платформ из глав 6, 7, 9, 10 **не включены** (из-за размера и лицензий) и должны быть склонированы в соответствующие каталоги.
|
||||
|
||||
### Скрипт клонирования одной командой
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Развернуть команды клонирования</b> (23 внешних репозитория)</summary>
|
||||
|
||||
```bash
|
||||
# Глава 6 · Бенчмарки оценки
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# Глава 7 · Обучающие фреймворки (bojieli/* — адаптированные под книгу форки)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # Эксп. 7-3: обучение LLM с нуля
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # Эксп. 7-4: обучение VLM с нуля (проекционный слой)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # Эксп. 7-14: код статьи RLVP
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # Эксп. 7-13: RL «зрение-язык-действие»
|
||||
|
||||
# Глава 9 · Автоматизация браузера и примеры Claude
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# Глава 10 · Архитектура двух агентов (теперь отдельный проект TalkAct) + Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # Эксп. 10-5: Stanford AI Town
|
||||
```
|
||||
|
||||
> Если README проекта указывает конкретный коммит, сделайте `git checkout` на эту версию для воспроизводимости. `use-computer-while-calling` из главы 10 вырос в самостоятельно поддерживаемый [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct); этот каталог в репозиторий не входит — получите его командой клонирования выше.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Как внести вклад
|
||||
|
||||
Книга и сопровождающий код полностью открыты. Pull Request'ы очень приветствуются:
|
||||
|
||||
| Тип | Примечания |
|
||||
| --- | --- |
|
||||
| 📝 **Содержание книги** | Опечатки, дополнения, более ясные формулировки или новые разработки (текст в `book/chapter*.md`) |
|
||||
| 🐛 **Улучшения кода и багфиксы** | Сделать сопутствующие проекты надёжнее, удобнее и ближе к продакшену |
|
||||
| 🧪 **Новые практические проекты** | Добавить/заменить лучшими реализациями эксперименты или предложить новые примеры |
|
||||
| 🎨 **Дизайн иллюстраций** | Напрямую улучшать сохранённые в репозитории SVG-схемы из `book/images/` |
|
||||
| 🌐 **Новые переводы** | Переводы на другие языки приветствуются; за образец возьмите английский (`book-en/`), арабский (`book-ar/`), традиционный китайский/Тайвань (`book-zhtw/`), русский (`book-ru/`), тамильский (`book-ta/`), вьетнамский (`book-vi/`), японский (`book-ja/`), турецкий (`book-tr/`) и корейский (`book-ko/`) |
|
||||
|
||||
Перед отправкой прогоните соответствующие эксперименты для подтверждения воспроизводимости; идеи можно предварительно обсудить в issue.
|
||||
|
||||
## 📄 Лицензия
|
||||
|
||||
Проект распространяется под [Apache License 2.0](../../LICENSE). Подробности — в файле [`LICENSE`](../../LICENSE). Некоторые подпроекты могут включать собственную лицензию; уточняйте в подпроекте.
|
||||
|
||||
## ⭐ История звёзд
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>Сгенерировано [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py), ежедневно обновляется [GitHub Actions](../../.github/workflows/star-history.yml) · Кликните по картинке для актуальных данных</sub>
|
||||
@@ -0,0 +1,53 @@
|
||||
# கற்றல் பரிந்துரைகள்
|
||||
|
||||
← [முக்கிய README க்குத் திரும்பு](README.md)
|
||||
|
||||
### மையக் கருத்து: ஏஜென்ட் = மாதிரி + சூழல் + கருவிகள்
|
||||
|
||||
இந்தப் புத்தகத்தின் மையக் கட்டமைப்பு **ஏஜென்ட் = மாதிரி + சூழல் + கருவிகள்**; இந்த மூன்று கூறுகள் ஒன்றுடன் ஒன்று இணைந்து செயல்பட்டு, ஏஜென்டின் அறிவார்ந்த நடத்தையை இணைந்து செயல்படுத்துகின்றன:
|
||||
|
||||
- **மாதிரி (Model)**: ஏஜென்டின் மூளை; புரிதல், பகுத்தறிவு மற்றும் முடிவெடுக்கும் திறன்களை வழங்குகிறது
|
||||
- **சூழல் (Context)**: ஏஜென்டின் இயக்க முறைமை; கணினி வழிமுறைகள், உரையாடல் வரலாறு, பகுத்தறிவு செயல்முறைகள், கருவி தொடர்புப் பதிவுகள் போன்றவற்றைக் கொண்டுள்ளது
|
||||
- **கருவிகள் (Tools)**: ஏஜென்டின் கைகள்; சூழலை உணரவும், செயல்பாடுகளைச் செய்யவும், வெளி உலகத்துடன் தொடர்பு கொள்ளவும் ஏஜென்டை முடுக்குகிறது
|
||||
|
||||
### கற்றல் பாதை
|
||||
|
||||
கற்றல் பாதை புத்தகத்தின் அத்தியாயங்களுடன் ஒன்றுக்கொன்று ஒத்துப்போகிறது, மூன்று தூண்களைச் சுற்றி அடுக்கடுக்காக விரிவடைகிறது:
|
||||
|
||||
- **அத்தியாயம் 1 · அடித்தளம்**: ஏஜென்ட் அமைப்புகள் பற்றிய முழுமையான அறிவாற்றல் கட்டமைப்பை உருவாக்குதல்—RL இல் ஏஜென்டின் வரையறையைப் புரிந்துகொள்ளுதல், பாரம்பரிய RL மற்றும் LLM+RL முன்னுதாரணங்களுக்கிடையேயான மாதிரி திறன் (sample efficiency) வேறுபாடுகளை ஒப்பிடுதல், "மாதிரியே ஏஜென்டாக" என்ற புதிய முன்னுதாரணத்தைப் புரிந்துகொள்ளுதல், மற்றும் **ஏஜென்ட் = மாதிரி + சூழல் + கருவிகள்** என்ற மையக் கட்டமைப்பை மாஸ்டர் செய்தல். **முக்கிய நுண்ணறிவு**: முன்னறிவின் (prior knowledge) முக்கியத்துவம் வழிமுறைகளையும் சூழல்களையும் விட மேலானது.
|
||||
|
||||
- **அத்தியாயங்கள் 2–3 · சூழல்**: சூழல் என்பது ஏஜென்டின் இயக்க முறைமை. அத்தியாயம் 2 கணினி வழிகாட்டிகள், KV Cache-நட்பு வடிவமைப்பு, சூழல் சுருக்கம் மற்றும் வழிகாட்டி பொறியியல் அப்லேஷன் ஆகியவற்றை உள்ளடக்குகிறது; அத்தியாயம் 3 பயனர் நினைவகம், அடர்த்தியான/அரிதான/கலப்பு மீட்டெடுப்பு, Agentic RAG, சூழல்-உணர்ந்த மீட்டெடுப்பு (contextual retrieval) மற்றும் கட்டமைக்கப்பட்ட அறிவுப் பிரித்தெடுப்பு ஆகியவற்றை உள்ளடக்குகிறது. **முக்கிய நுண்ணறிவு**: முழுமையான சூழலில் கணினி வழிமுறைகள், உரையாடல் வரலாறு, பகுத்தறிவு செயல்முறைகள், கருவி தொடர்புப் பதிவுகள், பயனர் நினைவகம் மற்றும் வெளிப்புற அறிவு ஆகியவை அடங்கும்.
|
||||
|
||||
- **அத்தியாயங்கள் 4–5 · கருவிகள்**: கருவிகள் ஏஜென்ட் உலகத்துடன் தொடர்பு கொள்ளும் பாலமாகும். அத்தியாயம் 4 உணர்தல்/செயலாக்கம்/ஒத்துழைப்பு என்ற மூன்று வகை MCP கருவிகள், நிகழ்வுத் தூண்டுதல் மற்றும் ஒத்திசைவற்ற கட்டமைப்பு ஆகியவற்றை உள்ளடக்குகிறது; அத்தியாயம் 5 உற்பத்தி-தர Coding Agent இன் முழுமையான செயலாக்கத்தை ஆழமாக ஆராய்கிறது. **முக்கிய நுண்ணறிவு**: கருவி வடிவமைப்பு பொதுமைப்படுத்தப்பட வேண்டும் (குறியீடு மொழிபெயர்ப்பாளர் கால்குலேட்டரை விடச் சிறந்தது); குறியீடு என்பது புதிய கருவிகளை உருவாக்கக்கூடிய மெட்டா-திறன் ஆகும்.
|
||||
|
||||
- **அத்தியாயங்கள் 6–7 · மாதிரி**: நுண்ணறிவை எவ்வாறு அளவிடுவது மற்றும் பெரிதாக்குவது. அத்தியாயம் 6 Terminal-Bench, SWE-bench, GAIA, OSWorld, Tau2-Bench போன்ற மதிப்பீட்டுத் தரநிர்ணயங்களை உள்ளடக்குகிறது; அத்தியாயம் 7 SFT, RL, RLHF, மாதிரி திறன் போன்ற பிந்தைய-பயிற்சி நுட்பங்களை உள்ளடக்குகிறது. **முக்கிய நுண்ணறிவு**: "மாதிரியை மீண்டும் யோசிக்கச் செய்வதை" விட ஒரு சுயாதீன சரிபார்ப்புச் சமிக்ஞை மிகவும் நம்பகமானது; "மாதிரியே ஏஜென்டாக" RL மூலம் கருவி அழைப்புகளை உள்ளார்ந்த திறன்களாக உள்வாங்குகிறது.
|
||||
|
||||
- **அத்தியாயம் 8 · சுய-பரிணாமம்**: எடைகளை மாற்றாமல் அனுபவத்திலிருந்து ஏஜென்ட் வளரச் செய்தல்—அனுபவக் கற்றல், பணிப்பாய்வுகளைக் கருவிகளாக வெளிப்புறமயமாக்குதல், வழிகாட்டிகள் மற்றும் கவனிப்புகளை அளவுருக்களில் வடிகட்டுதல். **முக்கிய நுண்ணறிவு**: அனுபவத்திலிருந்து கற்றல் என்பது ஒரு ஏஜென்ட் "புத்திசாலி" என்பதிலிருந்து "திறமையான" நிலைக்குச் செல்வதற்கான திறவுகோலாகும்.
|
||||
|
||||
- **அத்தியாயங்கள் 9–10 · விரிவாக்கம் மற்றும் ஒத்துழைப்பு**: அத்தியாயம் 9 உணர்தல் மற்றும் செயலை உரையிலிருந்து குரல், GUI மற்றும் இயற்பியல் உலகத்திற்கு விரிவுபடுத்துகிறது; அத்தியாயம் 10 பல-ஏஜென்ட் பணிப் பிரிவு ஒத்துழைப்பின் மூலம் சிக்கலான பணிகளைக் கையாள்கிறது. **முக்கிய நுண்ணறிவு**: பல-ஏஜென்ட் அமைப்பின் ஒவ்வொரு வடிவமைப்பு முடிவுக்கும் ஒற்றை ஏஜென்டின் மூன்று கூறுகளில் ஒரு ஒத்துப்போவதைக் காணலாம்.
|
||||
|
||||
## முதன்மை உரையும் சோதனைகளும்
|
||||
|
||||
இந்தப் புத்தகம் ஒரு குறிப்பிட்ட SDK-க்கான படிப்படியான பயிற்சி அல்ல. குறுகிய pseudocode/skeleton-கள் state flow, நிறுத்தும் இடங்கள், verification எல்லைகளை விளக்குகின்றன; அத்தியாயச் சோதனைகள் முழு implementation, adapters, tests, logs, evidence ஆகியவற்றை வழங்குகின்றன.
|
||||
|
||||
| அடுக்கு | முதலில் படிக்கவும் | இப்போது தவிர்க்கவும் | இது பதிலளிக்கும் கேள்வி |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | திட்ட README: நோக்கம், குறைந்தபட்ச கட்டளை, ஏற்றுக்கொள்ளும் நிபந்தனைகள்; அதற்கான உரை skeleton | சான்றுகள், UI, provider adapters, நீண்ட raw logs | இந்தச் சோதனை நிரூபிக்க வேண்டிய mechanism எது? |
|
||||
| **Builder** | entry point, core loop, state/message schema, tools, verifier | mechanism-க்கு தொடர்பில்லாத compatibility/deployment layers | எந்த variable நடத்தை மாற்றியது? |
|
||||
| **Maintainer** | tests, failure handling, evidence format, manifest/hash, rollback path | சோதனையை மாற்றும்போது மட்டும் தேவைப்படும் third-party விவரங்கள் | முடிவு மீண்டும் உருவாக்கக்கூடியதா, தோல்விகள் நேர்மையாகப் பதிவானதா? |
|
||||
|
||||
### சிரம நிலை வகைப்பாடு
|
||||
|
||||
- **தொடக்க நிலை** (அத்தியாயங்கள் 1–2): ஆரம்பநிலையாளர்களுக்கு ஏற்றது, அடிப்படைக் கருத்துக்களைப் புரிந்துகொள்ளுதல்
|
||||
- **இடைநிலை** (அத்தியாயங்கள் 3–4): ஓரளவு நிரலாக்க அடித்தளம் தேவை, அமைப்பு ஒருங்கிணைப்பு உள்ளடக்கியது
|
||||
- **மேம்பட்ட நிலை** (அத்தியாயங்கள் 5–6): வலுவான நிரலாக்கத் திறன் தேவை, சிக்கலான அமைப்பு வடிவமைப்பு உள்ளடக்கியது
|
||||
- **நிபுணர் நிலை** (அத்தியாயங்கள் 7–8): ஆழ்ந்த கற்றல் (deep learning) மற்றும் பயிற்சி/சுய-பரிணாம அனுபவம் தேவை
|
||||
- **பயன்பாட்டு நிலை** (அத்தியாயங்கள் 9–10): முன்னர் கற்றவற்றை ஒருங்கிணைத்துப் பயன்படுத்தி, நடைமுறைப் பயன்பாடுகளை உருவாக்குதல்
|
||||
|
||||
### நடைமுறைப் பரிந்துரைகள்
|
||||
|
||||
1. **நடைமுறைப் பயிற்சி**: ஒவ்வொரு திட்டமும் சுயாதீனமாக இயக்கக்கூடியதாக வடிவமைக்கப்பட்டுள்ளது; நீங்களே குறியீட்டை இயக்கி மாற்றிப் பார்க்க பரிந்துரைக்கப்படுகிறது
|
||||
2. **புத்தகத்துடன் இணைத்துப் படிக்கவும்**: இந்தக் களஞ்சியத்தின் [`book/`](../../book/) அடைவில் உள்ள கையேட்டின் தொடர்புடைய அத்தியாயங்களுடன் சேர்த்துப் படித்து, கோட்பாடு மற்றும் நடைமுறையின் இணைப்பைப் புரிந்துகொள்ளவும்
|
||||
3. **சோதனை ஒப்பீடு**: பல திட்டங்கள் அப்லேஷன் ஆய்வுகள் மற்றும் ஒப்பீட்டுச் சோதனைகளைக் கொண்டுள்ளன; ஒப்பீட்டின் மூலம் புரிதலை ஆழப்படுத்தவும்
|
||||
4. **படிப்படியான கற்றல்**: எளிய திட்டங்களிலிருந்து தொடங்கி, படிப்படியாகச் சிக்கலான அமைப்புகளுக்குச் செல்லவும்
|
||||
5. **நெறிமுறைகளில் கவனம் செலுத்தவும்**: அத்தியாயம் 4 இல் உள்ள MCP சேவையகத் திட்டங்கள் தரநிலையான கருவி நெறிமுறைகளை நிரூபிக்கின்றன, இவை அளவிடக்கூடிய ஏஜெண்டுகளை உருவாக்குவதற்கான திறவுகோலாகும்
|
||||
@@ -0,0 +1,196 @@
|
||||
# AI Agents ஆழத்தில்: வடிவமைப்பு கோட்பாடுகள் மற்றும் பொறியியல் நடைமுறைகள்
|
||||
|
||||
[](#-மின்-புத்தகம்) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-மின்-புத்தகம்)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · தமிழ் ← தற்போதைய · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[PDF / EPUB பதிவிறக்கம்](#-மின்-புத்தகம்)** (பரிந்துரைக்கப்படுகிறது) — சிறந்த வாசிப்பு அனுபவத்திற்கு PDF / EPUB பதிப்புகளைப் பரிந்துரைக்கிறோம்; [நிகழ்நேரத்திலும் படிக்கலாம்](https://bojieli.github.io/ai-agent-book/) (மொழி மாற்றி, மடிக்கக்கூடிய அத்தியாய மரம், முழு-உரை தேடல்; main கிளைக்கு ஒவ்வொரு push-ம் தானாகவே மீண்டும் கட்டப்படுகிறது).
|
||||
|
||||
**Agent = LLM + Context + Tools** — இந்த மையக் கோவையில் 10 அத்தியாயங்களில் AI Agent-ஐ கோட்பாடு முதல் பொறியியல் நடைமுறை வரை கொண்டு செல்கிறது. முழு உரை, விளக்கப்படங்கள் மற்றும் **93 துணை சோதனைகள்** அனைத்தும் திறந்த மூலமாகும்.
|
||||
|
||||
> 📢 **1.4 உடன் ஒப்பிடும்போது பதிப்பு 2.0-இல் ஏற்பட்ட மாற்றங்கள்:** பதிப்பு 2.0, முந்தைய அத்தியாயம் 4-இன் “ஒத்திசைவற்ற தொடர்பாடல்” பகுதியையும் முந்தைய அத்தியாயம் 9-இன் “பல்முக Agent” உள்ளடக்கத்தையும் ஒன்றிணைத்து, புதிய அத்தியாயம் 6, “தொடர்பாடல்: அவதானிப்பு மற்றும் செயல் வெளிகளின் விரிவாக்கம்” என மறுசீரமைக்கிறது. முந்தைய அத்தியாயங்கள் 6 (“ஏஜெண்டுகளை மதிப்பீடு செய்தல்”), 7 (“மாதிரி பிந்தைய பயிற்சி”), மற்றும் 8 (“Agent-இன் தொடர்ச்சியான பரிணாமம்”) ஒவ்வொன்றும் ஓர் அத்தியாயம் பின்னுக்கு நகர்ந்து, இப்போது முறையே அத்தியாயங்கள் 7, 8, மற்றும் 9 ஆக உள்ளன.
|
||||
>
|
||||
> நீங்கள் பழைய PDF-ஐப் படித்துக்கொண்டிருந்தால், [சமீபத்திய PDF-ஐப் பதிவிறக்கம் செய்ய](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) பரிந்துரைக்கிறோம். புதிய பதிப்பில் பல உள்ளடக்கத் திருத்தங்களும் மாற்றங்களும் உள்ளன; சமீபத்திய பதிப்பையே பயன்படுத்தவும்.
|
||||
|
||||
| 📚 **10 அத்தியாயங்கள்**, அடிப்படை முதல் உற்பத்தி வரை | 📂 **93** துணை திட்டங்கள் (70+ தனித்து இயங்கும்) | 🌐 **14 மொழிகள்**: சீன / ஆங் / ஸ்பானிஷ் / இந்தோனேசிய / அரபு / 繁體中文(台灣) / ரஷ்ய / தமிழ் / வியத் / ஜப் / துருக்கியம் / கொரிய / ஹங்கேரியன் / எபிரேயம் |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 மின்-புத்தகம்
|
||||
|
||||
> 📥 **PDF / EPUB நேரடி பதிவிறக்கம்** (பரிந்துரைக்கப்படுகிறது; முழு உரை, இலவசம்). இந்த இணைப்புகள் எப்போதும் `main` கிளையின் சமீபத்திய கட்டமைப்பைச் சுட்டும்; நிலையான பதிப்புகளுக்கு [Releases](https://github.com/bojieli/ai-agent-book/releases) பார்க்கவும்:
|
||||
> - **சீனம் (அசல்)**:[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **ஆங்கிலம்**(சமூக மொழிபெயர்ப்பு, by [@nsdevaraj](https://github.com/nsdevaraj)、[@whanyu1212](https://github.com/whanyu1212)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **ஸ்பானிஷ்**(சமூக மொழிபெயர்ப்பு, by [@santhreal](https://github.com/santhreal)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **அரபு**(சமூக மொழிபெயர்ப்பு, by [@TheSyBuilder](https://github.com/TheSyBuilder)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **பாரம்பரிய சீனம் (தைவான்)**(சமூக மொழிபெயர்ப்பு, by [@tigercosmos](https://github.com/tigercosmos)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **ரஷ்யம்**(சமூக மொழிபெயர்ப்பு, by [@ui99ru](https://github.com/ui99ru)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **தமிழ்**(சமூக மொழிபெயர்ப்பு, by [@nsdevaraj](https://github.com/nsdevaraj)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **வியட்நாம்**(சமூக மொழிபெயர்ப்பு, by [@toanalien](https://github.com/toanalien)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **ஜப்பானியம்**(சமூக மொழிபெயர்ப்பு, by [@eltociear](https://github.com/eltociear)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **துருக்கியம்**(சமூக மொழிபெயர்ப்பு, by [@memisemre](https://github.com/memisemre)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **கொரிய மொழி**(சமூக மொழிபெயர்ப்பு, by [@JeongJaeSoon](https://github.com/JeongJaeSoon)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 [நிகழ்நேரத்திலும் படிக்கலாம்](https://bojieli.github.io/ai-agent-book/) — மொழி மாற்றி, மடிக்கக்கூடிய அத்தியாய மரம், முழு-உரை தேடல் மற்றும் துணை சோதனைகளுக்கான நேரடி இணைப்புகள். main கிளைக்கு ஒவ்வொரு push-ம் தானாகவே மீண்டும் கட்டப்படுகிறது.
|
||||
|
||||
சீன மூல உரை [`book/`](../../book/)-இல் உள்ளது; ஆங்/ஸ்பானிஷ்/அரபு/繁體中文(台灣)/ரஷ்ய/தமிழ்/வியத்/ஜப்/துருக்கியம்/கொரிய பதிப்புகள் சமூகப் பங்களிப்புகள் (சீன அசலை விடப் பின்தங்கியிருக்கலாம்), [`book-en/`](../../book-en/), [`book-es/`](../../book-es/), [`book-ar/`](../../book-ar/), [`book-zhtw/`](../../book-zhtw/), [`book-ru/`](../../book-ru/), [`book-ta/`](../../book-ta/), [`book-vi/`](../../book-vi/), [`book-ja/`](../../book-ja/), [`book-tr/`](../../book-tr/), [`book-ko/`](../../book-ko/)-இல் உள்ளன.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 PDF / EPUB-ஐ தாங்களே கட்டவா?</b> (PDF-க்கு pandoc / xelatex / ElegantBook தேவை)</summary>
|
||||
|
||||
- **EPUB**: ஒரே உருவாக்க நிரலைப் பயன்படுத்தவும்; [EPUB உருவாக்க வழிமுறைகளைப்](../../EPUB.md) பார்க்கவும்
|
||||
- **மூல உரை**: `book/introduction.md` (அறிமுகம்), `book/chapter1.md` ~ `book/chapter10.md` (அத்தியாயம் 1–10), `book/afterword.md` (பின்னுரை)
|
||||
- **Build**: pandoc, xelatex, ElegantBook மற்றும் தேவையான font-ஐ நிறுவிய பிறகு இயக்கவும்
|
||||
|
||||
```bash
|
||||
cd book && bash build_pdf.sh
|
||||
```
|
||||
|
||||
படங்கள் SVG கோப்புகளாக `book/images/`-இல் சேமிக்கப்பட்டு உருவாக்கத்தின் போது நேரடியாகப் பயன்படுத்தப்படுகின்றன; typography விவரங்களுக்கு `book/preamble.tex` மற்றும் `book/*.lua` பார்க்கவும்.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 உள்ளடக்க விரைவு அறிமுகம் (அத்தியாயம் 1–10)
|
||||
|
||||
புத்தகம் **Agent = LLM + Context + Tools** மையக் கோவையில், பத்து அத்தியாயங்கள் அடுத்தடுத்து:
|
||||
|
||||
| அதி | தலைப்பு | ஒரு வரி சுருக்கம் | உரை | குறியீடு |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **ஏஜென்ட் அடிப்படைகள்** | **Agent = LLM + Context + Tools**; Harness பொறியியலே உண்மையான போட்டித் திறன் | [படி](../../book-ta/chapter1.ta.md) | [4](../../chapter1/README.ta.md) |
|
||||
| 2 | 🎯 **சூழல் பொறியியல்** | சூழல் ஏஜெண்டின் திறனின் மேல் வரம்பைத் தீர்மானிக்கிறது: KV Cache, prompt engineering, Agent Skills, சூழல் சுருக்கம் | [படி](../../book-ta/chapter2.ta.md) | [9](../../chapter2/README.ta.md) |
|
||||
| 3 | 📚 **பயனர் நினைவகம் & அறிவுத் தளம்** | பயனரை அமர்வுகளுக்கு குறுக்கே நினைவில் வைத்தல் + வெளிப்புற அறிவு: பயனர் நினைவகம், RAG, கட்டமைக்கப்பட்ட குறியீடு, அறிவு வரைபடம் | [படி](../../book-ta/chapter3.ta.md) | [12](../../chapter3/README.ta.md) |
|
||||
| 4 | 🛠️ **கருவிகள்** | கருவிகள் ஏஜெண்டின் கைகள்: MCP நெறிமுறை, உணர்வு/செயலாக்கம்/ஒத்துழைப்பு, நிகழ்வு-இயக்கிய ஏஜென்ட், முனைப்பான கருவி கண்டுபிடிப்பு | [படி](../../book-ta/chapter4.ta.md) | [8](../../chapter4/README.ta.md) |
|
||||
| 5 | 💻 **Coding Agent & குறியீடு உருவாக்கம்** | குறியீடு "புதிய கருவியை உருவாக்கும் கருவி"; உற்பத்தி தர Coding Agent முழுமையாக | [படி](../../book-ta/chapter5.ta.md) | [13](../../chapter5/README.ta.md) |
|
||||
| 6 | 🎙️ **தொடர்பாடல்: அவதானிப்பு மற்றும் செயல் வெளிகளின் விரிவாக்கம்** | மாதிரி மற்றும் நேர பரிமாணங்களில் Agent-இன் அவதானிப்பு மற்றும் செயல் வெளிகளை விரிவாக்குதல்: ஒத்திசைவற்ற மற்றும் நிகழ்வு-இயக்க அமைப்புகள், குரல், Computer Use மற்றும் ரோபோட்டிக்ஸ் | [படி](../../book-ta/chapter6.ta.md) | [13](../../chapter6/README.ta.md) |
|
||||
| 7 | 🎯 **ஏஜெண்டுகளை மதிப்பீடு செய்தல்** | செயல்திறனை ஒப்பிடக்கூடிய சமிக்ஞையாக மாற்றுதல்: சூழல்கள், அளவீடுகள், புள்ளியியல் முக்கியத்துவம் மற்றும் மதிப்பீடு-இயக்கிய தேர்வு | [படி](../../book-ta/chapter7.ta.md) | [13](../../chapter7/README.ta.md) |
|
||||
| 8 | 🧠 **மாதிரி பிந்தைய பயிற்சி** | மூன்று நிலைகள்—முன்-பயிற்சி, SFT மற்றும் RL: SFT அல்லது RL-ஐ எப்போது தேர்ந்தெடுப்பது, கருவி அழைப்புகளை உள்ளடக்குதல் மற்றும் மாதிரி செயல்திறன் | [படி](../../book-ta/chapter8.ta.md) | [19](../../chapter8/README.ta.md) |
|
||||
| 9 | 🔄 **Agent-இன் தொடர்ச்சியான பரிணாமம்** | செயலாக்கப் பாதைகளிலிருந்து கற்றல் சமிக்ஞைகளைப் பெற்று, அறிவு, வழிமுறைகள், நிரல்கள் மற்றும் அளவுருக்களைப் புதுப்பித்தல் | [படி](../../book-ta/chapter9.ta.md) | [9](../../chapter9/README.ta.md) |
|
||||
| 10 | 🤝 **பல-ஏஜென்ட் ஒத்துழைப்பு** | கூட்டு நுண்ணறிவு > தனிப்பட்டது: ஒத்துழைப்பு கட்டமைப்பு, சூழல் பகிர்வு/தனிமைப்படுத்தல், "ஏஜென்ட் சமூகம்" | [படி](../../book-ta/chapter10.ta.md) | [7](../../chapter10/README.ta.md) |
|
||||
|
||||
|
||||
> 💡 **படி** = GitHub-இல் அத்தியாய உரையைப் படிக்க (markdown); **N** = துணை திட்டங்களின் எண்ணிக்கை, குறியீட்டுக்கு சொடுக்கவும். திட்ட வகைகள் (✅ தனித்து / 📖 மறு உருவாக்கம் / 🚧 வடிவமைப்பு) ஒவ்வொரு அத்தியாய README-இல்.
|
||||
>
|
||||
> 📚 இந்தப் புத்தகத்தை எப்படி திறம்பட படிப்பது? **[கற்றல் பரிந்துரைகள்](LEARNING.md)** பார்க்கவும்.
|
||||
|
||||
## 💻 துணை சோதனைகளை இயக்குதல்
|
||||
|
||||
பொதுவாக ஆதரிக்கப்படும் வரம்பு **Python 3.11–3.13**. களஞ்சியத்தின் மூல அடைவிலிருந்து அத்தியாயம் வாரியாக சார்புகளை நிறுவவும்; வேறு அத்தியாயத்திற்கு `ch1` என்பதை `ch2` முதல் `ch10` வரை மாற்றவும்:
|
||||
|
||||
```bash
|
||||
# பரிந்துரை: மீண்டும் உருவாக்கக்கூடிய அத்தியாய சூழலுக்கு commit செய்யப்பட்ட uv.lock-ஐ பயன்படுத்தவும்
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# uv இல்லையெனில்: pyproject.toml-இலிருந்து pip மூலம் மீண்டும் resolve செய்யவும்
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
மாதிரியை அழைக்கும் சோதனையை இயக்கும் முன், அந்தச் சோதனையின் README-ஐப் பின்பற்றி credential-களை அமைக்கவும். Root-level configuration ஆதரிக்கும் சோதனைகள் `.env.example`-ஐ `.env` ஆக copy செய்து குறைந்தது ஒரு provider key-ஐ பயன்படுத்தலாம்; சில சோதனைகளுக்கு அருகிலுள்ள `.env` அல்லது exported environment variable-கள் தேவை. அந்தச் சோதனையின் README அல்லது CLI `ollama`-வை தெளிவாகப் பட்டியலிட்டால் மட்டுமே local Ollama-வை `--provider ollama` உடன் பயன்படுத்தவும்.
|
||||
|
||||
நிறுவிய பிறகு களஞ்சியத்தின் மூல அடைவிலிருந்து சோதனையை இயக்கலாம்:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# pip மூலம் நிறுவியிருந்தால்: python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- `uv` நிறுவ [அதிகாரப்பூர்வ வழிகாட்டியைப்](https://docs.astral.sh/uv/getting-started/installation/) பார்க்கவும். `pip` தொடர்ந்து ஆதரிக்கப்படுகிறது, ஆனால் lockfile-ஐ பயன்படுத்தாது.
|
||||
- மாற்றக் காலத்தில் ஒவ்வொரு சோதனையின் `requirements.txt` தொடர்ந்து செயல்படும்; தனிப்பட்ட திட்டங்கள் மற்றும் சிறப்பு பதிப்பு கட்டுப்பாடுகளுக்கு இது ஏற்றது.
|
||||
- `all` என்பது CPU-க்கு ஏற்ற பரந்த தொகுப்பு; எல்லா சோதனைகளும் அதில் அடங்காது. `uv sync` ஒவ்வொரு முறையும் தற்போதைய தேர்வுடன் exact sync செய்கிறது, எனவே special extra-களை ஒரே கட்டளையில் சேர்க்கவும்: `uv sync --locked --extra ch2 --extra vllm` அல்லது `uv sync --locked --extra ch7 --extra unsloth`; pip-க்கு `python -m pip install -e ".[ch2,vllm]"`.
|
||||
- browser, CUDA, FFmpeg, Ollama, Playwright browser மற்றும் வெளிப்புற களஞ்சியங்கள் போன்ற system dependency-களுக்கு ஒவ்வொரு சோதனையின் README-ஐ பின்பற்றவும். அத்தியாயம் 8-இல் சேர்க்கப்பட்ட சில third-party component-களுக்கு Python 3.12+ தேவை.
|
||||
|
||||
## 🔑 API விசைகள்
|
||||
|
||||
பல தளங்களில் API விசை பெற பரிந்துரைக்கப்படுகிறது. மாதிரி தேர்வுக்கு [இந்த வழிகாட்டி](https://01.me/2025/07/llm-api-setup/).
|
||||
|
||||
| தளம் | Link | அம்சங்கள் | அணுகல் முனைகள் |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | Kimi series, நீண்ட சூழல் மற்றும் Agent திறன் வலுவாக | சீனா நிலப்பரப்பு |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6, சீன மொழி வலுவாக, செலவு-செயல்திறன் நல்லது | சீனா நிலப்பரப்பு |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | பல திறந்த மூல மாதிரிகள் (DeepSeek, Qwen போன்ற), சீனா நிலப்பரப்பில் விரைவான அணுகல் | சீனா நிலப்பரப்பு |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | DeepSeek அதிகாரப்பூர்வ API | உலகளாவிய + சீனா நிலப்பரப்பு |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | உலகளாவிய மற்றும் சீன உள்நாட்டு முக்கிய மாதிரிகளை (OpenAI, Claude, Gemini, Grok, Kimi, GLM, DeepSeek, Qwen, Minimax) ஒரே இடத்திலிருந்து அணுகலாம் | உலகளாவிய + சீனா நிலப்பரப்பு |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | உலகளாவிய மற்றும் சீன உள்நாட்டு முக்கிய மாதிரிகளை (GPT, Claude, Gemini, Kimi, GLM, DeepSeek, Qwen போன்ற) ஒரே இடத்திலிருந்து அணுகலாம் | உலகளாவிய |
|
||||
|
||||
## 💎 ஸ்பான்சர்கள்
|
||||
|
||||
இந்த திட்டத்திற்கு ஸ்பான்சர் செய்த **Krill AI**-க்கு நன்றி! Krill நிறுவனம் GPT / Claude / Gemini மற்றும் பல சீன மாதிரிகளுக்கு அதிகாரப்பூர்வ, நிலையான, அதிவேக API அணுகல் சேவையை வழங்குகிறது; நிறுவன அளவிலான தனிப்பயனாக்கம், விலைப்பட்டியல் வசதி, 7×16 மணி நேர அர்ப்பணிப்பு தொழில்நுட்ப ஆதரவு, மேலும் விரைவான முதல் டோக்கன் வேகத்திற்கான பிரத்யேக WebSocket இணைப்பும் உண்டு.
|
||||
|
||||
புத்தக வாசகர்களுக்கு Krill சிறப்பு சலுகை வழங்குகிறது: [இந்த இணைப்பு](https://www.krill-ai.net/register?invite=Q8D3L35725) மூலம் பதிவு செய்து, ரீசார்ஜ் செய்யும் போது "ai-agent-book" என்ற சலுகைக் குறியீட்டை உள்ளிட்டால், முதல் Codex திட்ட வாங்குதலில் 23% தள்ளுபடி!
|
||||
|
||||
> 🧪 சோதனைகளின் இயக்க நிலை, ஆதாரங்கள் மற்றும் இன்னும் நிறைவேறாத ஏற்பு நிபந்தனைகள் [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md)-இல் தனியாகப் பதிவு செய்யப்படுகின்றன; மூலக் குறியீட்டை clone செய்வது அல்லது நிறுவுவது மட்டும் சோதனை முடிந்ததற்கான சான்றல்ல.
|
||||
|
||||
## 📦 பின்னிணைப்பு · வெளிப்புற களஞ்சியங்களைப் பெறுதல்
|
||||
|
||||
அத்தியாயம் 6, 7, 9, 10-இல் உள்ள benchmark, பயிற்சி framework, ரோபோ தளங்களுக்கான 23 வெளிப்புற களஞ்சியங்கள் **சேர்க்கப்படவில்லை** (அளவு மற்றும் உரிமம் காரணமாக), தாங்களாகவே clone செய்ய வேண்டும்.
|
||||
|
||||
### ஒரே நேரத்தில் clone ச்கிரிப்ட்
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 clone கட்டளைகளை விரிவாக்கு</b> (23 வெளிப்புற களஞ்சியங்கள்)</summary>
|
||||
|
||||
```bash
|
||||
# அத்தியாயம் 6 · மதிப்பீட்டு Benchmarks
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# அத்தியாயம் 7 · பயிற்சி Frameworks (bojieli/* புத்தகத்திற்கு ஏற்ற forks)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # Exp 7-3 train LLM from scratch
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # Exp 7-4 train VLM (projection layer)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # Exp 7-14 RLVP paper code
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # Exp 7-13 vision-language-action RL
|
||||
|
||||
# அத்தியாயம் 9 · உலாவி தானியக்கம் & Claude எடுத்துக்காட்டுகள்
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# அத்தியாயம் 10 · இரட்டை-ஏஜென்ட் கட்டமைப்பு (TalkAct-ஆக தனியாக உருவாகியது) + Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # Exp 10-5 Stanford AI Town
|
||||
```
|
||||
|
||||
> ஏதேனும் திட்ட README குறிப்பிட்ட commit-ஐ குறிப்பிட்டால், மறு உருவாக்கத்திற்கு அந்த பதிப்பிற்கு `git checkout` செய்யவும். அத்தியாயம் 10 `use-computer-while-calling` தனியாக பராமரிக்கப்படும் [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct)-ஆக வளர்ந்துள்ளது; இந்த களஞ்சியம் அந்த அடைவை உள்ளடக்காது—மேலே உள்ள clone கட்டளையைப் பயன்படுத்தி அதைப் பெறவும்.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 பங்களிப்பு
|
||||
|
||||
புத்தகம் மற்றும் துணை குறியீடு முழுமையாக திறந்த மூலமாகும். Pull Request-களை வரவேற்கிறோம்:
|
||||
|
||||
| வகை | விளக்கம் |
|
||||
| --- | --- |
|
||||
| 📝 **புத்தக உள்ளடக்கம்** | பிழைத்திருத்தம், சேர்த்தல், தெளிவான வார்த்தைகள், அல்லது புதிய முன்னேற்றங்கள் (உரை `book/chapter*.md`-இல்) |
|
||||
| 🐛 **குறியீடு மேம்பாடு & bug திருத்தம்** | துணை திட்டங்களை வலுவானதாக, பயன்படுத்த எளிதாக, உற்பத்தி-தயாராக மாற்று |
|
||||
| 🧪 **புதிய நடைமுறை திட்டங்கள்** | சோதனைகளுக்கு சிறந்த செயலாக்கத்தைச் சேர்க்கவும்/மாற்றவும், அல்லது புதிய எடுத்துக்காட்டுகளைப் பங்களிக்கவும் |
|
||||
| 🎨 **பட வடிவமைப்பு** | `book/images/`-இல் பதியப்பட்ட SVG விளக்கப்படங்களை நேரடியாக மேம்படுத்தவும் |
|
||||
| 🌐 **புதிய மொழிபெயர்ப்புகள்** | மேலும் மொழிகளுக்கு மொழிபெயர்ப்பை வரவேற்கிறோம்; ஆங்கிலம் (`book-en/`), அரபு (`book-ar/`), பாரம்பரிய சீனம்/தைவான் (`book-zhtw/`), தமிழ் (`book-ta/`), வியட்நாம் (`book-vi/`), ஜப்பானியம் (`book-ja/`), துருக்கியம் (`book-tr/`), கொரிய மொழி (`book-ko/`) பார்க்கவும் |
|
||||
|
||||
சமர்ப்பிக்கும் முன், தொடர்புடைய சோதனைகளை இயக்கி மறு உருவாக்கத்தை உறுதிப்படுத்தவும்; கருத்துக்களைப் பேச முதலில் issue திறக்கலாம்.
|
||||
|
||||
## 📄 உரிமம்
|
||||
|
||||
இந்த திட்டம் [Apache License 2.0](../../LICENSE) கீழ் உரிமம் பெற்றது. விவரங்களுக்கு [`LICENSE`](../../LICENSE) பார்க்கவும். சில துணை திட்டங்கள் தங்கள் சொந்த உரிமத் தகவலைக் கொண்டிருக்கலாம்; விவரங்களுக்கு துணை திட்டத்தைப் பார்க்கவும்.
|
||||
|
||||
## ⭐ Star வரலாறு
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>[`scripts/gen_star_history.py`](../../scripts/gen_star_history.py) ஆல் உருவாக்கப்பட்டது, [GitHub Actions](../../.github/workflows/star-history.yml) ஆல் தினசரி புதுப்பிக்கப்படுகிறது · நேரடி தரவுக்கு படத்தைச் சொடுக்கவும்</sub>
|
||||
@@ -0,0 +1,54 @@
|
||||
# Öğrenme Önerileri
|
||||
|
||||
← [Ana README'ye dön](README.md)
|
||||
|
||||
|
||||
### Temel Kavram: Agent = Model + Bağlam + Araçlar
|
||||
|
||||
Bu kitabın temel çerçevesi **Agent = Model + Bağlam + Araçlar**'dır. Bu üç bileşen, bir ajanın akıllı davranışını gerçekleştirmek için birlikte çalışır:
|
||||
|
||||
- **Model**: Ajanın beyni; anlama, muhakeme ve karar verme yeteneklerini sağlar.
|
||||
- **Bağlam (Context)**: Ajanın işletim sistemi; sistem talimatlarını, diyalog geçmişini, muhakeme süreçlerini, araç etkileşim kayıtlarını vb. içerir.
|
||||
- **Araçlar (Tools)**: Ajanın elleri; ortamı algılamasını, eylemleri yürütmesini ve dış dünyayla etkileşim kurmasını sağlar.
|
||||
|
||||
### Öğrenme Yolu
|
||||
|
||||
Öğrenme yolu, kitabın tamamına bölüm bölüm karşılık gelir ve üç temel direk etrafında katman katman açılır:
|
||||
|
||||
- **Bölüm 1 · Temeller**: Ajan sistemleri için eksiksiz bir bilişsel çerçeve kurun—RL'deki ajan tanımını anlayın, geleneksel RL ile LLM+RL paradigmaları arasındaki örnek verimliliği farklarını karşılaştırın, "ajan olarak model" yeni paradigmasını kavrayın ve **Agent = Model + Bağlam + Araçlar** temel çerçevesine hakim olun. **Temel İçgörü**: Ön bilginin önemi algoritmaları ve ortamları aşar.
|
||||
|
||||
- **Bölüm 2–3 · Bağlam**: Bağlam, ajanın işletim sistemidir. Bölüm 2, sistem istemlerini, KV Cache dostu tasarımı, bağlam sıkıştırmayı ve prompt mühendisliği ablasyonunu kapsar. Bölüm 3, kullanıcı belleğini, yoğun/seyrek/hibrit erişimi, Agentic RAG'ı, bağlam duyarlı erişimi ve yapılandırılmış bilgi çıkarımını kapsar. **Temel İçgörü**: Tam bağlam; sistem talimatlarını, diyalog geçmişini, muhakeme süreçlerini, araç etkileşim kayıtlarını, kullanıcı belleğini ve harici bilgiyi içerir.
|
||||
|
||||
- **Bölüm 4–5 · Araçlar**: Araçlar, ajanın dünyayla etkileşim kurmasının köprüsüdür. Bölüm 4, üç tür MCP aracını (algı/yürütme/işbirliği), olay tetiklemesini ve asenkron mimariyi kapsar. Bölüm 5, üretim seviyesinde bir Coding Agent'ın tam uygulamasına iner. **Temel İçgörü**: Araç tasarımı genelleştirilmiş olmalıdır (bir kod yorumlayıcı bir hesap makinesinden daha iyidir); kod, yeni araçlar yaratan meta-yetenektir.
|
||||
|
||||
- **Bölüm 6–7 · Model**: Zekayı nasıl ölçer ve büyütürüz. Bölüm 6, Terminal-Bench, SWE-bench, GAIA, OSWorld ve Tau2-Bench gibi değerlendirme kıstaslarını kapsar. Bölüm 7, SFT, RL, RLHF ve örnek verimliliği gibi eğitim sonrası teknikleri kapsar. **Temel İçgörü**: Bağımsız bir doğrulama sinyali, "modele tekrar düşünmesini sormaktan" daha güvenilirdir; "ajan olarak model", RL yoluyla araç çağrılarını yerel bir yeteneğe içselleştirir.
|
||||
|
||||
- **Bölüm 8 · Kendi Kendine Evrim**: Ajanların, ağırlıkları değiştirmeden deneyimden büyümesini sağlayın—deneyim öğrenimi, iş akışlarını araçlara dışsallaştırma, promptları ve gözlemleri parametrelere damıtma. **Temel İçgörü**: Deneyimden öğrenme, bir ajanın "akıllı" olmaktan "usta" olmaya geçmesinin anahtarıdır.
|
||||
|
||||
- **Bölüm 9–10 · Genişleme ve İşbirliği**: Bölüm 9, algı ve eylemi metinden sese, GUI'ye ve fiziksel dünyaya genişletir. Bölüm 10, karmaşık görevleri ele almak için çoklu ajan iş bölümünü kullanır. **Temel İçgörü**: Çoklu ajan sistemindeki her tasarım kararı, tekil bir ajanın üç unsurunda karşılığını bulabilir.
|
||||
|
||||
## Metin ile deneylerin görev paylaşımı
|
||||
|
||||
Kitap tek bir SDK için adım adım bir öğretici değildir. Kısa pseudocode ve skeleton'lar durum akışını, durma noktalarını ve doğrulama sınırlarını açıklar; bölüm deneyleri tam uygulama, adapter, test, günlük ve kanıt sağlar.
|
||||
|
||||
| Katman | Önce oku | Şimdilik atla | Yanıtladığı soru |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | Proje README'si: amaç, minimum komut ve kabul koşulları; metindeki karşılık gelen skeleton | kimlik bilgileri, UI, sağlayıcı adaptörleri ve uzun ham günlükler | Bu deney hangi mekanizmayı kanıtlamayı amaçlıyor? |
|
||||
| **Builder** | giriş noktası, çekirdek döngü, durum/mesaj şeması, araçlar ve doğrulayıcı | mekanizmayla ilgisiz uyumluluk/dağıtım katmanları | Hangi değişken davranışı değiştirdi? |
|
||||
| **Maintainer** | testler, hata işleme, kanıt biçimi, manifest/hash ve geri alma yolu | deneyi değiştirirken gereken üçüncü taraf ayrıntıları | Sonuç yeniden üretilebilir mi ve hatalar dürüstçe kaydedilmiş mi? |
|
||||
|
||||
### Zorluk Seviyeleri
|
||||
|
||||
- **Başlangıç** (Bölüm 1–2): Yeni başlayanlara uygun, temel kavramları anlama.
|
||||
- **Orta** (Bölüm 3–4): Biraz programlama altyapısı gerektirir, sistem entegrasyonunu içerir.
|
||||
- **İleri** (Bölüm 5–6): Güçlü programlama becerileri gerektirir, karmaşık sistem tasarımını içerir.
|
||||
- **Uzman** (Bölüm 7–8): Derin öğrenme ve eğitim/kendi kendine evrim deneyimi gerektirir.
|
||||
- **Uygulama** (Bölüm 9–10): Önceki bilgilerin pratik uygulamalar inşa etmek için kapsamlı kullanımı.
|
||||
|
||||
### Pratik Öneriler
|
||||
|
||||
1. **Uygulamalı Pratik**: Her proje bağımsız çalıştırılabilecek şekilde tasarlanmıştır. Kodu kendiniz çalıştırıp değiştirmeniz önerilir.
|
||||
2. **Kitapla Birleştirin**: Teori ve pratiğin birleşimini anlamak için bu deponun [`book-tr/`](../../book-tr/) dizinindeki (Türkçe) ya da [`book/`](../../book/) dizinindeki (Çince orijinal) ilgili bölümlerini okuyun.
|
||||
3. **Deneysel Karşılaştırma**: Pek çok proje ablasyon çalışmaları ve karşılaştırmalı deneyler içerir. Karşılaştırma yoluyla anlayışınızı derinleştirin.
|
||||
4. **Kademeli Öğrenme**: Basit projelerle başlayın ve giderek karmaşık sistemlere inin.
|
||||
5. **Protokollere Odaklanın**: Bölüm 4'teki MCP sunucu projesi, ölçeklenebilir ajanlar inşa etmenin anahtarı olan standartlaştırılmış araç protokollerini gösterir.
|
||||
@@ -0,0 +1,162 @@
|
||||
# AI Agent'ları Derinlemesine Anlamak: Tasarım İlkeleri ve Mühendislik Pratiği
|
||||
|
||||
[](#-e-kitap) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-e-kitap)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · Türkçe ← şu an · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[PDF / EPUB indir](#-e-kitap)** (önerilir) — PDF / EPUB sürümleri en iyi okuma deneyimini sunar; kitabı [çevrimiçi](https://bojieli.github.io/ai-agent-book/) da okuyabilirsiniz.
|
||||
|
||||
**Agent = LLM + Bağlam + Araçlar** — Bu kitap, bu temel formül etrafında 10 bölümde AI Agent'ları ilkelerden mühendislik pratiğine taşıyor. Tüm metin, görseller ve **93 eşlik eden deney** açık kaynak; deneyleri bizzat çalıştırmanız için sizi bekliyor.
|
||||
|
||||
> 📢 **1.4'e kıyasla 2.0 sürümündeki değişiklikler:** 2.0 sürümü, eski 4. bölümdeki “eşzamansız etkileşim” kısmını eski 9. bölümdeki “çok modlu Agent” içeriğiyle birleştirerek yeni 6. bölüm “Etkileşim: Gözlem ve Eylem Uzaylarının Genişletilmesi” olarak yeniden düzenler. Eski 6. (“Agent'ın Değerlendirmesi”), 7. (“Model Post-Training”) ve 8. (“Agent'ın Sürekli Evrimi”) bölümler birer bölüm geriye kaydırılmış ve sırasıyla 7., 8. ve 9. bölümler olmuştur.
|
||||
>
|
||||
> Eski bir PDF okuyorsanız [en son PDF'yi indirmenizi](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) öneririz. Yeni sürüm ayrıca çok sayıda içerik düzeltmesi ve düzenlemesi içerir; lütfen en güncel sürümü kullanın.
|
||||
|
||||
| 📚 **10 bölüm** metin, temelden üretime | 📂 **93** eşlik eden proje (70+ bağımsız çalıştırılabilir) | 🌐 **14 dil**: CN / EN / ES / ID / AR / zh-TW / RU / TA / VI / JA / TR / KO / HU / HE |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 E-Kitap
|
||||
|
||||
> 📥 **Doğrudan indir** (tam metin, ücretsiz ve açık kaynak). Aşağıdaki bağlantılar her zaman `main` dalının en son derlemesine işaret eder; sabit sürümler için [Releases](https://github.com/bojieli/ai-agent-book/releases) sayfasına bakın:
|
||||
> - **Çince (orijinal)**: [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **Tayvan Geleneksel Çincesi** (topluluk çevirisi, by [@tigercosmos](https://github.com/tigercosmos)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **İngilizce** (topluluk çevirisi, by [@nsdevaraj](https://github.com/nsdevaraj) ve [@whanyu1212](https://github.com/whanyu1212)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **İspanyolca** (topluluk çevirisi, by [@santhreal](https://github.com/santhreal)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Arapça** (topluluk çevirisi, by [@TheSyBuilder](https://github.com/TheSyBuilder)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Rusça** (topluluk çevirisi, by [@ui99ru](https://github.com/ui99ru)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Tamilce** (topluluk çevirisi, by [@nsdevaraj](https://github.com/nsdevaraj)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Vietnamca** (topluluk çevirisi, by [@toanalien](https://github.com/toanalien)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Japonca** (topluluk çevirisi, by [@eltociear](https://github.com/eltociear)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Türkçe** (topluluk çevirisi, by [@memisemre](https://github.com/memisemre)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Korece** (topluluk çevirisi, by [@JeongJaeSoon](https://github.com/JeongJaeSoon)): [PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 Kitabı ayrıca [çevrimiçi okuyabilirsiniz](https://bojieli.github.io/ai-agent-book/) — dil değiştirici, katlanabilir bölüm ağacı, tam metin araması ve eşlik eden deneylere doğrudan bağlantılar sunar.
|
||||
|
||||
Çince metin kaynağı [`book/`](../../book/) içindedir; İngilizce/İspanyolca/Arapça/Geleneksel Çince/Rusça/Tamilce/Vietnamca/Japonca/Türkçe/Korece sürümleri topluluk katkısıdır (Çince orijinalin gerisinde kalabilir), sırasıyla [`book-en/`](../../book-en/), [`book-es/`](../../book-es/), [`book-ar/`](../../book-ar/), [`book-zhtw/`](../../book-zhtw/), [`book-ru/`](../../book-ru/), [`book-ta/`](../../book-ta/), [`book-vi/`](../../book-vi/), [`book-ja/`](../../book-ja/), [`book-tr/`](../../book-tr/), [`book-ko/`](../../book-ko/) klasörlerinde bulunur.
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 PDF / EPUB'ı kendiniz derlemek mi istiyorsunuz?</b> (PDF için pandoc / xelatex / ElegantBook gereklidir)</summary>
|
||||
|
||||
- **EPUB**: Birleşik derleme betiğini kullanın; bkz. [EPUB derleme talimatları](../../EPUB.md)
|
||||
- **Metin kaynağı**: `book-tr/introduction.tr.md` (giriş), `book-tr/chapter1.tr.md` ~ `book-tr/chapter10.tr.md` (Bölüm 1–10), `book-tr/afterword.tr.md` (son söz).
|
||||
- **Derleme**: pandoc, xelatex, ElegantBook belge sınıfı ve gerekli fontları kurduktan sonra çalıştırın
|
||||
|
||||
```bash
|
||||
cd book-tr && bash build_pdf.sh
|
||||
```
|
||||
|
||||
Görseller `book-tr/images/` içinde saklanır; tipografi ayrıntıları için `book-tr/preamble.tex` ve `book-tr/*.lua` dosyalarına bakın.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 İçerik Özeti (Bölüm 1–10)
|
||||
|
||||
Kitap, **Agent = LLM + Bağlam + Araçlar** temel formülü etrafında şekillenir; on bölüm birbiri üzerine kademeli olarak inşa edilir:
|
||||
|
||||
| Böl | Konu | Tek Cümlelik Özet | Metin | Kod |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Agent Temelleri** | "Ajan Olarak Model" paradigması + **Agent = LLM + Bağlam + Araçlar**; Harness mühendisliği gerçek rekabet avantajıdır | [Oku](../../book-tr/chapter1.tr.md) | [4](../../chapter1/README.tr.md) |
|
||||
| 2 | 🎯 **Bağlam Mühendisliği** | Bağlam, Agent'ın yetenek tavanını belirler: KV Cache, prompt mühendisliği, Agent Skills, bağlam sıkıştırma | [Oku](../../book-tr/chapter2.tr.md) | [9](../../chapter2/README.tr.md) |
|
||||
| 3 | 📚 **Kullanıcı Belleği ve Bilgi Tabanları** | Oturumlar arası kullanıcı belleği + harici bilgi: kullanıcı belleği, RAG, yapılandırılmış indeksler, bilgi grafikleri | [Oku](../../book-tr/chapter3.tr.md) | [12](../../chapter3/README.tr.md) |
|
||||
| 4 | 🛠️ **Araçlar** | Araçlar Agent'ın elleridir: MCP protokolü, algı/yürütme/işbirliği araçları, olay güdümlü asenkron Agent'lar, proaktif araç keşfi | [Oku](../../book-tr/chapter4.tr.md) | [8](../../chapter4/README.tr.md) |
|
||||
| 5 | 💻 **Coding Agent ve Kod Üretimi** | Kod, "yeni araçlar yaratabilen bir araçtır"; üretim seviyesinde Coding Agent'ın tam görünümü | [Oku](../../book-tr/chapter5.tr.md) | [13](../../chapter5/README.tr.md) |
|
||||
| 6 | 🎙️ **Etkileşim: Gözlem ve Eylem Uzaylarının Genişletilmesi** | Agent'ın gözlem ve eylem uzaylarını kiplik ve zaman boyunca genişletmek: eşzamansız ve olay odaklı sistemler, ses, Computer Use ve robotik | [Oku](../../book-tr/chapter6.tr.md) | [13](../../chapter6/README.tr.md) |
|
||||
| 7 | 🎯 **Agent'ın Değerlendirmesi** | Performansı karşılaştırılabilir sinyallere dönüştürmek: ortamlar, metrikler, istatistiksel anlamlılık ve değerlendirme odaklı seçim | [Oku](../../book-tr/chapter7.tr.md) | [13](../../chapter7/README.tr.md) |
|
||||
| 8 | 🧠 **Model Post-Training** | Üç aşama—ön eğitim, SFT ve RL: ne zaman SFT veya RL seçileceği, araç çağrılarının içselleştirilmesi ve örnek verimliliği | [Oku](../../book-tr/chapter8.tr.md) | [19](../../chapter8/README.tr.md) |
|
||||
| 9 | 🔄 **Agent'ın Sürekli Evrimi** | Yürütme izlerinden öğrenme sinyalleri elde etmek ve bilgiyi, talimatları, programları ve parametreleri güncellemek | [Oku](../../book-tr/chapter9.tr.md) | [9](../../chapter9/README.tr.md) |
|
||||
| 10 | 🤝 **Çoklu Ajan İşbirliği** | Kolektif zeka bireyden üstündür: işbirliği çerçeveleri, bağlam paylaşımı/izolasyonu, ortaya çıkan "Agent Toplumu" | [Oku](../../book-tr/chapter10.tr.md) | [7](../../chapter10/README.tr.md) |
|
||||
|
||||
> 💡 **Oku** = bölüm metnini GitHub üzerinde doğrudan oku (markdown); **N** = eşlik eden proje sayısı, koda bakmak için tıklayın. Proje türleri (✅ Bağımsız / 📖 Yeniden üretim / 🚧 Tasarım) her bölümün README'sinde açıklanır.
|
||||
>
|
||||
> 📚 Bu kitabı verimli okumak için bkz. **[Öğrenme Önerileri](LEARNING.md)** (temel fikirler, öğrenme yolu, zorluk seviyeleri, pratik ipuçları).
|
||||
|
||||
## 🔑 API Anahtarları
|
||||
|
||||
Öğrenmeyi kolaylaştırmak için birkaç platformdan API anahtarı almanız önerilir. Model seçimi için [bu rehbere](https://01.me/2025/07/llm-api-setup/) bakabilirsiniz.
|
||||
|
||||
| Platform | Bağlantı | Notlar |
|
||||
| --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | Kimi serisi, uzun bağlam ve Agent yeteneklerinde güçlü |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6 vb., Çince yeteneği güçlü, uygun maliyetli |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | Çeşitli açık kaynak modeller (DeepSeek, Qwen vb.) |
|
||||
| **Volcano Engine** | <https://www.volcengine.com/product/ark> | ByteDance Doubao (kapalı kaynak), Çin'de düşük gecikme |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | Gemini / Claude / GPT-5 vb.'ye tek noktadan erişim (resmi API'ler yurt dışı IP/ödeme gerektirir; OpenAI ayrıca yurt dışı kimlik doğrulaması ister) |
|
||||
|
||||
> 🧪 Deneylerin yürütme durumu, kanıtları ve karşılanmamış kabul koşulları ayrı olarak [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md) dosyasında izlenir; kaynak kodu klonlamak veya kurmak deneyin tamamlandığını kanıtlamaz.
|
||||
|
||||
## 📦 Ek · Harici Depoların Temin Edilmesi
|
||||
|
||||
Bölüm 6, 7, 9, 10'daki değerlendirme kıstasları, eğitim çerçeveleri ve robot platformları için 23 harici depo (boyut ve lisanslama nedeniyle) **pakete dahil değildir** ve karşılık gelen dizinlere klonlanması gerekir.
|
||||
|
||||
### Tek Seferde Klonlama Betiği
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Klonlama komutlarını genişlet</b> (23 harici depo)</summary>
|
||||
|
||||
```bash
|
||||
# Bölüm 6 · Değerlendirme Kıstasları
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# Bölüm 7 · Eğitim Çerçeveleri (bojieli/* kitaba uyarlanmış fork'lardır)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # Deney 7-3 sıfırdan LLM eğitimi
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # Deney 7-4 sıfırdan VLM eğitimi (projeksiyon katmanı)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # Deney 7-14 RLVP makale kodu
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # Deney 7-13 görsel-dil-eylem RL
|
||||
|
||||
# Bölüm 9 · Tarayıcı Otomasyonu ve Claude Örnekleri
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# Bölüm 10 · İkili Agent Mimarisi (artık bağımsız TalkAct projesi) + Stanford AI Kasabası
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # Deney 10-5 Stanford AI Kasabası
|
||||
```
|
||||
|
||||
> Bir proje README'si belirli bir commit belirtiyorsa, tekrarlanabilirlik için o sürüme `git checkout` yapın. Bölüm 10'daki `use-computer-while-calling`, bağımsız olarak sürdürülen [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct) projesine dönüştü; bu depo yalnızca ona işaret eden bir belge tutar.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Katkıda Bulunma
|
||||
|
||||
Kitap ve eşlik eden kod tamamen açık kaynaktır. Pull Request'ler büyük memnuniyetle karşılanır:
|
||||
|
||||
| Tür | Notlar |
|
||||
| --- | --- |
|
||||
| 📝 **Kitap içeriği** | Hatalar, ekler, daha net ifadeler veya yeni gelişmeler (metin `book/chapter*.md` içinde) |
|
||||
| 🐛 **Kod iyileştirmeleri ve hata düzeltmeleri** | Eşlik eden projeleri daha sağlam, kullanışlı ve üretime hazır hale getirin |
|
||||
| 🧪 **Yeni pratik projeler** | Deneyler için daha iyi uygulamalar ekleyin/değiştirin veya yeni örnekler katkısında bulunun |
|
||||
| 🎨 **Görsel tasarımı** | `book/images/` içindeki grafikleri daha net ve düzgün hale getirin (`book/gen_*_figs.py` tarafından üretilir) |
|
||||
| 🌐 **Yeni çeviriler** | Daha fazla dile çeviri memnuniyetle karşılanır; referans için Tayvan Geleneksel Çincesi (`book-zhtw/`), İngilizce (`book-en/`), Tamilce (`book-ta/`), Vietnamca (`book-vi/`), Türkçe (`book-tr/`) ve Korece (`book-ko/`) klasörlerine bakabilirsiniz |
|
||||
|
||||
Göndermeden önce lütfen ilgili deneyleri çalıştırıp tekrarlanabilirliği doğrulayın; fikirleri önce tartışmak için bir issue açmaktan çekinmeyin.
|
||||
|
||||
## 📄 Lisans
|
||||
|
||||
Bu proje [Apache License 2.0](../../LICENSE) altında lisanslanmıştır. Ayrıntılar için [`LICENSE`](../../LICENSE) dosyasına bakın. Bazı alt projeler kendi lisans bilgilerini içerebilir; ayrıntılar için ilgili alt projeye başvurun.
|
||||
|
||||
## ⭐ Star Geçmişi
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>[`scripts/gen_star_history.py`](../../scripts/gen_star_history.py) tarafından üretilir, [GitHub Actions](../../.github/workflows/star-history.yml) tarafından günlük güncellenir · Canlı veriler için görsele tıklayın</sub>
|
||||
@@ -0,0 +1,53 @@
|
||||
# Gợi ý học tập
|
||||
|
||||
← [Về README chính](README.md)
|
||||
|
||||
### Tư tưởng cốt lõi: Agent = mô hình + context + tools
|
||||
|
||||
Khung cốt lõi của sách là **Agent = mô hình + context + tools**. Ba thành phần này phối hợp với nhau để hiện thực hành vi thông minh của Agent:
|
||||
|
||||
- **Mô hình (Model)**: bộ não của Agent, cung cấp năng lực hiểu, suy luận và ra quyết định
|
||||
- **Ngữ cảnh (Context)**: hệ điều hành của Agent, bao gồm chỉ dẫn hệ thống, lịch sử hội thoại, quá trình suy luận, bản ghi tương tác công cụ, v.v.
|
||||
- **Công cụ (Tools)**: đôi tay của Agent, giúp Agent cảm nhận môi trường, thực thi thao tác và tương tác với thế giới bên ngoài
|
||||
|
||||
### Lộ trình học
|
||||
|
||||
Lộ trình học tương ứng một-một với các chương của sách, triển khai từng lớp quanh ba trụ cột lớn:
|
||||
|
||||
- **Chương 1 · Phần nền tảng**: xây dựng khung nhận thức hoàn chỉnh về hệ thống Agent — hiểu định nghĩa Agent trong RL, so sánh khác biệt về hiệu quả mẫu giữa RL truyền thống và mô thức LLM+RL, hiểu mô hình mới “model as Agent”, nắm vững khung cốt lõi **Agent = mô hình + context + tools**. **Insight then chốt**: tầm quan trọng của tri thức tiên nghiệm vượt qua thuật toán và môi trường.
|
||||
|
||||
- **Chương 2–3 · Phần ngữ cảnh**: ngữ cảnh là hệ điều hành của Agent. Chương 2 bao phủ system prompt, thiết kế thân thiện KV Cache, nén ngữ cảnh và ablation prompt engineering; chương 3 bao phủ bộ nhớ người dùng, truy xuất dày đặc/thưa/lai, Agentic RAG, truy xuất nhận biết ngữ cảnh và trích xuất tri thức có cấu trúc. **Insight then chốt**: ngữ cảnh hoàn chỉnh bao gồm chỉ dẫn hệ thống, lịch sử hội thoại, quá trình suy luận, bản ghi tương tác công cụ, bộ nhớ người dùng và tri thức bên ngoài.
|
||||
|
||||
- **Chương 4–5 · Phần công cụ**: công cụ là cây cầu để Agent tương tác với thế giới. Chương 4 bao phủ ba loại công cụ MCP cảm nhận/thực thi/cộng tác, kích hoạt sự kiện và kiến trúc bất đồng bộ; chương 5 đi sâu vào triển khai đầy đủ Coding Agent cấp sản xuất. **Insight then chốt**: thiết kế công cụ nên tổng quát hóa (code interpreter tốt hơn calculator); mã là siêu năng lực có thể tạo ra công cụ mới.
|
||||
|
||||
- **Chương 6–7 · Phần mô hình**: cách đo lường và phóng đại trí tuệ. Chương 6 bao phủ các benchmark đánh giá như Terminal-Bench, SWE-bench, GAIA, OSWorld, Tau2-Bench; chương 7 bao phủ các kỹ thuật hậu huấn luyện như SFT, RL, RLHF và hiệu quả mẫu. **Insight then chốt**: tín hiệu xác minh độc lập đáng tin cậy hơn “để mô hình nghĩ lại một lần”; “model as Agent” dùng RL để nội hóa gọi công cụ thành năng lực nguyên sinh.
|
||||
|
||||
- **Chương 8 · Phần tự tiến hóa**: giúp Agent trưởng thành từ kinh nghiệm mà không cần đổi trọng số — học từ kinh nghiệm, ngoại hóa workflow thành công cụ, chưng cất prompt và quan sát vào tham số. **Insight then chốt**: học từ kinh nghiệm là chìa khóa để Agent đi từ “thông minh” tới “thành thạo”.
|
||||
|
||||
- **Chương 9–10 · Phần mở rộng và cộng tác**: chương 9 mở rộng cảm nhận và hành động từ văn bản sang giọng nói, GUI và thế giới vật lý; chương 10 xử lý nhiệm vụ phức tạp thông qua phân công cộng tác đa Agent. **Insight then chốt**: mọi quyết định thiết kế trong hệ thống đa Agent đều có thể tìm thấy đối ứng trong ba yếu tố của đơn Agent.
|
||||
|
||||
## Phân công giữa văn bản và thí nghiệm
|
||||
|
||||
Cuốn sách không phải hướng dẫn từng bước cho một SDK cụ thể. Pseudocode và skeleton chỉ ra luồng trạng thái, điểm dừng và ranh giới kiểm chứng; thí nghiệm cung cấp triển khai, adapter, test, log và bằng chứng.
|
||||
|
||||
| Tầng | Đọc trước | Tạm bỏ qua | Câu hỏi mà nó trả lời |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | README dự án: mục tiêu, lệnh tối thiểu và điều kiện nghiệm thu; skeleton tương ứng trong sách | thông tin xác thực, UI, adapter provider và log thô dài | Thí nghiệm này nhằm chứng minh cơ chế nào? |
|
||||
| **Builder** | điểm vào, vòng lặp lõi, schema state/message, tool và verifier | các lớp tương thích/triển khai không liên quan đến cơ chế | Biến nào đã làm thay đổi hành vi? |
|
||||
| **Maintainer** | test, xử lý lỗi, định dạng bằng chứng, manifest/hash và đường rollback | chi tiết bên thứ ba chỉ cần khi sửa thí nghiệm | Kết quả có tái lập được không và lỗi có được ghi nhận trung thực không? |
|
||||
|
||||
### Phân cấp độ khó
|
||||
|
||||
- **Nhập môn** (Chương 1–2): phù hợp với người mới bắt đầu, hiểu khái niệm cơ bản
|
||||
- **Nâng cao** (Chương 3–4): cần nền tảng lập trình nhất định, liên quan đến tích hợp hệ thống
|
||||
- **Cao cấp** (Chương 5–6): cần năng lực lập trình mạnh hơn, liên quan đến thiết kế hệ thống phức tạp
|
||||
- **Chuyên gia** (Chương 7–8): cần kinh nghiệm học sâu và huấn luyện/tự tiến hóa
|
||||
- **Ứng dụng** (Chương 9–10): tổng hợp kiến thức đã học để xây dựng ứng dụng thực tế
|
||||
|
||||
### Gợi ý thực hành
|
||||
|
||||
1. **Tự tay thực hành**: mỗi dự án đều được thiết kế để có thể chạy độc lập; khuyến nghị tự chạy và sửa mã
|
||||
2. **Kết hợp với sách**: đọc cùng các chương tương ứng trong bản thảo tại [`book/`](../../book/) để hiểu sự kết hợp giữa lý thuyết và thực hành
|
||||
3. **So sánh thí nghiệm**: nhiều dự án chứa nghiên cứu ablation và thí nghiệm đối chứng; hãy dùng so sánh để hiểu sâu hơn
|
||||
4. **Học tăng dần**: bắt đầu từ dự án đơn giản rồi dần đi sâu vào hệ thống phức tạp
|
||||
5. **Chú ý giao thức**: các dự án MCP server ở chương 4 minh họa giao thức công cụ chuẩn hóa, đây là chìa khóa để xây dựng Agent có thể mở rộng
|
||||
@@ -0,0 +1,196 @@
|
||||
# Hiểu sâu về AI Agent: Nguyên lý thiết kế và thực hành kỹ thuật
|
||||
|
||||
[](#-sách-điện-tử) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-sách-điện-tử)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · Tiếng Việt ← hiện tại · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[Tải PDF / EPUB](#-sách-điện-tử)** (khuyên dùng) — nên đọc sách qua bản PDF / EPUB để có trải nghiệm tốt nhất; bạn cũng có thể [đọc trực tuyến](https://bojieli.github.io/ai-agent-book/) (chuyển đổi ngôn ngữ, mục lục đóng/mở được, tìm kiếm toàn văn; tự động xây dựng lại sau mỗi lần đẩy lên main).
|
||||
|
||||
**Agent = LLM + Context + Tools** — Cuốn sách xây dựng trên công thức cốt lõi này qua 10 chương, đưa AI Agent từ nguyên lý đến thực hành kỹ thuật. Toàn bộ nội dung, hình minh họa và **93 thí nghiệm đi kèm** đều là mã nguồn mở. Hoan nghênh bạn tự chạy các thí nghiệm.
|
||||
|
||||
> 📢 **Những thay đổi trong bản 2.0 (so với 1.4):** Bản 2.0 hợp nhất phần “tương tác bất đồng bộ” của Chương 4 cũ với nội dung về “Agent đa phương thức” của Chương 9 cũ, rồi tái cấu trúc thành Chương 6 mới, “Tương tác: mở rộng không gian quan sát và không gian hành động”. Các Chương 6 (“Đánh giá Agent”), 7 (“Post-training mô hình”) và 8 (“Sự tiến hóa liên tục của Agent”) trước đây đều lùi lại một chương, nay lần lượt là Chương 7, 8 và 9.
|
||||
>
|
||||
> Nếu bạn đang đọc một bản PDF cũ, chúng tôi khuyên bạn [tải PDF mới nhất](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf). Ấn bản mới còn có nhiều nội dung được sửa chữa và điều chỉnh; vui lòng sử dụng phiên bản mới nhất.
|
||||
|
||||
| 📚 **10 chương** nội dung, từ nền tảng đến sản xuất | 📂 **93** dự án đi kèm (70+ chạy độc lập) | 🌐 **14 ngôn ngữ**: Trung / Anh / Tây Ban Nha / Indonesia / Ả Rập / 繁體中文(台灣) / Nga / Tamil / Việt / Nhật / Thổ Nhĩ Kỳ / Hàn / Hungary / Do Thái |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 Sách điện tử
|
||||
|
||||
> 📥 **Tải xuống PDF / EPUB** (khuyên dùng; toàn bộ nội dung, mã nguồn mở miễn phí). Các liên kết này luôn trỏ tới bản dựng mới nhất của nhánh `main`; bản cố định xem tại [Releases](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **Bản gốc tiếng Trung**:[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **Tiếng Anh**(dịch cộng đồng, by [@nsdevaraj](https://github.com/nsdevaraj)、[@whanyu1212](https://github.com/whanyu1212)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **Tiếng Tây Ban Nha**(dịch cộng đồng, by [@santhreal](https://github.com/santhreal)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **Tiếng Ả Rập**(dịch cộng đồng, by [@TheSyBuilder](https://github.com/TheSyBuilder)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **Trung phồn thể (Đài Loan)**(dịch cộng đồng, by [@tigercosmos](https://github.com/tigercosmos)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **Tiếng Nga**(dịch cộng đồng, by [@ui99ru](https://github.com/ui99ru)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **Tiếng Tamil**(dịch cộng đồng, by [@nsdevaraj](https://github.com/nsdevaraj)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **Tiếng Việt**(dịch cộng đồng, by [@toanalien](https://github.com/toanalien)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **Tiếng Nhật**(dịch cộng đồng, by [@eltociear](https://github.com/eltociear)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **Tiếng Thổ Nhĩ Kỳ**(dịch cộng đồng, by [@memisemre](https://github.com/memisemre)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **Tiếng Hàn**(dịch cộng đồng, by [@JeongJaeSoon](https://github.com/JeongJaeSoon)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 Bạn cũng có thể [đọc trực tuyến](https://bojieli.github.io/ai-agent-book/) — chuyển đổi ngôn ngữ, mục lục đóng/mở được, tìm kiếm toàn văn và liên kết trực tiếp đến các thí nghiệm kèm theo. Tự động xây dựng lại sau mỗi lần đẩy lên main.
|
||||
|
||||
Mã nguồn tiếng Trung nằm trong [`book/`](../../book/); các bản Anh/Tây Ban Nha/Ả Rập/Trung phồn thể (Đài Loan)/Nga/Tamil/Việt/Nhật/Thổ Nhĩ Kỳ/Hàn là đóng góp cộng đồng (có thể chậm hơn bản gốc), nằm trong [`book-en/`](../../book-en/), [`book-es/`](../../book-es/), [`book-ar/`](../../book-ar/), [`book-zhtw/`](../../book-zhtw/), [`book-ru/`](../../book-ru/), [`book-ta/`](../../book-ta/), [`book-vi/`](../../book-vi/), [`book-ja/`](../../book-ja/), [`book-tr/`](../../book-tr/), [`book-ko/`](../../book-ko/).
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Tự build PDF / EPUB?</b> (PDF cần pandoc / xelatex / ElegantBook)</summary>
|
||||
|
||||
- **EPUB**: Sử dụng trình dựng chung; xem [hướng dẫn dựng EPUB](../../EPUB.md)
|
||||
- **Mã nguồn**: `book/introduction.md` (mở đầu), `book/chapter1.md` ~ `book/chapter10.md` (Chương 1–10), `book/afterword.md` (bạt từ)
|
||||
- **Build**: Cài pandoc, xelatex, ElegantBook và font cần thiết, rồi chạy
|
||||
|
||||
```bash
|
||||
cd book && bash build_pdf.sh
|
||||
```
|
||||
|
||||
Hình vẽ được lưu dưới dạng SVG trong `book/images/` và được bản dựng sử dụng trực tiếp; chi tiết typography xem `book/preamble.tex` và `book/*.lua`.
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 Tổng quan nội dung (Chương 1–10)
|
||||
|
||||
Sách xoay quanh công thức cốt lõi **Agent = LLM + Context + Tools**, mười chương tuần tự nâng dần:
|
||||
|
||||
| Ch | Chủ đề | Tóm tắt một câu | Văn bản | Mã |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Kiến thức nền tảng về Agent** | **Agent = LLM + Context + Tools**; kỹ thuật Harness mới là lợi thế cạnh tranh thực sự | [Đọc](../../book-vi/chapter1.vi.md) | [4](../../chapter1/README.vi.md) |
|
||||
| 2 | 🎯 **Kỹ thuật ngữ cảnh** | Ngữ cảnh quyết định trần năng lực: KV Cache, prompt engineering, Agent Skills, nén ngữ cảnh | [Đọc](../../book-vi/chapter2.vi.md) | [9](../../chapter2/README.vi.md) |
|
||||
| 3 | 📚 **Bộ nhớ người dùng và kho tri thức** | Ghi nhớ người dùng qua phiên + tri thức ngoài: bộ nhớ người dùng, RAG, chỉ mục cấu trúc, đồ thị tri thức | [Đọc](../../book-vi/chapter3.vi.md) | [12](../../chapter3/README.vi.md) |
|
||||
| 4 | 🛠️ **Công cụ** | Công cụ là đôi tay Agent: giao thức MCP, cảm nhận/thực thi/cộng tác, Agent bất đồng bộ hướng sự kiện, khám phá công cụ tích cực | [Đọc](../../book-vi/chapter4.vi.md) | [8](../../chapter4/README.vi.md) |
|
||||
| 5 | 💻 **Coding Agent và sinh mã** | Mã là "công cụ tạo ra công cụ mới"; Coding Agent cấp sản xuất đầy đủ | [Đọc](../../book-vi/chapter5.vi.md) | [13](../../chapter5/README.vi.md) |
|
||||
| 6 | 🎙️ **Tương tác: mở rộng không gian quan sát và không gian hành động** | Mở rộng không gian quan sát và hành động của Agent theo phương thức và thời gian: hệ thống bất đồng bộ và hướng sự kiện, giọng nói, Computer Use và robot | [Đọc](../../book-vi/chapter6.vi.md) | [13](../../chapter6/README.vi.md) |
|
||||
| 7 | 🎯 **Đánh giá Agent** | Biến hiệu suất thành tín hiệu có thể so sánh: môi trường, chỉ số, ý nghĩa thống kê và lựa chọn dựa trên đánh giá | [Đọc](../../book-vi/chapter7.vi.md) | [13](../../chapter7/README.vi.md) |
|
||||
| 8 | 🧠 **Post-training mô hình** | Ba giai đoạn—tiền huấn luyện, SFT và RL: khi nào chọn SFT hay RL, nội tại hóa lời gọi công cụ và hiệu quả mẫu | [Đọc](../../book-vi/chapter8.vi.md) | [19](../../chapter8/README.vi.md) |
|
||||
| 9 | 🔄 **Sự tiến hóa liên tục của Agent** | Lấy tín hiệu học tập từ quỹ đạo thực thi và cập nhật kiến thức, chỉ dẫn, chương trình và tham số | [Đọc](../../book-vi/chapter9.vi.md) | [9](../../chapter9/README.vi.md) |
|
||||
| 10 | 🤝 **Cộng tác đa Agent** | Trí tuệ tập thể cao hơn cá thể: khung cộng tác, chia sẻ/cô lập ngữ cảnh, "xã hội Agent" nổi lên | [Đọc](../../book-vi/chapter10.vi.md) | [7](../../chapter10/README.vi.md) |
|
||||
|
||||
|
||||
> 💡 **Đọc** = đọc nội dung chương trên GitHub (markdown); **N** = số dự án đi kèm, nhấp để xem code. Phân loại (✅ Chạy độc lập / 📖 Tái hiện / 🚧 Thiết kế) xem README từng chương.
|
||||
>
|
||||
> 📚 Cách đọc sách hiệu quả? Xem **[Gợi ý học tập](LEARNING.md)** (ý tưởng cốt lõi, lộ trình, phân cấp độ khó, mẹo thực hành).
|
||||
|
||||
## 💻 Chạy các thí nghiệm đi kèm
|
||||
|
||||
Phạm vi hỗ trợ chung là **Python 3.11–3.13**. Hãy cài phụ thuộc theo chương từ thư mục gốc của kho; thay `ch1` bằng `ch2` đến `ch10` cho chương khác:
|
||||
|
||||
```bash
|
||||
# Khuyên dùng: sử dụng uv.lock đã commit để có môi trường chương tái lập được
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# Không dùng uv: phân giải lại từ pyproject.toml bằng pip
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
Trước khi chạy thí nghiệm có gọi mô hình, hãy cấu hình khóa theo README của thí nghiệm đó. Các thí nghiệm hỗ trợ cấu hình ở thư mục gốc có thể sao chép `.env.example` thành `.env` và điền ít nhất một khóa provider; một số thí nghiệm yêu cầu `.env` đặt cạnh mã hoặc biến môi trường được export. Chỉ dùng Ollama cục bộ với `--provider ollama` khi README hoặc CLI của thí nghiệm đó liệt kê rõ provider này.
|
||||
|
||||
Sau khi cài, chạy thí nghiệm từ thư mục gốc, ví dụ:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# Sau khi cài bằng pip: python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- Xem [hướng dẫn cài uv](https://docs.astral.sh/uv/getting-started/installation/). `pip` vẫn được hỗ trợ nhưng sẽ phân giải mới thay vì dùng lockfile.
|
||||
- Các tệp `requirements.txt` của từng thí nghiệm vẫn được hỗ trợ trong giai đoạn chuyển đổi, nhất là với dự án độc lập hoặc ràng buộc phiên bản đặc biệt.
|
||||
- `all` là tập rộng, thân thiện với CPU, không phải toàn bộ thí nghiệm. `uv sync` đồng bộ chính xác lựa chọn hiện tại mỗi lần chạy, vì vậy hãy gộp extra đặc biệt trong cùng một lệnh, ví dụ `uv sync --locked --extra ch2 --extra vllm` hoặc `uv sync --locked --extra ch7 --extra unsloth`; lệnh pip tương ứng là `python -m pip install -e ".[ch2,vllm]"`.
|
||||
- Làm theo README của từng thí nghiệm đối với phụ thuộc hệ thống như trình duyệt, CUDA, FFmpeg, Ollama, trình duyệt Playwright và kho ngoài. Một số thành phần bên thứ ba được đưa vào Chương 8 cần Python 3.12+.
|
||||
|
||||
## 🔑 API Key
|
||||
|
||||
Nên đăng ký API key từ vài nền tảng để thuận tiện học tập. Tham khảo [hướng dẫn này](https://01.me/2025/07/llm-api-setup/) để chọn mô hình.
|
||||
|
||||
| Nền tảng | Link | Đặc điểm | Điểm truy cập |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi** (Moonshot) | <https://platform.moonshot.cn/> | Kimi series, ngữ cảnh dài và khả năng Agent mạnh | Trung Quốc đại lục |
|
||||
| **Zhipu GLM** | <https://open.bigmodel.cn/> | GLM-4.6, tiếng Trung mạnh, hiệu năng/ch giá tốt | Trung Quốc đại lục |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | Các mô hình mở (DeepSeek, Qwen, v.v.), truy cập nhanh từ Trung Quốc đại lục | Trung Quốc đại lục |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | API chính thức của DeepSeek | Toàn cầu + Trung Quốc đại lục |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | Truy cập một điểm đến các mô hình chính toàn cầu và nội địa Trung Quốc (OpenAI, Claude, Gemini, Grok, Kimi, GLM, DeepSeek, Qwen, Minimax) | Toàn cầu + Trung Quốc đại lục |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | Truy cập một điểm đến các mô hình chính toàn cầu và nội địa Trung Quốc (GPT, Claude, Gemini, Kimi, GLM, DeepSeek, Qwen, v.v.) | Toàn cầu |
|
||||
|
||||
## 💎 Nhà tài trợ
|
||||
|
||||
Cảm ơn **Krill AI** đã tài trợ dự án này! Krill cung cấp dịch vụ trung chuyển API chính thức, ổn định và cực nhanh cho GPT / Claude / Gemini và nhiều mô hình Trung Quốc, hỗ trợ tùy chỉnh cấp doanh nghiệp, xuất hóa đơn, hỗ trợ kỹ thuật riêng 7×16h, cùng kết nối WebSocket được tối ưu độc quyền cho tốc độ token đầu tiên cực nhanh.
|
||||
|
||||
Krill dành ưu đãi đặc biệt cho độc giả của sách: đăng ký qua [liên kết này](https://www.krill-ai.net/register?invite=Q8D3L35725) và nhập mã khuyến mãi "ai-agent-book" khi nạp tiền để được giảm 23% cho lần mua gói Codex đầu tiên!
|
||||
|
||||
> 🧪 Trạng thái thực thi, bằng chứng và các tiêu chí nghiệm thu chưa đạt của thí nghiệm được theo dõi riêng tại [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md); việc clone hoặc cài đặt mã nguồn không chứng minh thí nghiệm đã hoàn thành.
|
||||
|
||||
## 📦 Phụ lục · Lấy kho ngoài
|
||||
|
||||
23 kho ngoài cho benchmark, framework huấn luyện, nền tảng robot ở Chương 6, 7, 9, 10 **không được đóng gói** (do kích thước và bản quyền), cần tự clone vào thư mục tương ứng.
|
||||
|
||||
### Script clone một lần
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 Mở rộng lệnh clone</b> (23 kho ngoài)</summary>
|
||||
|
||||
```bash
|
||||
# Chương 6 · Benchmark đánh giá
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# Chương 7 · Framework huấn luyện (bojieli/* là fork phù hợp với sách)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # Exp 7-3 train LLM from scratch
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # Exp 7-4 train VLM (projection layer)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # Exp 7-14 RLVP paper code
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # Exp 7-13 vision-language-action RL
|
||||
|
||||
# Chương 9 · Tự động hóa trình duyệt & ví dụ Claude
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# Chương 10 · Kiến trúc đa Agent (đã độc lập thành TalkAct) + Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # Exp 10-5 Stanford AI Town
|
||||
```
|
||||
|
||||
> Nếu README dự án chỉ định commit cụ thể, hãy `git checkout` phiên bản đó để đảm bảo tái hiện. Chương 10 `use-computer-while-calling` đã phát triển thành [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct) độc lập; kho này không đóng gói thư mục đó, hãy dùng lệnh clone ở trên để lấy về.
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 Đóng góp
|
||||
|
||||
Sách và mã đi kèm hoàn toàn mã nguồn mở. Rất hoan nghênh Pull Request:
|
||||
|
||||
| Loại | Mô tả |
|
||||
| --- | --- |
|
||||
| 📝 **Cải tiến nội dung sách** | Hiệu đính, bổ sung, diễn đạt rõ hơn, hoặc tiến triển mới (nội dung trong `book/chapter*.md`) |
|
||||
| 🐛 **Cải tiến code & sửa bug** | Dự án đi kèm mạnh mẽ hơn, dễ dùng hơn, gần sản xuất hơn |
|
||||
| 🧪 **Dự án thực hành mới** | Bổ sung/thay thế cài đặt tốt hơn cho thí nghiệm, hoặc đóng góp ví dụ mới |
|
||||
| 🎨 **Cải tiến hình vẽ** | Cải tiến trực tiếp các biểu đồ SVG đã được lưu trong `book/images/` |
|
||||
| 🌐 **Bản dịch ngôn ngữ mới** | Hoan nghênh dịch sang nhiều ngôn ngữ; xem tiếng Anh (`book-en/`), Ả Rập (`book-ar/`), Trung phồn thể/Đài Loan (`book-zhtw/`), Tamil (`book-ta/`), Việt (`book-vi/`), Nhật (`book-ja/`), Thổ Nhĩ Kỳ (`book-tr/`) và Hàn (`book-ko/`) |
|
||||
|
||||
Trước khi gửi, hãy chạy thí nghiệm liên quan để xác nhận tái hiện; có thể mở issue thảo luận trước.
|
||||
|
||||
## 📄 Giấy phép
|
||||
|
||||
Dự án sử dụng [Apache License 2.0](../../LICENSE). Xem tệp [`LICENSE`](../../LICENSE). Một số dự án con có thể có thông tin giấy phép riêng; xem dự án con để biết chi tiết.
|
||||
|
||||
## ⭐ Lịch sử Star
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>Được tạo bởi [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py), cập nhật hàng ngày bởi [GitHub Actions](../../.github/workflows/star-history.yml) · Nhấp vào hình để xem dữ liệu trực tiếp</sub>
|
||||
@@ -0,0 +1,59 @@
|
||||
# 学习建议
|
||||
|
||||
← [返回主目录](../../README.md)
|
||||
|
||||
## 核心理念:Agent = 模型 + 上下文 + 工具
|
||||
|
||||
本书的核心框架是 **Agent = 模型 + 上下文 + 工具**,三个组件协作实现 Agent 的智能行为:
|
||||
|
||||
| 组件 | 比喻 | 职责 |
|
||||
| :--: | :--: | --- |
|
||||
| 🧠 **模型(Model)** | 大脑 | 提供理解、推理和决策能力 |
|
||||
| 💾 **上下文(Context)** | 操作系统 | 系统指令、对话历史、推理过程、工具交互记录等 |
|
||||
| 🤲 **工具(Tools)** | 双手 | 感知环境、执行操作、与外部世界交互 |
|
||||
|
||||
## 学习路径
|
||||
|
||||
全书围绕「模型 / 上下文 / 工具」三大支柱层层展开。每个篇章都附带一条关键洞察:
|
||||
|
||||
| 篇章 | 章节 | 覆盖内容 | 关键洞察 |
|
||||
| --- | :--: | --- | --- |
|
||||
| **基础篇** | 第 1 章 | RL 中的 Agent 定义、传统 RL vs LLM+RL 样本效率、"模型即 Agent" 新范式 | 先验知识的重要性超越算法和环境 |
|
||||
| **上下文篇** | 第 2–3 章 | 系统提示、KV Cache、上下文压缩、提示工程;用户记忆、稠密/稀疏/混合检索、Agentic RAG | 完整上下文 = 系统指令 + 对话历史 + 推理过程 + 工具记录 + 用户记忆 + 外部知识 |
|
||||
| **工具篇** | 第 4–5 章 | 感知/执行/协作三类 MCP 工具、事件驱动异步架构;生产级 Coding Agent 完整实现 | 工具设计应通用化(代码解释器优于计算器),代码是能创造新工具的元能力 |
|
||||
| **评估与进化篇** | 第 6–8 章 | Agent 评估;SFT 与 RL;从轨迹信号更新知识、指令、程序和参数 | 可靠信号先于学习;更新载体取决于能力如何被表达与验证 |
|
||||
| **拓展与协作篇** | 第 9–10 章 | 语音/GUI/物理世界的多模态交互;多 Agent 分工协作 | 多 Agent 的每个设计决策都能在单 Agent 三要素中找到对应 |
|
||||
|
||||
## 正文与实验的分工
|
||||
|
||||
正文不是某个 SDK 的逐步教程。正文中的短伪代码和 skeleton 只回答“状态怎样流动、哪一步可以停止、哪类信号参与验证”;章级实验则提供完整实现、模型/环境适配、测试、日志和证据。阅读实验时不需要理解每个文件的每一行,也不应把一次实验的具体 API 写法当成通用架构。
|
||||
|
||||
建议按下面三层阅读,遇到复杂章节可以在同一层选择多个机制实验,而不是只跑一个项目:
|
||||
|
||||
| 层级 | 先看什么 | 暂时可以跳过什么 | 适合的问题 |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | 项目 README 的目标、最小命令、验收条件;正文对应 skeleton | 凭据加载、UI、provider adapter、长篇原始日志 | “这个实验要证明哪条机制?” |
|
||||
| **Builder** | 入口函数、核心循环、状态/消息 schema、工具和验证器 | 与机制无关的兼容层、部署脚本 | “哪一个变量改变了行为?” |
|
||||
| **Maintainer** | 测试、失败处理、证据格式、manifest/hash、回滚路径 | 只有在改动实验时才需要的第三方源码细节 | “结果是否可复核,失败是否被诚实记录?” |
|
||||
|
||||
推荐的第一批入口是:第 1 章 `context`,第 2 章 `context-compression`,第 3 章 `user-memory`/`retrieval-pipeline`,第 4 章 `async-agent`,第 5 章 `coding-agent`,第 6 章 `tau2-bench-eval`,第 7 章 `cot-distillation`,第 8 章 `trajectory-verifier`,第 9 章 `live-audio`,第 10 章 `parallel-web-research`。每个目录的 Code map 会标出 Run first、Core behavior、Verifier 和首次阅读可跳过的部分。
|
||||
|
||||
## 难度分级
|
||||
|
||||
| 级别 | 章节 | 适合读者 |
|
||||
| --- | :--: | --- |
|
||||
| 🟢 入门级 | 第 1–2 章 | 初学者,理解基本概念 |
|
||||
| 🔵 进阶级 | 第 3–4 章 | 有一定编程基础,涉及系统集成 |
|
||||
| 🟣 高级 | 第 5–6 章 | 较强编程能力,涉及复杂系统设计 |
|
||||
| 🔴 专家级 | 第 7–8 章 | 有深度学习与训练/自我进化经验 |
|
||||
| 🟠 应用级 | 第 9–10 章 | 综合运用前面所学,构建实际应用 |
|
||||
|
||||
## 实践建议
|
||||
|
||||
| # | 建议 | 说明 |
|
||||
| :--: | --- | --- |
|
||||
| 1 | 🛠️ **动手实践** | 每个项目都设计为可独立运行,建议亲自运行并修改代码 |
|
||||
| 2 | 📚 **结合书籍** | 配合 [`book/`](../../book/) 中相应章节阅读,理解理论与实践的结合 |
|
||||
| 3 | 🔬 **实验对比** | 多个项目包含消融研究和对比实验,通过对比加深理解 |
|
||||
| 4 | 🪜 **渐进学习** | 从简单项目开始,逐步深入复杂系统 |
|
||||
| 5 | 🔌 **关注协议** | 第 4 章 MCP 服务器项目展示了标准化工具协议,这是构建可扩展 Agent 的关键 |
|
||||
@@ -0,0 +1,195 @@
|
||||
# 深入理解 AI Agent:设计原理与工程实践
|
||||
|
||||
[](#-电子书) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-电子书)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**中文** ← 当前 · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · [繁體中文(台灣)](../zh-TW/README.md) · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)
|
||||
|
||||
> 📥 **[下载 PDF / EPUB](#-电子书)**(推荐)— 推荐使用 PDF / EPUB 离线阅读,排版最佳;也可[在线阅读](https://bojieli.github.io/ai-agent-book/)(支持多语言切换、章节折叠、全文搜索,每次推送自动更新)。
|
||||
|
||||
**Agent = LLM + 上下文 + 工具**——本书围绕这个核心公式,用 10 章把 AI Agent 从原理讲到工程实战。全书正文、配图、**103 个配套实验**全部开源,欢迎亲手把实验跑一遍。
|
||||
|
||||
> 📢 **2.0 版变更(相较 1.4 版)**:本仓库书稿版本已由 1.4 升级为 2.0。2.0 版将原第四章中的“异步交互”部分与原第九章中关于“多模态 Agent”的内容合并,重组为新的第六章“交互:观察与动作空间的扩展”。原第六章“Agent 的评估”、第七章“模型后训练”和第八章“Agent 的持续进化”依次后移一章,现分别为第七、八、九章。
|
||||
>
|
||||
> 如果你看到的是旧版 PDF,建议[下载最新版 PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf)。新版还包含许多内容修正与调整,请以最新版为准。
|
||||
|
||||
| 📚 **10 章** 正文,从基础到生产 | 📂 **103 个** 配套实验(含本地项目与外部复现轨道) | 🌐 **14 种** 语言:中 / 英 / 西 / 印尼 / 阿 / 繁體中文(台灣) / 俄 / 泰米尔 / 越 / 日 / 土耳其 / 韩 / 匈牙利 / 希伯来 |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 电子书
|
||||
|
||||
> 📥 **离线下载**(推荐,全书正文,开源免费)。以下链接始终指向 main 分支的最新构建;固定版本见 [Releases](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **中文(原版)**:[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **英文**(社区翻译,by [@nsdevaraj](https://github.com/nsdevaraj)、[@whanyu1212](https://github.com/whanyu1212)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **西班牙语**(社区翻译,by [@santhreal](https://github.com/santhreal)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **繁体中文(台湾)**(社区翻译,by [@tigercosmos](https://github.com/tigercosmos)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **俄语**(社区翻译,by [@ui99ru](https://github.com/ui99ru)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **泰米尔语**(社区翻译,by [@nsdevaraj](https://github.com/nsdevaraj)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **越南语**(社区翻译,by [@toanalien](https://github.com/toanalien)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **日语**(社区翻译,by [@eltociear](https://github.com/eltociear)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **阿拉伯语**(社区翻译,by [@TheSyBuilder](https://github.com/TheSyBuilder)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **土耳其语**(社区翻译,by [@memisemre](https://github.com/memisemre)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **韩语**(社区翻译,by [@JeongJaeSoon](https://github.com/JeongJaeSoon)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 也可[在线阅读](https://bojieli.github.io/ai-agent-book/)——支持多语言切换、章节折叠、全文搜索,以及配套实验直链。每次推送 main 自动重建。
|
||||
|
||||
中文正文源码位于 [`book/`](../../book/);英文/西班牙语/阿拉伯语/繁体中文(台湾)/俄语/泰米尔语/越南语/日语/土耳其语/韩语版为社区贡献(可能滞后于中文原版),分别位于 [`book-en/`](../../book-en/)、[`book-es/`](../../book-es/)、[`book-ar/`](../../book-ar/)、[`book-zhtw/`](../../book-zhtw/)、[`book-ru/`](../../book-ru/)、[`book-ta/`](../../book-ta/)、[`book-vi/`](../../book-vi/)、[`book-ja/`](../../book-ja/)、[`book-tr/`](../../book-tr/)、[`book-ko/`](../../book-ko/)。
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 自行编译 PDF / EPUB?</b>(PDF 需 pandoc / xelatex / ElegantBook)</summary>
|
||||
|
||||
- **EPUB**:使用共享构建脚本,详见 [EPUB 构建说明](../../EPUB.md)
|
||||
- **正文源码**:`book/introduction.md`(引言)、`book/chapter1.md` ~ `book/chapter10.md`(第一至第十章)、`book/afterword.md`(后记)
|
||||
- **编译**:安装 pandoc、xelatex、ElegantBook 文档类与相关字体后,运行
|
||||
|
||||
```bash
|
||||
cd book && bash build_pdf.sh
|
||||
```
|
||||
|
||||
图表以 SVG 文件存于 `book/images/`,编译时直接使用;排版细节见 `book/preamble.tex` 与 `book/*.lua`。
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 内容速览(第 1–10 章)
|
||||
|
||||
全书围绕核心公式 **Agent = LLM + 上下文 + 工具** 展开,十章层层递进:
|
||||
|
||||
| 章 | 主题 | 一句话核心 | 正文 | 实验 |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **AI Agent 入门** | **Agent = LLM + 上下文 + 工具**;Harness 工程才是竞争力 | [读](../../book/chapter1.md) | [3](../../chapter1/README.md) |
|
||||
| 2 | 🎯 **上下文工程** | 上下文决定能力上限:KV Cache、提示工程、Agent Skills、上下文压缩 | [读](../../book/chapter2.md) | [10](../../chapter2/README.md) |
|
||||
| 3 | 📚 **用户记忆和知识库** | 跨会话记住用户、接入外部知识:用户记忆、RAG、结构化索引、知识图谱 | [读](../../book/chapter3.md) | [12](../../chapter3/README.md) |
|
||||
| 4 | 🛠️ **工具** | 工具是 Agent 的双手:MCP 协议、感知/执行/协作三类工具与主动工具发现 | [读](../../book/chapter4.md) | [5](../../chapter4/README.md) |
|
||||
| 5 | 💻 **Coding Agent 与通用 Agent** | 代码是「能创造新工具的工具」,生产级 Coding Agent 全景 | [读](../../book/chapter5.md) | [13](../../chapter5/README.md) |
|
||||
| 6 | 🎙️ **交互:观察与动作空间的扩展** | 从模态与时序两个维度扩展 Agent 的观察与动作空间:异步与事件驱动、语音交互、Computer Use 和机器人操作 | [读](../../book/chapter6.md) | [13](../../chapter6/README.md) |
|
||||
| 7 | 🎯 **Agent 的评估** | 把表现变成可比较信号:评估环境、指标、统计显著性、评估驱动选型 | [读](../../book/chapter7.md) | [13](../../chapter7/README.md) |
|
||||
| 8 | 🧠 **模型后训练** | 预训练/SFT/RL 三阶段:何时选 SFT、何时选 RL,工具调用内化、样本效率 | [读](../../book/chapter8.md) | [19](../../chapter8/README.md) |
|
||||
| 9 | 🔄 **Agent 的持续进化** | 从运行轨迹获得学习信号,更新知识、指令、程序与参数 | [读](../../book/chapter9.md) | [9](../../chapter9/README.md) |
|
||||
| 10 | 🤝 **多 Agent 协作** | 群体智能高于个体:协作框架、上下文共享/隔离、涌现的「Agent 社会」 | [读](../../book/chapter10.md) | [6](../../chapter10/README.md) |
|
||||
|
||||
> 💡 **读** = 在 GitHub 网页直接读章节正文(markdown);**N** = 该章配套项目数,点击查看代码。项目类型说明(✅ 可运行 / 📖 复现 / 🚧 设计)见各章 README。
|
||||
>
|
||||
> 📚 如何高效阅读本书?详见 **[学习建议](LEARNING.md)**(核心理念、学习路径、难度分级、实践建议)。
|
||||
|
||||
## 💻 运行配套实验
|
||||
|
||||
项目统一支持 **Python 3.11–3.13**。请在仓库根目录按章节安装依赖;将 `ch1` 替换为 `ch2` ~ `ch10` 即可安装对应章节:
|
||||
|
||||
```bash
|
||||
# 推荐:使用提交到仓库的 uv.lock,获得可复现的章节环境
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# 未安装 uv 时:使用 pip 从 pyproject.toml 重新解析
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
运行会调用模型的实验前,请按该实验 README 配置凭据:支持根目录配置的实验可复制 `.env.example` 为 `.env` 并填入至少一个提供商 Key;有些实验要求在自身目录放 `.env` 或直接导出环境变量。只有在实验 README 或 CLI 明确列出 `ollama` 时,才可启动本地 Ollama 并添加 `--provider ollama`。
|
||||
|
||||
安装后可从仓库根目录运行实验,例如:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# 使用 pip 安装时也可直接运行:python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- `uv` 安装方法见 [官方文档](https://docs.astral.sh/uv/getting-started/installation/);`pip` 仍受支持,但不会使用锁文件。
|
||||
- 各实验现有的 `requirements.txt` 在迁移期间继续有效,适合只运行单个项目或需要特殊版本约束的情况。
|
||||
- `all` 是不含本地训练栈的 CPU 友好组合,并不代表每个实验;`uv sync` 每次都会精确同步当前选择,使用特殊 extra 时请合并到同一条命令,例如 `uv sync --locked --extra ch2 --extra vllm` 或 `uv sync --locked --extra ch7 --extra unsloth`;pip 对应为 `python -m pip install -e ".[ch2,vllm]"`。
|
||||
- 浏览器、CUDA、FFmpeg、Ollama、Playwright 浏览器及外部仓库等系统依赖,请继续参考各实验 README。第 8 章部分内置第三方组件需要 Python 3.12+。
|
||||
|
||||
## 🔑 API 密钥
|
||||
|
||||
建议申请下面几个平台的 API Key 方便学习。模型选型可参考 [这篇指南](https://01.me/2025/07/llm-api-setup/)。
|
||||
|
||||
| 平台 | 链接 | 备注 | 访问端点 |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi**(Moonshot) | <https://platform.moonshot.cn/> | Kimi 系列,长上下文和 Agent 能力强 | 中国大陆 |
|
||||
| **智谱 GLM** | <https://open.bigmodel.cn/> | GLM-4.6 等,中文能力突出,性价比高 | 中国大陆 |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | 各类开源模型(DeepSeek、Qwen 等),国内快速接入 | 中国大陆 |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | DeepSeek 官方 API | 全球 + 中国大陆 |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | 一站式接入全球及国内主流模型(OpenAI、Claude、Gemini、Grok、Kimi、GLM、DeepSeek、Qwen、Minimax) | 全球 + 中国大陆 |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | 一站式接入全球及国内主流模型(GPT、Claude、Gemini、Kimi、GLM、DeepSeek、Qwen 等) | 全球 |
|
||||
|
||||
## 💎 赞助
|
||||
|
||||
感谢 **Krill AI** 赞助本项目!Krill 提供 GPT / Claude / Gemini 及众多国产模型的官方稳定极速 API 中转,支持企业级定制、开票及 7×16h 专属技术支持,并独家适配 WebSocket 连接实现极速首 Token 响应。
|
||||
|
||||
Krill 为本书读者提供专属优惠:通过 [此链接](https://www.krill-ai.net/register?invite=Q8D3L35725) 注册并在充值时输入优惠码 "ai-agent-book",即可享受首单 Codex 方案 23% 折扣!
|
||||
|
||||
> 🧪 实验执行状态、证据及未达验收条件另行记录于 [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md);clone 或安装源码不构成完成证明。
|
||||
|
||||
## 📦 附录 · 获取外部仓库
|
||||
|
||||
第 6、7、8、10 章的 23 个外部仓库(基准测试、训练框架、机器人平台)因体积和许可原因**未打包**,需自行 clone 到对应目录。
|
||||
|
||||
### 一键 clone 脚本
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 展开 clone 命令</b>(23 个外部仓库)</summary>
|
||||
|
||||
```bash
|
||||
# 第 6 章 · GUI 与机器人外部复现轨道
|
||||
git clone https://github.com/browser-use/browser-use.git chapter6/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter6/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter6/XLeRobot # 实验 6-9、6-11 共用
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter6/RoboCrew # 实验 6-10、6-11
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter6/lerobot-sim2real # 实验 6-13
|
||||
|
||||
# 第 7 章 · 评估基准
|
||||
git clone https://github.com/google-research/android_world.git chapter7/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter7/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter7/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter7/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter7/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter7/terminal-bench
|
||||
|
||||
# 第 8 章 · 训练框架(bojieli/* 为本书适配 fork)
|
||||
git clone https://github.com/bojieli/minimind.git chapter8/MiniMind-pretrain/minimind # 实验 8-3 从零训练 LLM
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter8/MiniMind-pretrain/minimind-v # 实验 8-4 从零训练 VLM(投影层)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter8/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter8/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter8/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter8/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter8/SandboxFusion # 实验 8-14 代码沙箱
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter8/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter8/RLVP/rlvp # 实验 8-16 RLVP 论文代码
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter8/SimpleVLA-RL/SimpleVLA-RL # 实验 8-13 视觉-语言-动作 RL
|
||||
|
||||
# 第 10 章 · 双 Agent 架构(现为独立 TalkAct 项目)+ Stanford AI Town
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # 实验 10-5 Stanford AI Town
|
||||
```
|
||||
|
||||
> 如果项目 README 指定了特定 commit,请 `git checkout` 到该版本以保证可复现性。第 10 章的 `use-computer-while-calling` 已发展为独立维护的 [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct);本仓库仅保留指针文档。
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 贡献
|
||||
|
||||
本书及配套代码完全开源,欢迎提交 Pull Request:
|
||||
|
||||
| 类型 | 说明 |
|
||||
| --- | --- |
|
||||
| 📝 **正文内容** | 勘误、补充、更清晰的表达或新进展(正文在 `book/chapter*.md`) |
|
||||
| 🐛 **代码改进与 Bug 修复** | 让配套项目更健壮、更易用、更接近生产级 |
|
||||
| 🧪 **新实验项目** | 添加/替换更好的实验实现,或贡献新示例 |
|
||||
| 🎨 **图表设计** | 直接改进 `book/images/` 下的 SVG 图表 |
|
||||
| 🌐 **新翻译** | 欢迎翻译为更多语言;参考英文(`book-en/`)、阿拉伯语(`book-ar/`)、繁体中文/台湾(`book-zhtw/`)、俄语(`book-ru/`)、泰米尔语(`book-ta/`)、越南语(`book-vi/`)、日语(`book-ja/`)、土耳其语(`book-tr/`)、韩语(`book-ko/`) |
|
||||
|
||||
提交前请运行相关实验确认可复现;也欢迎先开 issue 讨论想法。
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
本项目基于 [Apache License 2.0](../../LICENSE) 开源。详见 [`LICENSE`](../../LICENSE) 文件。部分子项目可能包含各自的许可证信息,请参考对应子项目。
|
||||
|
||||
## ⭐ Star 历史
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>由 [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py) 生成,[GitHub Actions](../../.github/workflows/star-history.yml) 每日更新 · 点击图片查看实时数据</sub>
|
||||
@@ -0,0 +1,56 @@
|
||||
# 學習建議
|
||||
|
||||
← [返回主目錄](README.md)
|
||||
|
||||
## 核心理念:Agent = 模型 + 上下文 + 工具
|
||||
|
||||
本書的核心框架是 **Agent = 模型 + 上下文 + 工具**,三個元件協作實現 Agent 的智慧行為:
|
||||
|
||||
| 元件 | 比喻 | 職責 |
|
||||
| :--: | :--: | --- |
|
||||
| 🧠 **模型(Model)** | 大腦 | 提供理解、推理和決策能力 |
|
||||
| 💾 **上下文(Context)** | 作業系統 | 系統指令、對話歷史、推理過程、工具互動記錄等 |
|
||||
| 🤲 **工具(Tools)** | 雙手 | 感知環境、執行操作、與外部世界互動 |
|
||||
|
||||
## 學習路徑
|
||||
|
||||
全書圍繞「模型 / 上下文 / 工具」三大支柱層層展開。每個篇章都附帶一條關鍵洞察:
|
||||
|
||||
| 篇章 | 章節 | 涵蓋內容 | 關鍵洞察 |
|
||||
| --- | :--: | --- | --- |
|
||||
| **基礎篇** | 第 1 章 | RL 中的 Agent 定義、傳統 RL vs LLM+RL 樣本效率、「模型即 Agent」新典範 | 先驗知識的重要性超越演算法和環境 |
|
||||
| **上下文篇** | 第 2–3 章 | 系統提示、KV Cache、上下文壓縮、提示工程;使用者記憶、稠密/稀疏/混合檢索、Agentic RAG | 完整上下文 = 系統指令 + 對話歷史 + 推理過程 + 工具記錄 + 使用者記憶 + 外部知識 |
|
||||
| **工具篇** | 第 4–5 章 | 感知/執行/協作三類 MCP 工具、事件驅動非同步架構;生產級 Coding Agent 完整實現 | 工具設計應通用化(程式碼直譯器優於計算機),程式碼是能創造新工具的元能力 |
|
||||
| **模型篇** | 第 6–7 章 | Terminal-Bench/SWE-bench/GAIA/OSWorld/Tau2-Bench 評估基準;SFT、RL、RLHF、樣本效率 | 獨立驗證訊號比「讓模型再想一遍」更可靠;RL 把工具呼叫內化為原生能力 |
|
||||
| **自我進化篇** | 第 8 章 | 經驗學習、工作流程外化為工具、提示與觀察蒸餾進引數 | 從經驗中學習是 Agent 從「聰明」走向「熟練」的關鍵 |
|
||||
| **拓展與協作篇** | 第 9–10 章 | 語音/GUI/物理世界的多模態互動;多 Agent 分工協作 | 多 Agent 的每個設計決策都能在單 Agent 三要素中找到對應 |
|
||||
|
||||
## 正文與實驗的分工
|
||||
|
||||
本書正文不是某個 SDK 的逐步教學。短偽代碼與 skeleton 說明狀態流、停止點與驗證邊界;章級實驗提供完整實作、模型/環境適配、測試、日誌與證據。
|
||||
|
||||
| Layer | Read first | Skip for now | Question it answers |
|
||||
| :--: | --- | --- | --- |
|
||||
| **Starter** | Project README: goal, minimum command, acceptance conditions; matching prose skeleton | credentials, UI, provider adapters, long raw logs | 這個實驗要證明哪條機制? |
|
||||
| **Builder** | entry point, core loop, state/message schema, tools, verifier | compatibility/deployment layers unrelated to the mechanism | 哪個變數改變了行為? |
|
||||
| **Maintainer** | tests, failure handling, evidence format, manifest/hash, rollback path | third-party details needed only when changing the experiment | 結果能否複核,失敗是否被如實記錄? |
|
||||
|
||||
## 難度分級
|
||||
|
||||
| 級別 | 章節 | 適合讀者 |
|
||||
| --- | :--: | --- |
|
||||
| 🟢 入門級 | 第 1–2 章 | 初學者,理解基本概念 |
|
||||
| 🔵 進階級 | 第 3–4 章 | 有一定程式設計基礎,涉及系統整合 |
|
||||
| 🟣 高階 | 第 5–6 章 | 較強程式設計能力,涉及複雜系統設計 |
|
||||
| 🔴 專家級 | 第 7–8 章 | 有深度學習與訓練/自我進化經驗 |
|
||||
| 🟠 應用級 | 第 9–10 章 | 綜合運用前面所學,建構實際應用 |
|
||||
|
||||
## 實踐建議
|
||||
|
||||
| # | 建議 | 說明 |
|
||||
| :--: | --- | --- |
|
||||
| 1 | 🛠️ **動手實踐** | 每個專案都設計為可獨立執行,建議親自執行並修改程式碼 |
|
||||
| 2 | 📚 **結合書籍** | 配合 [`book/`](../../book/) 中相應章節閱讀,理解理論與實踐的結合 |
|
||||
| 3 | 🔬 **實驗對比** | 多個專案包含消融研究和對比實驗,透過對比加深理解 |
|
||||
| 4 | 🪜 **漸進學習** | 從簡單專案開始,逐步深入複雜系統 |
|
||||
| 5 | 🔌 **關注協議** | 第 4 章 MCP 伺服器專案展示了標準化工具協議,這是建構可擴充 Agent 的關鍵 |
|
||||
@@ -0,0 +1,195 @@
|
||||
# 深入理解 AI Agent:設計原理與工程實踐
|
||||
|
||||
[](#-電子書) [](https://bojieli.github.io/ai-agent-book/) [](https://github.com/bojieli/ai-agent-book) [](../../LICENSE) [](#-電子書)
|
||||
[](https://github.com/trending)
|
||||
|
||||
**[中文](../../README.md) · [English](../en/README.md) · [Español](../es/README.md) · [Bahasa Indonesia](../id/README.md) · [العربية](../ar/README.md) · 繁體中文(台灣) ← 當前 · [Русский](../ru/README.md) · [Tiếng Việt](../vi/README.md) · [தமிழ்](../ta/README.md) · [日本語](../ja/README.md) · [Türkçe](../tr/README.md) · [한국어](../ko/README.md) · [Magyar](../hu/README.md) · [עברית](../../README.he.md)**
|
||||
|
||||
> 📥 **[下載 PDF / EPUB](#-電子書)**(推薦)— 推薦使用 PDF / EPUB 離線閱讀,排版最佳;也可[線上閱讀](https://bojieli.github.io/ai-agent-book/)(支援多語言切換、章節摺疊、全文搜尋,每次 main 分支推送後自動重新構建)。
|
||||
|
||||
**Agent = LLM + 上下文 + 工具**——本書圍繞這個核心公式,用 10 章把 AI Agent 從原理講到工程實戰。全書正文、配圖、**93 個配套實驗**全部開源,歡迎親手把實驗跑一遍。
|
||||
|
||||
> 📢 **2.0 版變更(相較 1.4 版)**:2.0 版將原第四章中的「非同步互動」部分與原第九章中有關「多模態 Agent」的內容合併,重組為新的第六章「互動:觀察與動作空間的擴展」。原第六章「Agent 的評估」、第七章「模型後訓練」和第八章「Agent 的持續進化」依次後移一章,現分別為第七、八、九章。
|
||||
>
|
||||
> 如果你看到的是舊版 PDF,建議[下載最新版 PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf)。新版還包含許多內容修正與調整,請以最新版為準。
|
||||
|
||||
| 📚 **10 章** 正文,從基礎到生產 | 📂 **93 個** 配套專案(70+ 可獨立執行) | 🌐 **14 種** 語言:中 / 英 / 西 / 印尼 / 阿拉伯 / 繁體中文(台灣) / 俄 / 泰米爾 / 越 / 日 / 土耳其 / 韓 / 匈牙利 / 希伯來 |
|
||||
| :---: | :---: | :---: |
|
||||
|
||||
## 📖 電子書
|
||||
|
||||
> 📥 **直接下載**(推薦,全書正文,開源免費)。以下連結始終指向 main 分支的最新建置;固定版本見 [Releases](https://github.com/bojieli/ai-agent-book/releases):
|
||||
> - **中文(原版)**:[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-CN.epub)
|
||||
> - **英文**(社群翻譯,by [@nsdevaraj](https://github.com/nsdevaraj)、[@whanyu1212](https://github.com/whanyu1212)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-en.epub)
|
||||
> - **西班牙語**(社群翻譯,by [@santhreal](https://github.com/santhreal)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-es.epub)
|
||||
> - **阿拉伯語**(社群翻譯,by [@TheSyBuilder](https://github.com/TheSyBuilder)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ar.epub)
|
||||
> - **繁體中文(台灣)**(社群翻譯,by [@tigercosmos](https://github.com/tigercosmos)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-zh-TW.epub)
|
||||
> - **俄語**(社群翻譯,by [@ui99ru](https://github.com/ui99ru)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ru.epub)
|
||||
> - **泰米爾語**(社群翻譯,by [@nsdevaraj](https://github.com/nsdevaraj)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ta.epub)
|
||||
> - **越南語**(社群翻譯,by [@toanalien](https://github.com/toanalien)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-vi.epub)
|
||||
> - **日語**(社群翻譯,by [@eltociear](https://github.com/eltociear)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ja.epub)
|
||||
> - **土耳其語**(社群翻譯,by [@memisemre](https://github.com/memisemre)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-tr.epub)
|
||||
> - **韓語**(社群翻譯,by [@JeongJaeSoon](https://github.com/JeongJaeSoon)):[PDF](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.pdf) · [EPUB](https://github.com/bojieli/ai-agent-book/releases/download/latest/AI-Agents-in-Depth-ko.epub)
|
||||
>
|
||||
> 🌐 也可[線上閱讀](https://bojieli.github.io/ai-agent-book/) — 支援多語言切換、章節摺疊、全文搜尋、配套實驗直達,每次 main 分支推送後自動重新構建。
|
||||
|
||||
中文正文原始碼位於 [`book/`](../../book/);英文/西班牙語/阿拉伯語/繁體中文(台灣)/俄語/泰米爾/越南語/日語/土耳其語/韓語版本為社群貢獻(可能滯後於中文原版),分別位於 [`book-en/`](../../book-en/)、[`book-es/`](../../book-es/)、[`book-ar/`](../../book-ar/)、[`book-zhtw/`](../../book-zhtw/)、[`book-ru/`](../../book-ru/)、[`book-ta/`](../../book-ta/)、[`book-vi/`](../../book-vi/)、[`book-ja/`](../../book-ja/)、[`book-tr/`](../../book-tr/)、[`book-ko/`](../../book-ko/)。
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 想自行編譯 PDF / EPUB?</b>(PDF 需 pandoc / xelatex / ElegantBook)</summary>
|
||||
|
||||
- **EPUB**:使用統一的建置腳本,詳情請參閱 [EPUB 建置說明](../../EPUB.md)
|
||||
- **正文原始碼**:`book/introduction.md`(引言)、`book/chapter1.md` ~ `book/chapter10.md`(第一至第十章)、`book/afterword.md`(後記)
|
||||
- **編譯**:安裝 pandoc、xelatex、ElegantBook 文件類與相關字型後,執行
|
||||
|
||||
```bash
|
||||
cd book && bash build_pdf.sh
|
||||
```
|
||||
|
||||
圖表以 SVG 檔案存於 `book/images/`,編譯時直接使用;排版細節見 `book/preamble.tex` 與 `book/*.lua`。
|
||||
|
||||
</details>
|
||||
|
||||
## 📑 內容速覽(第 1–10 章)
|
||||
|
||||
全書圍繞核心公式 **Agent = LLM + 上下文 + 工具** 展開,十章層層遞進:
|
||||
|
||||
| 章 | 主題 | 一句話核心 | 正文 | 程式碼 |
|
||||
| :--: | --- | --- | :--: | :--: |
|
||||
| 1 | 🚀 **Agent 基礎知識** | **Agent = LLM + 上下文 + 工具**;Harness 工程才是競爭力 | [讀](../../book-zhtw/chapter1.zhtw.md) | [4](../../chapter1/README.zh-TW.md) |
|
||||
| 2 | 🎯 **上下文工程** | 上下文決定能力上限:KV Cache、提示工程、Agent Skills、上下文壓縮 | [讀](../../book-zhtw/chapter2.zhtw.md) | [9](../../chapter2/README.zh-TW.md) |
|
||||
| 3 | 📚 **使用者記憶和知識庫** | 跨會話記住使用者、接入外部知識:使用者記憶、RAG、結構化索引、知識圖譜 | [讀](../../book-zhtw/chapter3.zhtw.md) | [12](../../chapter3/README.zh-TW.md) |
|
||||
| 4 | 🛠️ **工具** | 工具是 Agent 的雙手:MCP 協議、感知/執行/協作三類工具、事件驅動非同步 Agent、主動工具發現 | [讀](../../book-zhtw/chapter4.zhtw.md) | [8](../../chapter4/README.zh-TW.md) |
|
||||
| 5 | 💻 **Coding Agent 與程式碼生成** | 程式碼是「能創造新工具的工具」,生產級 Coding Agent 全景 | [讀](../../book-zhtw/chapter5.zhtw.md) | [13](../../chapter5/README.zh-TW.md) |
|
||||
| 6 | 🎙️ **互動:觀察與動作空間的擴展** | 從模態與時序兩個維度擴展 Agent 的觀察與動作空間:非同步與事件驅動、語音互動、Computer Use 和機器人操作 | [讀](../../book-zhtw/chapter6.zhtw.md) | [13](../../chapter6/README.zh-TW.md) |
|
||||
| 7 | 🎯 **Agent 的評估** | 把表現變成可比較訊號:評估環境、指標、統計顯著性、評估驅動選型 | [讀](../../book-zhtw/chapter7.zhtw.md) | [13](../../chapter7/README.zh-TW.md) |
|
||||
| 8 | 🧠 **模型後訓練** | 預訓練/SFT/RL 三階段:何時選 SFT、何時選 RL,工具呼叫內化、樣本效率 | [讀](../../book-zhtw/chapter8.zhtw.md) | [19](../../chapter8/README.zh-TW.md) |
|
||||
| 9 | 🔄 **Agent 的持續進化** | 從執行軌跡獲得學習訊號,更新知識、指令、程式與參數 | [讀](../../book-zhtw/chapter9.zhtw.md) | [9](../../chapter9/README.zh-TW.md) |
|
||||
| 10 | 🤝 **多 Agent 協作** | 群體智慧高於個體:協作框架、上下文共享/隔離、湧現的「Agent 社會」 | [讀](../../book-zhtw/chapter10.zhtw.md) | [7](../../chapter10/README.zh-TW.md) |
|
||||
|
||||
> 💡 **讀** = 在 GitHub 網頁直接讀章節正文(markdown);**N** = 該章配套專案數,點選檢視程式碼。專案型別說明(✅ 可執行 / 📖 復現 / 🚧 設計)見各章 README。
|
||||
>
|
||||
> 📚 如何高效閱讀本書?詳見 **[學習建議](LEARNING.md)**(核心理念、學習路徑、難度分級、實踐建議)。
|
||||
|
||||
## 💻 執行配套實驗
|
||||
|
||||
專案統一支援 **Python 3.11–3.13**。請在倉庫根目錄按章節安裝依賴;將 `ch1` 替換為 `ch2` ~ `ch10` 即可安裝對應章節:
|
||||
|
||||
```bash
|
||||
# 推薦:使用提交到倉庫的 uv.lock,取得可重現的章節環境
|
||||
uv sync --locked --extra ch1
|
||||
|
||||
# 未安裝 uv 時:使用 pip 從 pyproject.toml 重新解析
|
||||
python -m pip install -e ".[ch1]"
|
||||
```
|
||||
|
||||
執行會呼叫模型的實驗前,請依該實驗 README 設定憑證:支援根目錄設定的實驗可複製 `.env.example` 為 `.env` 並填入至少一個 provider key;有些實驗要求在自身目錄放 `.env` 或直接匯出環境變數。只有在實驗 README 或 CLI 明確列出 `ollama` 時,才可啟動本機 Ollama 並加入 `--provider ollama`。
|
||||
|
||||
安裝後可從倉庫根目錄執行實驗,例如:
|
||||
|
||||
```bash
|
||||
uv run python chapter1/context/main.py
|
||||
# 使用 pip 安裝時也可直接執行:python chapter1/context/main.py
|
||||
```
|
||||
|
||||
- `uv` 安裝方法見[官方文件](https://docs.astral.sh/uv/getting-started/installation/);`pip` 仍受支援,但不會使用鎖定檔。
|
||||
- 各實驗現有的 `requirements.txt` 在遷移期間繼續有效,適合只執行單一專案或需要特殊版本約束的情況。
|
||||
- `all` 是不含本機訓練堆疊的 CPU 友好組合,並不代表每個實驗;`uv sync` 每次都會精確同步目前選擇,使用特殊 extra 時請合併到同一條指令,例如 `uv sync --locked --extra ch2 --extra vllm` 或 `uv sync --locked --extra ch7 --extra unsloth`;pip 對應為 `python -m pip install -e ".[ch2,vllm]"`。
|
||||
- 瀏覽器、CUDA、FFmpeg、Ollama、Playwright 瀏覽器及外部倉庫等系統依賴,請繼續參考各實驗 README。第 8 章部分內建第三方元件需要 Python 3.12+。
|
||||
|
||||
## 🔑 API 金鑰
|
||||
|
||||
建議申請下面幾個平台的 API Key 方便學習。模型選型可參考 [這篇指南](https://01.me/2025/07/llm-api-setup/)。
|
||||
|
||||
| 平台 | 連結 | 特色 | 訪問節點 |
|
||||
| --- | --- | --- | --- |
|
||||
| **Kimi**(月之暗面) | <https://platform.moonshot.cn/> | Kimi 系列,Coding、Agent 能力強 | 中國大陸 |
|
||||
| **智譜 GLM** | <https://open.bigmodel.cn/> | GLM-5.2 等,Coding、Agent 能力強 | 中國大陸 |
|
||||
| **Siliconflow** | <https://siliconflow.cn/> | 各種開源模型(DeepSeek、Qwen 等),中國大陸訪問速度快 | 中國大陸 |
|
||||
| **DeepSeek** | <https://platform.deepseek.com/> | DeepSeek 官方 API | 全球 + 中國大陸 |
|
||||
| **Krill AI** | [www.krill-ai.net](https://www.krill-ai.net/register?invite=Q8D3L35725) | 一站式訪問全球及國內主流模型(OpenAI、Claude、Gemini、Grok、Kimi、GLM、DeepSeek、Qwen、Minimax) | 全球 + 中國大陸 |
|
||||
| **OpenRouter** | <https://openrouter.ai/> | 一站式訪問全球及國內主流模型(GPT、Claude、Gemini、Kimi、GLM、DeepSeek、Qwen 等) | 全球 |
|
||||
|
||||
## 💎 贊助商
|
||||
|
||||
感謝 **Krill AI** 贊助本專案!Krill 提供 GPT / Claude / Gemini / 多款國產模型的官方穩定極速 API 中轉服務,支援企業級客製、報銷開票、7×16h 專屬技術支援,更有獨家適配的 WebSocket 連線方式,暢享極速首字速度。
|
||||
|
||||
Krill 為本書讀者提供特別優惠:使用[此連結](https://www.krill-ai.net/register?invite=Q8D3L35725)註冊並在儲值時填寫優惠碼「ai-agent-book」,首次購買 Codex 套餐可享 77 折優惠!
|
||||
|
||||
> 🧪 配套實驗的執行狀態、證據與尚未完成的驗收門檻,另行記錄於 [`EXPERIMENT_STATUS.md`](../EXPERIMENT_STATUS.md);克隆或安裝原始碼不代表實驗已完成。
|
||||
|
||||
## 📦 附錄 · 外部倉庫獲取
|
||||
|
||||
第 6、7、9、10 章的評測基準、訓練框架、機器人平台等 23 個外部倉庫**未內建**(出於體積與版權),需要自行克隆到對應目錄。
|
||||
|
||||
### 一鍵克隆指令碼
|
||||
|
||||
<details>
|
||||
<summary><b>🔧 展開克隆命令</b>(共 23 個外部倉庫)</summary>
|
||||
|
||||
```bash
|
||||
# 第 6 章 · 評測基準
|
||||
git clone https://github.com/google-research/android_world.git chapter6/android_world
|
||||
git clone https://huggingface.co/datasets/gaia-benchmark/GAIA chapter6/GAIA
|
||||
git clone https://github.com/xlang-ai/OSWorld.git chapter6/OSWorld
|
||||
git clone https://github.com/SWE-bench/SWE-bench.git chapter6/SWE-bench
|
||||
git clone https://github.com/sierra-research/tau2-bench.git chapter6/tau2-bench
|
||||
git clone https://github.com/laude-institute/terminal-bench.git chapter6/terminal-bench
|
||||
|
||||
# 第 7 章 · 訓練框架(bojieli/* 為本書適配的分支)
|
||||
git clone https://github.com/bojieli/minimind.git chapter7/MiniMind-pretrain/minimind # 實驗 7-3 從零訓 LLM
|
||||
git clone https://github.com/bojieli/minimind-v.git chapter7/MiniMind-pretrain/minimind-v # 實驗 7-4 從零訓 VLM(投影層)
|
||||
git clone https://github.com/bojieli/AdaptThink.git chapter7/AdaptThink-original
|
||||
git clone https://github.com/bojieli/AWorld.git chapter7/AWorld
|
||||
git clone https://github.com/bojieli/SFTvsRL.git chapter7/SFTvsRL
|
||||
git clone https://github.com/bojieli/verl.git chapter7/verl
|
||||
git clone https://github.com/bojieli/SandboxFusion.git chapter7/SandboxFusion && git -C chapter7/SandboxFusion fetch origin 4a0d573ebd64c98234c190a9d1d49e4276199a0c && git -C chapter7/SandboxFusion checkout --detach 4a0d573ebd64c98234c190a9d1d49e4276199a0c && test "$(git -C chapter7/SandboxFusion rev-parse HEAD)" = "4a0d573ebd64c98234c190a9d1d49e4276199a0c" # Exp 7-15 code sandbox
|
||||
git clone https://github.com/thinking-machines-lab/tinker-cookbook.git chapter7/tinker-cookbook
|
||||
git clone https://github.com/19PINE-AI/rlvp.git chapter7/RLVP/rlvp # 實驗 7-14 RLVP 論文程式碼
|
||||
git clone https://github.com/PRIME-RL/SimpleVLA-RL.git chapter7/SimpleVLA-RL/SimpleVLA-RL # 實驗 7-13 視覺-語言-動作 RL
|
||||
|
||||
# 第 9 章 · 瀏覽器自動化與 Claude 示例
|
||||
git clone https://github.com/browser-use/browser-use.git chapter9/browser-use
|
||||
git clone https://github.com/anthropics/claude-quickstarts.git chapter9/claude-quickstarts
|
||||
git clone https://github.com/Vector-Wangel/XLeRobot.git chapter9/XLeRobot && git -C chapter9/XLeRobot fetch origin 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && git -C chapter9/XLeRobot checkout --detach 3d14695e40c9c68229c0aacffca6053c75cd3eb6 && test "$(git -C chapter9/XLeRobot rev-parse HEAD)" = "3d14695e40c9c68229c0aacffca6053c75cd3eb6" # Exp 9-7/9-9 shared
|
||||
git clone https://github.com/Grigorij-Dudnik/RoboCrew.git chapter9/RoboCrew && git -C chapter9/RoboCrew fetch origin c749148f29bd14e61347f9fc3530c343fff0d994 && git -C chapter9/RoboCrew checkout --detach c749148f29bd14e61347f9fc3530c343fff0d994 && test "$(git -C chapter9/RoboCrew rev-parse HEAD)" = "c749148f29bd14e61347f9fc3530c343fff0d994" # Exp 9-8/9-9; RoboCrew v0.3.1
|
||||
git clone https://github.com/StoneT2000/lerobot-sim2real.git chapter9/lerobot-sim2real && git -C chapter9/lerobot-sim2real fetch origin 87d6c1d969f6e0ca4dc5697940804e231118a63a && git -C chapter9/lerobot-sim2real checkout --detach 87d6c1d969f6e0ca4dc5697940804e231118a63a && test "$(git -C chapter9/lerobot-sim2real rev-parse HEAD)" = "87d6c1d969f6e0ca4dc5697940804e231118a63a" # Exp 9-11
|
||||
|
||||
# 第 10 章 · 雙 Agent 架構(已獨立為 TalkAct 專案)+ 斯坦福 AI 小鎮
|
||||
git clone https://github.com/19PINE-AI/TalkAct.git chapter10/use-computer-while-calling
|
||||
git clone https://github.com/joonspk-research/generative_agents.git chapter10/generative_agents # 實驗 10-5 斯坦福 AI 小鎮
|
||||
```
|
||||
|
||||
> 各專案 README 如標註了特定 commit,請按說明 `git checkout` 到對應版本以保證復現一致。第 10 章 `use-computer-while-calling` 已發展為獨立維護的 [19PINE-AI/TalkAct](https://github.com/19PINE-AI/TalkAct),本倉庫不內建該目錄,用上面的克隆命令獲取。
|
||||
|
||||
</details>
|
||||
|
||||
## 🤝 貢獻
|
||||
|
||||
本書與配套程式碼全部開源,非常歡迎社群透過 Pull Request 參與共建:
|
||||
|
||||
| 型別 | 說明 |
|
||||
| --- | --- |
|
||||
| 📝 **書籍內容改進** | 勘誤、補充、更清晰的表述,或新增前沿進展(正文見 `book/chapter*.md`) |
|
||||
| 🐛 **程式碼改進與 Bug 修復** | 讓配套專案更健壯、更易用、更貼近生產實踐 |
|
||||
| 🧪 **新的實踐專案** | 為某個實驗補充/替換更好的實現,或貢獻全新的示例專案 |
|
||||
| 🎨 **配圖設計改進** | 直接改進 `book/images/` 中已簽入的 SVG 圖表,讓它們更清晰美觀 |
|
||||
| 🌐 **新語言翻譯** | 歡迎翻譯成更多語言,可參考英文(`book-en/`)、阿拉伯語(`book-ar/`)、繁體中文(台灣)版(`book-zhtw/`)、俄語(`book-ru/`)、泰米爾語(`book-ta/`)、越南語(`book-vi/`)、日語(`book-ja/`)、土耳其語(`book-tr/`)、韓語(`book-ko/`)的組織方式 |
|
||||
|
||||
提交前建議先把相關實驗親手跑一遍、確認可復現;也歡迎先提 issue 討論想法。
|
||||
|
||||
## 📄 許可證
|
||||
|
||||
本專案採用 [Apache License 2.0](../../LICENSE) 開源許可證,詳見 [`LICENSE`](../../LICENSE) 檔案。部分子專案可能包含各自的許可證資訊,請以子專案中的說明為準。
|
||||
|
||||
## ⭐ Star History
|
||||
|
||||
<a href="https://star-history.com/#bojieli/ai-agent-book&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="../../assets/star-history-dark.png" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="../../assets/star-history-light.png" />
|
||||
<img alt="Star History Chart" src="../../assets/star-history-light.png" width="100%" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
<sub>由 [`scripts/gen_star_history.py`](../../scripts/gen_star_history.py) 生成,[GitHub Actions](../../.github/workflows/star-history.yml) 每日自動更新 · 點選圖片檢視即時資料</sub>
|
||||
Reference in New Issue
Block a user