diff --git a/README.md b/README.md index 7bb1c4a..9a81bfc 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ [中文版](README.zh-CN.md) +![Agentic Design Patterns — 29 patterns, sketched](assets/hero.png) + > **Transform your AI applications from simple prompts to sophisticated intelligent systems.** ## 🧭 Principles diff --git a/assets/hero.png b/assets/hero.png new file mode 100644 index 0000000..185a15c Binary files /dev/null and b/assets/hero.png differ diff --git a/assets/hero/make_hero.sh b/assets/hero/make_hero.sh new file mode 100755 index 0000000..a5cd566 --- /dev/null +++ b/assets/hero/make_hero.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Regenerate assets/hero.png — 2x2 montage of 4 representative pattern diagrams +# in the Da Vinci sepia/parchment palette. +# +# Requires: bun (for `bunx`), ImageMagick (`magick`). +# Mermaid CLI is fetched on-demand by bunx; no global install needed. + +set -euo pipefail + +cd "$(dirname "$0")" +OUT="../hero.png" +BG="#f5ecd9" +BORDER="#c5b393" + +for f in multi-agent rag react tot; do + bunx --bun @mermaid-js/mermaid-cli -i "$f.mmd" -o "$f.png" -s 2 -b "$BG" +done + +magick montage multi-agent.png rag.png react.png tot.png \ + -tile 2x2 -geometry +20+20 \ + -background "$BG" -bordercolor "$BORDER" -border 8 \ + "$OUT" + +echo "Wrote $OUT" diff --git a/assets/hero/multi-agent.mmd b/assets/hero/multi-agent.mmd new file mode 100644 index 0000000..f5fdc6b --- /dev/null +++ b/assets/hero/multi-agent.mmd @@ -0,0 +1,25 @@ +--- +title: Multi-Agent Collaboration +--- +%%{init: {'look':'handDrawn','theme':'base','themeVariables':{'background':'#f5ecd9','primaryColor':'#ede0bd','primaryBorderColor':'#6b4423','primaryTextColor':'#3e2723','lineColor':'#6b4423','clusterBkg':'#efe5cd','clusterBorder':'#c5b393','edgeLabelBackground':'#f5ecd9','tertiaryColor':'#efe5cd','tertiaryBorderColor':'#c5b393','tertiaryTextColor':'#3e2723','fontFamily':'Caveat, Patrick Hand, cursive'}}}%% +flowchart LR + Goal([research goal]) + Out([final report]) + + subgraph orchestration ["orchestration"] + Pl[planner_agent] + Plan[/plan steps/] + Ex{executor_agent} + Pl --> Plan --> Ex + end + + subgraph specialists ["specialist agents"] + R["research_agent
arXiv · Tavily · Wiki"] + W[writer_agent] + Ed[editor_agent] + end + + Goal --> Pl + Ex --> R & W & Ed + R & W & Ed -- "result" --> Ex + Ex --> Out diff --git a/assets/hero/rag.mmd b/assets/hero/rag.mmd new file mode 100644 index 0000000..276a2a1 --- /dev/null +++ b/assets/hero/rag.mmd @@ -0,0 +1,23 @@ +--- +title: RAG +--- +%%{init: {'look':'handDrawn','theme':'base','themeVariables':{'background':'#f5ecd9','primaryColor':'#ede0bd','primaryBorderColor':'#6b4423','primaryTextColor':'#3e2723','lineColor':'#6b4423','clusterBkg':'#efe5cd','clusterBorder':'#c5b393','edgeLabelBackground':'#f5ecd9','tertiaryColor':'#efe5cd','tertiaryBorderColor':'#c5b393','tertiaryTextColor':'#3e2723','fontFamily':'Caveat, Patrick Hand, cursive'}}}%% +flowchart LR + Q([password reset question]) + Ans([grounded answer + sources]) + + subgraph retrieval ["retrieval"] + Idx[(support docs
vector store)] + Ret[hybrid retriever
BM25 + dense] + Ctx[/top-k chunks + citations/] + Idx -.-> Ret --> Ctx + end + + subgraph generation ["generation"] + LLM{{ChatOpenAI}} + end + + Q --> Ret + Ctx --> LLM + Q -. "+ question" .-> LLM + LLM --> Ans diff --git a/assets/hero/react.mmd b/assets/hero/react.mmd new file mode 100644 index 0000000..4b8a57d --- /dev/null +++ b/assets/hero/react.mmd @@ -0,0 +1,17 @@ +--- +title: ReAct +--- +%%{init: {'look':'handDrawn','theme':'base','themeVariables':{'background':'#f5ecd9','primaryColor':'#ede0bd','primaryBorderColor':'#6b4423','primaryTextColor':'#3e2723','lineColor':'#6b4423','clusterBkg':'#efe5cd','clusterBorder':'#c5b393','edgeLabelBackground':'#f5ecd9','tertiaryColor':'#efe5cd','tertiaryBorderColor':'#c5b393','tertiaryTextColor':'#3e2723','fontFamily':'Caveat, Patrick Hand, cursive'}}}%% +flowchart LR + Q([query]) + F([final answer]) + + subgraph loop ["ReAct cycle"] + T[Thought
reasoning trace] + A[Action
tool call] + O[/Observation/] + T --> A --> O --> T + end + + Q --> T + T -. "enough info" .-> F diff --git a/assets/hero/tot.mmd b/assets/hero/tot.mmd new file mode 100644 index 0000000..dd2a09f --- /dev/null +++ b/assets/hero/tot.mmd @@ -0,0 +1,14 @@ +--- +title: Tree of Thoughts +--- +%%{init: {'look':'handDrawn','theme':'base','themeVariables':{'background':'#f5ecd9','primaryColor':'#ede0bd','primaryBorderColor':'#6b4423','primaryTextColor':'#3e2723','lineColor':'#6b4423','clusterBkg':'#efe5cd','clusterBorder':'#c5b393','edgeLabelBackground':'#f5ecd9','tertiaryColor':'#efe5cd','tertiaryBorderColor':'#c5b393','tertiaryTextColor':'#3e2723','fontFamily':'Caveat, Patrick Hand, cursive'}}}%% +flowchart TB + Q([problem]) + Sol([solution]) + + Q --> Ta[thought a] & Tb[thought b] & Tc[thought c] + Ta & Tb & Tc --> E1{evaluate} + E1 -- "best" --> Ta1[a · 1] & Ta2[a · 2] + Ta1 & Ta2 --> E2{evaluate} + E2 --> Sol + E1 -. "backtrack" .-> Tb