Iron Brick AI Field Guide · Build ·

Most LLM applications are built from a handful of reusable patterns. Picking the simplest one that fits keeps cost, latency, and risk down.

Nine Chain Patterns for LLM Applications: From a single prompt to grounded, conversational answers: what each pattern does and when to use it.
Click to open full size. Download PNG · SVG

Start simple, add only what you need

The single-call pattern is the baseline. Add retrieval when the model needs facts it was never trained on, which in an agency means case records, policy, and program rules. Retrieval is also what makes answers checkable: every response can cite the record it came from.

Handling large document sets

"Stuff documents" is fast and cheap until the material outgrows the context window. Map-reduce handles volume by working on chunks in parallel; refine is slower but better when later documents should change the conclusion; map-rerank is right when a single document holds the answer and the job is to find it.

Composing production workflows

Sequences and routers turn individual calls into systems. A router is one of the easiest cost and risk controls available: send routine requests to a smaller model, complex ones to a stronger model, and anything touching sensitive data down a path with stricter controls and human review.

In a federal setting

Whatever the pattern, the retrieval step should go through governed APIs rather than direct database access, so every lookup is authorized for the user and written to the audit log. That is how a chain stays inside an agency's authorization boundary.

Key takeaways

  • Start with a single call; add retrieval when answers must reflect agency data.
  • Pick map-reduce, refine, or rerank based on document volume and how the answer is found.
  • Use routing to control cost and to send sensitive requests down stricter paths.
  • Retrieve through governed, audited APIs, not direct database queries.

All AI Field Guide topics

Applying this in your agency?

Talk with an Iron Brick architect about patterns, governance, and integration for your systems of record.

Talk to an Architect