About AI Pattern Library

The AI Pattern Library is an open-source, community-driven catalog of proven AI engineering patterns. Educational content about AI patterns is scattered across blog posts, research papers, and tutorials. This project provides a structured, searchable, and executable reference.

What's a Pattern?

Each pattern in this library represents a well-established approach to solving a common AI engineering challenge. Patterns include:

  • Explanation — Clear description of what the pattern does and when to use it
  • Architecture Diagram — Visual representation using Mermaid diagrams
  • Runnable Code — Python examples you can execute right in the browser
  • Gotchas — Real-world pitfalls and how to avoid them
  • Related Patterns — Links to complementary or alternative approaches

Categories

📚

Retrieval

Patterns for retrieving and grounding with external data (RAG, hybrid search, etc.)

🧠

Reasoning

Chain-of-thought, tree-of-thought, self-consistency, and structured reasoning

🔧

Tool Use

Function calling, API integration, and tool selection strategies

💾

Memory

Short-term, long-term, and episodic memory for conversational AI

🤖

Agents

Autonomous agents, multi-agent systems, and agent architectures

📊

Evaluation

LLM-as-judge, automated testing, and quality assurance patterns

🎼

Orchestration

Chaining, routing, parallelization, and workflow patterns

🛡️

Safety

Guardrails, content filtering, output validation, and responsible AI

Contributing

This is an open-source project and we welcome contributions! You can add new patterns, improve existing ones, fix bugs, or enhance the site.

See our Contributing Guide for details on how to submit a pattern via GitHub PR.

Tech Stack

  • Astro — Static site generator
  • MDX — Content with interactive components
  • Mermaid — Architecture diagrams
  • Pyodide — In-browser Python execution
  • GitHub Pages — Hosting