Models, Retrieval, Tools, and Control Flow › Partial results and graceful degradation

Michael BrenndoerferDecember 2, 20261 min read
Language AI HandbookAll chapters
Part 64 of 67Compound AI System Design
Chapter 485Models, Retrieval, Tools, and Control Flow › Partial results and graceful degradation
Reading section 8 of 11 · Partial results and graceful degradation · 1 minSection 8 of 11 · 1 min

Section 8 of 11 · 1 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

A partial answer promises a narrower result. The assistant can explain which catalog rows matched the constraints even when it cannot answer whether a physical unit is in stock. A stock count of zero in the fixture is a complete result about availability. A stock state of unknown is a partial result. A query with no eligible catalog candidates abstains from making a recommendation.

The UI can check the outcome before showing a stock indicator. For the partial result, show the matched product and mark stock unknown. For the zero-stock result, show the count from the available fixture. The trace still gives you enough detail to diagnose whether the missing component was search, generation validation, or inventory.

PythonIn [24]
CollapseExpand
zero_stock = run_assistant(QUERY, {})
assert zero_stock.outcome is Outcome.COMPLETE
assert zero_stock.product_ids == partial.product_ids
assert "0 in stock" in zero_stock.text
print(zero_stock.outcome.value, zero_stock.text)
print(partial.outcome.value, partial.text)
ConsoleOut [24]
CollapseExpand
complete Trail Runner Pro at $110. Size 10: p1: 0 in stock.
partial Trail Runner Pro at $110. Stock is unknown.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy