Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/weekly-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Weekly Smoke

on:
schedule:
# Every Monday 06:00 UTC.
- cron: "0 6 * * 1"
workflow_dispatch:

jobs:
python-smoke:
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v3

- name: Run Python demo smoke (basic mode)
run: bash scripts/run_demos_smoke.sh --mode basic

- name: Upload smoke logs
if: always()
uses: actions/upload-artifact@v4
with:
name: python-smoke-logs
path: .demo-smoke-logs/
if-no-files-found: ignore
retention-days: 14

typescript-smoke:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install TypeScript workspace dependencies
working-directory: typescript_base
run: bun install

- name: Run TypeScript demo smoke (basic mode)
run: bash scripts/run_demos_smoke_typescript.sh --mode basic

- name: Upload smoke logs
if: always()
uses: actions/upload-artifact@v4
with:
name: typescript-smoke-logs
path: .demo-smoke-logs-ts/
if-no-files-found: ignore
retention-days: 14
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@

> **Transform your AI applications from simple prompts to sophisticated intelligent systems.**

## 🧭 Principles

This repo is built around four commitments. They explain what stays in and what gets cut.

1. **Lean, not exhaustive.** This is *not* a catalog of hundreds of patterns that no human will ever read, understand, or remember. It is a **lean catalog meant to be understood and memorized**. Long patterns lists are not features; they are noise.
2. **Hard cap: at most 24 patterns.** If a pattern is not necessary, we remove it. If something new is added, something else gets dropped. The ceiling is a forcing function, not an aspiration.
3. **Demos must actually work.** Every demo runs in an **automated weekly smoke test, for both Python *and* TypeScript** — and it must pass. (See [`.github/workflows/weekly-smoke.yml`](./.github/workflows/weekly-smoke.yml).) Educational code that doesn't run is educational code that lies.
4. **Concrete relevance, not just papers.** For each pattern we measure how it shows up in **real coding agents** — currently [Pi](https://github.com/earendil-works/pi) — and write it down in a `pi.md` inside each pattern folder, plus a [repo-wide roll-up with a coverage heat map](./pi.md). We also maintain [`diff.md`](./diff.md) to disambiguate commonly-confused pattern pairs: **if two patterns can't be cleanly told apart, one of them probably doesn't belong here**. A pattern that only exists in a paper somewhere is a signal it may not belong either.

---

AI evolves too quickly for traditional books to stay current, especially in fast-moving areas like agentic systems. That’s why this is one of the best “living books” on agentic AI: a comprehensive, hands-on collection of design patterns for building robust AI agents, continuously updated with real-world implementations, practical examples, and detailed architectural guidance for scalable, maintainable AI applications.

## Table of Contents
Expand Down
13 changes: 13 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@

> **把你的 AI 应用从简单提示词进化为成熟的智能系统。**

## 🧭 原则

本仓库围绕四条承诺构建。它们决定了什么留下、什么被删除。

1. **精炼,不求大而全。** 这**不是**一个包含成百上千个、没人会真正读懂或记得住的模式的目录。它是一份**面向人类理解与记忆的精炼目录**。冗长的模式清单不是优点,而是噪音。
2. **硬上限:最多 24 个模式。** 如果某个模式并非必需,就把它移除。新增一个,就要删掉另一个。这个上限是一种强制约束,而不是远期目标。
3. **示例必须真的能跑起来。** 每个示例都会在**自动化的每周冒烟测试**中运行,同时覆盖 **Python 与 TypeScript**,并且必须通过。(见 [`.github/workflows/weekly-smoke.yml`](./.github/workflows/weekly-smoke.yml)。)跑不起来的教学代码就是在说谎的教学代码。
4. **要看具体相关性,而不只是论文。** 对每一个模式,我们都会衡量它在**真实编码 Agent**中的呈现方式 —— 目前对标的是 [Pi](https://github.com/earendil-works/pi) —— 并把分析结果写入每个模式目录下的 `pi.md`,同时提供一份[包含覆盖度热力图的仓库级汇总](./pi.md)。我们还维护一份 [`diff.md`](./diff.md) 来澄清那些常被混淆的模式对:**如果两个模式无法被清晰地区分开来,那么其中一个大概率不该留在这里**。一个只存在于某篇论文里的模式,同样是它可能不属于这里的信号。

---

AI 演进的速度太快,传统书籍很难保持时效,尤其是在智能体(agentic)系统这种快速变化的领域。这正是本仓库被定位为关于智能体 AI 最好的“活书(living book)”之一的原因:它是一个全面、动手实践的设计模式合集,用于构建健壮的 AI 智能体,并持续更新真实世界的实现、可运行的示例,以及为可扩展、可维护 AI 应用提供的详细架构指引。

## 目录
Expand Down Expand Up @@ -42,6 +53,8 @@ AI 演进的速度太快,传统书籍很难保持时效,尤其是在智能
> 本仓库现在包含面向实现层面的分析,说明这些模式如何映射到 [Pi](https://github.com/earendil-works/pi)。这些分析基于 Pi 的真实代码库,附带 package/module 引用、带行号的代码片段,以及对架构权衡或局限性的说明。
>
> 在各模式目录下查找 `pi.md`。这些文字保持保守的态度:如果 Pi 并没有有意义地实现某个模式,分析会直接说明这一点,而不是强行套用。
>
> 想看 28 个模式的整体覆盖情况?参见仓库根目录的 [**Pi 汇总(`pi.md`)**](./pi.md):覆盖度热力图、按分数排序的总表,以及每个模式的一句话结论与最具代表性的代码引用。

**当前已提供的 Pi 分析:**
- 基础(Foundational):[Prompt Chaining](./foundational_design_patterns/1_prompt_chain/pi.md)、[Routing](./foundational_design_patterns/2_routing/pi.md)、[Parallelization](./foundational_design_patterns/3_parallelization/pi.md)、[Reflection](./foundational_design_patterns/4_reflection/pi.md)、[Tool Use](./foundational_design_patterns/5_tool_use/pi.md)、[Planning](./foundational_design_patterns/6_planning/pi.md)、[Multi-Agent Collaboration](./foundational_design_patterns/7_multi_agent_collaboration/pi.md)、[ReAct](./foundational_design_patterns/8_react/pi.md)、[HITL](./foundational_design_patterns/10_hitl/pi.md)、[Structured Outputs](./foundational_design_patterns/11_structured_outputs/pi.md)、[Computer Use](./foundational_design_patterns/12_computer_use/pi.md)
Expand Down
Loading
Loading