ai-llm-patterns

Provide patterns for AI and LLM integration, including RAG architecture and tool use.

14|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rnavarych/alpha-engineer --skill ai-llm-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-llm-patterns
Source: https://github.com/rnavarych/alpha-engineer/tree/main/plugins/billy-milligan/skills/shared/ai-llm-patterns
Command: npx skills add https://github.com/rnavarych/alpha-engineer --skill ai-llm-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to integrating AI and Large Language Models (LLMs) into applications, covering essential patterns for efficient and effective development.

Core Features & Use Cases

  • RAG Architecture: Understand and implement Retrieval-Augmented Generation pipelines.
  • Tool Use & Function Calling: Learn how to enable LLMs to interact with external tools.
  • Model Selection & Cost Management: Guidance on choosing the right LLM model and managing token costs.
  • Use Case: You are building a new feature that requires users to ask questions about a large document set. Use this Skill to learn how to implement a RAG pipeline that retrieves relevant information and uses an LLM to generate an answer.

Quick Start

Use the ai-llm-patterns skill to learn about RAG architecture and embedding strategies.

Frequently Asked Questions about ai-llm-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement RAG architecture with chunking and vector search for a large document set?

RAG architecture pipelines retrieve relevant document chunks via vector search and pass them to an LLM to generate answers. You chunk documents, generate embeddings, and use similarity search to supply context for accurate question answering.

How do I structure LLM output and validate responses in TypeScript?

Structured output with Zod lets you define TypeScript schemas that validate LLM responses. You enforce schema compliance on the model's output, ensuring the returned data matches your expected types and application contracts.

What's the best way to manage token costs when integrating Anthropic models?

Token cost management and prompt caching reduce Anthropic model expenses. By caching frequent prompt prefixes and selecting appropriate models for specific tasks, you optimize token usage and lower operational costs.

How does Anthropic SDK streaming work for real-time AI features?

Anthropic SDK streaming sends model responses incrementally as they generate, enabling real-time UI updates. You process tokens as they arrive rather than waiting for the full response, improving perceived application latency.

Can I enable LLM tool use and function calling to interact with external systems?

Tool use and function calling allow LLMs to interact with external tools and APIs. You define available functions, and the model decides when to invoke them, bridging the AI model with your application's external capabilities.

How do I choose the right LLM model for my specific application requirements?

Model selection involves matching LLM capabilities to your task complexity and latency needs. You evaluate factors like context window size, reasoning ability, and cost to pick the optimal model for your specific AI feature.