LLM Application Patterns
Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Deps: architect, data-engineering, ops
Dependencies
Load the following via read_file before using this skill:
~/.copilot/skills/architect/SKILL.md - module boundary and API contract patterns; LLM app components (retriever, generator, evaluator) are black-box modules
~/.copilot/skills/data-engineering/SKILL.md - ingestion and pipeline patterns for corpus preparation, embedding pipelines, and index refresh
~/.copilot/skills/ops/SKILL.md - CI/CD and deployment patterns for LLMOps pipelines, model versioning, and evaluation automation
If any dependency SKILL.md cannot be loaded, notify the user of the missing dependency and proceed only with the capabilities that do not require it, clearly stating which guidance may be incomplete.
Expert in production LLM application patterns and architectures.
When to Use This Skill
Use when:
- Building production RAG (Retrieval-Augmented Generation) pipelines
- Implementing AI agents with tool use and multi-step reasoning
- Designing prompt engineering strategies and template systems
- Setting up LLMOps: monitoring, logging, tracing, and evaluation
- Deploying LLM applications with caching, rate limiting, and fallbacks
- Choosing between different agent architectures (ReAct, function calling, plan-execute, multi-agent)
- Optimizing retrieval: chunking strategies, vector databases, hybrid search
- Building production-ready systems: cost optimization, reliability, observability
Core Capabilities
This skill provides production-proven patterns for:
- RAG Pipelines - Document ingestion, chunking, embedding, retrieval, generation
- Agent Architectures - ReAct, function calling, plan-execute, multi-agent collaboration
- Prompt Engineering - Templates, versioning, A/B testing, chaining
- LLMOps & Monitoring - Metrics, logging, tracing, evaluation frameworks
- Production Patterns - Caching, rate limiting, retry logic, fallbacks
Pattern References
For detailed implementation guidance, see:
RAG Pipelines
Use when: Building search-augmented LLM applications
Covers:
- Document ingestion and preprocessing
- Chunking strategies (fixed, semantic, sliding window)
- Vector database selection and configuration
- Retrieval patterns (dense, sparse, hybrid, multi-vector)
- Generation with retrieved context
Agent Architectures
Use when: Building agents that use tools or multi-step reasoning
Covers:
- ReAct pattern (Reasoning + Acting)
- Function calling for structured tool use
- Plan-and-execute for complex tasks
- Multi-agent collaboration patterns
- Architecture decision matrix
Prompt Engineering
Use when: Designing prompt templates and chains within an LLM application (not for building a standalone reusable prompt template library - use prompt-library for that)
Covers:
- Prompt templates with variables
- Versioning and A/B testing
- Prompt chaining for multi-step workflows
- Few-shot learning patterns
- Best practices for prompt structure
LLMOps & Observability
Use when: Setting up monitoring and evaluation
Covers:
- Key metrics to track (performance, quality, cost, reliability)
- Logging and distributed tracing
- Evaluation frameworks and benchmarking
- Caching strategies for cost reduction
- Rate limiting and retry patterns
- Fallback strategies for reliability
Quick Decision Guide
| Goal |
Reference |
| Answer questions from your docs |
RAG Pipelines |
| Build tool-using agent |
Agent Architectures |
| Design prompt templates for your LLM app |
Prompt Engineering |
| Monitor production system |
LLMOps & Observability |
Definition of Done
Constraints
- Does NOT write production application code or infrastructure configuration. Provides architecture diagrams, decision guidance, and starter prompt/config templates only.
- Does NOT evaluate model quality or fine-tuning strategies
- Does NOT manage infrastructure (consult ops skill)
- Does NOT handle non-LLM ML patterns (classical ML, computer vision, etc.)
Common Pitfalls
- Over-engineering RAG: Start with naive RAG before adding reranking, hybrid search, or agentic retrieval
- Ignoring cost: LLM API costs scale with query volume; always estimate and set budgets
- Missing fallbacks: Every LLM call needs a fallback strategy (retry, cheaper model, cached response)
- Prompt drift: Unversioned prompts silently degrade; version-control all prompt templates
- Evaluation gaps: Deploy without eval framework = flying blind. Measure before and after every change
Integration Points
- architect: Defines overall system architecture into which LLM patterns fit
- data-engineering: Manages data pipelines feeding RAG knowledge bases
- genai-security: Audits LLM applications for security vulnerabilities
- ai-engineer: Implements the patterns defined by this skill
- ops: Deploys and monitors LLM applications in production
References
Load these to apply the correct pattern for the task at hand. If the task spans multiple references (e.g., an agentic RAG system requiring both agent-architectures.md and rag-pipelines.md), load all relevant references and synthesize guidance, noting where the references interact.
- rag-pipelines.md - RAG architecture patterns (naive, advanced, agentic). Load when designing or reviewing any retrieval-augmented generation system.
- agent-architectures.md - LLM agent topology patterns (ReAct, Plan-and-Execute, multi-agent). Load when designing autonomous agent systems or tool-use workflows.
- prompt-engineering.md - Prompt design patterns (few-shot, chain-of-thought, structured output). Load when writing or reviewing system prompts or task prompts.
- llmops-observability.md - LLMOps monitoring and evaluation patterns. Load when setting up eval frameworks, tracing, or production observability for LLM applications.
- pattern_summary.md - One-page pattern decision guide. Load first when unsure which pattern applies - use to select the right reference file before diving deeper.
1---2name: llm-app-patterns-23description: Production LLM application patterns, architectures, and best practices. Covers RAG pipelines, agent architectures, prompt engineering, LLMOps, and production deployment patterns. Triggers: building RAG, implementing AI agents, designing prompt strategies, setting up LLMOps, deploying LLM apps with caching/rate-limiting/fallbacks.4license: MIT5---67# LLM Application Patterns89> Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Deps: architect, data-engineering, ops1011## Dependencies1213Load the following via `read_file` before using this skill:1415- `~/.copilot/skills/architect/SKILL.md` - module boundary and API contract patterns; LLM app components (retriever, generator, evaluator) are black-box modules16- `~/.copilot/skills/data-engineering/SKILL.md` - ingestion and pipeline patterns for corpus preparation, embedding pipelines, and index refresh17- `~/.copilot/skills/ops/SKILL.md` - CI/CD and deployment patterns for LLMOps pipelines, model versioning, and evaluation automation1819If any dependency SKILL.md cannot be loaded, notify the user of the missing dependency and proceed only with the capabilities that do not require it, clearly stating which guidance may be incomplete.2021Expert in production LLM application patterns and architectures.2223## When to Use This Skill2425Use when:2627- Building production RAG (Retrieval-Augmented Generation) pipelines28- Implementing AI agents with tool use and multi-step reasoning29- Designing prompt engineering strategies and template systems30- Setting up LLMOps: monitoring, logging, tracing, and evaluation31- Deploying LLM applications with caching, rate limiting, and fallbacks32- Choosing between different agent architectures (ReAct, function calling, plan-execute, multi-agent)33- Optimizing retrieval: chunking strategies, vector databases, hybrid search34- Building production-ready systems: cost optimization, reliability, observability3536---3738## Core Capabilities3940This skill provides production-proven patterns for:41421. **RAG Pipelines** - Document ingestion, chunking, embedding, retrieval, generation432. **Agent Architectures** - ReAct, function calling, plan-execute, multi-agent collaboration443. **Prompt Engineering** - Templates, versioning, A/B testing, chaining454. **LLMOps & Monitoring** - Metrics, logging, tracing, evaluation frameworks465. **Production Patterns** - Caching, rate limiting, retry logic, fallbacks4748---4950## Pattern References5152For detailed implementation guidance, see:5354### [RAG Pipelines](references/rag-pipelines.md)5556**Use when:** Building search-augmented LLM applications5758Covers:5960- Document ingestion and preprocessing61- Chunking strategies (fixed, semantic, sliding window)62- Vector database selection and configuration63- Retrieval patterns (dense, sparse, hybrid, multi-vector)64- Generation with retrieved context6566### [Agent Architectures](references/agent-architectures.md)6768**Use when:** Building agents that use tools or multi-step reasoning6970Covers:7172- ReAct pattern (Reasoning + Acting)73- Function calling for structured tool use74- Plan-and-execute for complex tasks75- Multi-agent collaboration patterns76- Architecture decision matrix7778### [Prompt Engineering](references/prompt-engineering.md)7980**Use when:** Designing prompt templates and chains within an LLM application (not for building a standalone reusable prompt template library - use prompt-library for that)8182Covers:8384- Prompt templates with variables85- Versioning and A/B testing86- Prompt chaining for multi-step workflows87- Few-shot learning patterns88- Best practices for prompt structure8990### [LLMOps & Observability](references/llmops-observability.md)9192**Use when:** Setting up monitoring and evaluation9394Covers:9596- Key metrics to track (performance, quality, cost, reliability)97- Logging and distributed tracing98- Evaluation frameworks and benchmarking99- Caching strategies for cost reduction100- Rate limiting and retry patterns101- Fallback strategies for reliability102103---104105## Quick Decision Guide106107| Goal | Reference |108| :--------------------------------------- | :----------------------------------------------------------- |109| Answer questions from your docs | [RAG Pipelines](references/rag-pipelines.md) |110| Build tool-using agent | [Agent Architectures](references/agent-architectures.md) |111| Design prompt templates for your LLM app | [Prompt Engineering](references/prompt-engineering.md) |112| Monitor production system | [LLMOps & Observability](references/llmops-observability.md) |113114---115116## Definition of Done117118- [ ] Selected pattern has clear justification (RAG vs. agent vs. fine-tune decision documented)119- [ ] Observability configured: latency, token usage, and error rate metrics defined120- [ ] Fallback strategy exists for LLM provider failures121- [ ] Prompt templates are versioned and stored outside application code122- [ ] Cost estimate provided for expected query volume123124## Constraints125126- Does NOT write production application code or infrastructure configuration. Provides architecture diagrams, decision guidance, and starter prompt/config templates only.127- Does NOT evaluate model quality or fine-tuning strategies128- Does NOT manage infrastructure (consult ops skill)129- Does NOT handle non-LLM ML patterns (classical ML, computer vision, etc.)130131## Common Pitfalls132133- **Over-engineering RAG**: Start with naive RAG before adding reranking, hybrid search, or agentic retrieval134- **Ignoring cost**: LLM API costs scale with query volume; always estimate and set budgets135- **Missing fallbacks**: Every LLM call needs a fallback strategy (retry, cheaper model, cached response)136- **Prompt drift**: Unversioned prompts silently degrade; version-control all prompt templates137- **Evaluation gaps**: Deploy without eval framework = flying blind. Measure before and after every change138139## Integration Points140141- **architect**: Defines overall system architecture into which LLM patterns fit142- **data-engineering**: Manages data pipelines feeding RAG knowledge bases143- **genai-security**: Audits LLM applications for security vulnerabilities144- **ai-engineer**: Implements the patterns defined by this skill145- **ops**: Deploys and monitors LLM applications in production146147## References148149Load these to apply the correct pattern for the task at hand. If the task spans multiple references (e.g., an agentic RAG system requiring both agent-architectures.md and rag-pipelines.md), load all relevant references and synthesize guidance, noting where the references interact.150151- [rag-pipelines.md](./references/rag-pipelines.md) - RAG architecture patterns (naive, advanced, agentic). Load when designing or reviewing any retrieval-augmented generation system.152- [agent-architectures.md](./references/agent-architectures.md) - LLM agent topology patterns (ReAct, Plan-and-Execute, multi-agent). Load when designing autonomous agent systems or tool-use workflows.153- [prompt-engineering.md](./references/prompt-engineering.md) - Prompt design patterns (few-shot, chain-of-thought, structured output). Load when writing or reviewing system prompts or task prompts.154- [llmops-observability.md](./references/llmops-observability.md) - LLMOps monitoring and evaluation patterns. Load when setting up eval frameworks, tracing, or production observability for LLM applications.155- [pattern_summary.md](./references/pattern_summary.md) - One-page pattern decision guide. Load first when unsure which pattern applies - use to select the right reference file before diving deeper.