name: abductive
description: Generate and compare plausible explanations for incomplete observations, separating observed evidence from hypotheses and identifying tests that could distinguish competing explanations.
metadata:
source: skills/02-reasoning/abductive.md
category: 02-reasoning
version: "v2"
Abductive Reasoning
Category: reasoning
Skill Level: advanced
Stability: stable
Added: 2025-03
Last Updated: 2026-04
Description
Infer the most plausible explanation for an incomplete set of observations — the logical "inference to the best explanation." Given partial evidence (symptoms, logs, user complaints, sensor spikes), the agent generates ranked hypotheses ordered by likelihood, identifies what evidence supports each, and suggests what additional data would confirm or rule out each candidate. Useful for root-cause analysis, medical triage, debugging, and scientific hypothesis generation.
Inputs
| Input |
Type |
Required |
Description |
observations |
list |
✅ |
List of observed facts or symptoms |
domain |
string |
❌ |
Domain hint: medical, software, mechanical, etc. |
top_n |
int |
❌ |
Number of hypotheses to return (default: 3) |
Outputs
| Output |
Type |
Description |
hypotheses |
list |
[{hypothesis, plausibility, supporting_evidence, falsification_test}] |
best_explanation |
string |
Top-ranked hypothesis |
confidence |
string |
high / medium / low |
Example
import anthropic
import json
client = anthropic.Anthropic()
def abductive_analysis(observations: list[str], domain: str = "") -> dict:
"""
Return ranked hypotheses explaining the given observations.
observations: list of factual observations (e.g. error messages, symptoms)
"""
obs_text = "\n".join(f"- {o}" for o in observations)
domain_hint = f"Domain context: {domain}\n" if domain else ""
response = client.messages.create(
model="claude-opus-4-5",
max_tokens=2048,
messages=[{
"role": "user",
"content": (
f"{domain_hint}"
"Observations:\n"
f"{obs_text}\n\n"
"Using abductive reasoning, return JSON with:\n"
"- hypotheses: top 3 [{hypothesis, plausibility (0-1), "
"supporting_evidence (list), falsification_test}]\n"
"- best_explanation: string\n"
"- confidence: high | medium | low\n"
"- missing_evidence: what additional data would help\n"
"Return ONLY valid JSON."
)
}]
)
return json.loads(response.content[0].text)
result = abductive_analysis(
observations=[
"Server CPU spiked to 100% at 03:17 UTC",
"Database slow query log shows 450ms average at the same time",
"No deployments in the past 24 hours",
"Traffic was 30% below normal"
],
domain="software infrastructure"
)
print(json.dumps(result, indent=2))
Frameworks & Models
| Framework / Model |
Implementation |
Since |
| Claude claude-opus-4-5 |
Extended thinking + direct prompt |
2025-01 |
| GPT-4o |
Chain-of-thought prompt |
2024-05 |
| LangGraph |
Multi-step hypothesis graph node |
v0.1 |
Notes
- Enable extended thinking for complex multi-variable observations
- Frame observations as factual statements, not already-interpreted conclusions
- For software debugging, attach relevant log snippets to the observations list
Failure Modes
- Plausibility bias: the "best" explanation is chosen because it is familiar, not because it explains more of the evidence; rank hypotheses by coverage and simplicity, not by precedent.
- Unfalsifiable hypotheses: abduction can always produce some explanation; require each hypothesis to state a discriminating check that could refute it.
- Treating abduction as proof: an inferred explanation is a lead, not a conclusion; confirm it with dedicated evidence before acting on it.
- Narrative inflation: partial evidence plus a fluent narrative feels complete; explicitly list what the evidence does not explain before committing to the diagnosis.
Related Skills
- Causal Reasoning — determining cause-effect chains
- Bayesian Reasoning — probabilistic belief updating
- Hypothesis Generation — generating ranked candidate explanations
Changelog
| Date |
Change |
2026-04 |
Expanded from stub: full description, I/O table, root-cause analysis example |
2025-03 |
Initial stub entry |
Evidence
The canonical skill file is the authoritative repository implementation. Repository schema, validation workflows, and the Agent Skills projection contract define structural conformance. Implementation guidance must remain traceable to supplied or independently verified authoritative sources; no benchmark claim is made without reproducible evidence.
1---2name: abductive-23description: Generate and compare plausible explanations for incomplete observations, separating observed evidence from hypotheses and identifying tests that could distingui4---5---6name: abductive7description: Generate and compare plausible explanations for incomplete observations, separating observed evidence from hypotheses and identifying tests that could distinguish competing explanations.8metadata:9 source: skills/02-reasoning/abductive.md10 category: 02-reasoning11 version: "v2"12---13141516# Abductive Reasoning1718**Category:** `reasoning`19**Skill Level:** `advanced`20**Stability:** `stable`21**Added:** 2025-0322**Last Updated:** 2026-042324---2526## Description2728Infer the most plausible explanation for an incomplete set of observations — the logical "inference to the best explanation." Given partial evidence (symptoms, logs, user complaints, sensor spikes), the agent generates ranked hypotheses ordered by likelihood, identifies what evidence supports each, and suggests what additional data would confirm or rule out each candidate. Useful for root-cause analysis, medical triage, debugging, and scientific hypothesis generation.2930---3132## Inputs3334| Input | Type | Required | Description |35|---|---|---|---|36| `observations` | `list` | ✅ | List of observed facts or symptoms |37| `domain` | `string` | ❌ | Domain hint: `medical`, `software`, `mechanical`, etc. |38| `top_n` | `int` | ❌ | Number of hypotheses to return (default: 3) |3940---4142## Outputs4344| Output | Type | Description |45|---|---|---|46| `hypotheses` | `list` | `[{hypothesis, plausibility, supporting_evidence, falsification_test}]` |47| `best_explanation` | `string` | Top-ranked hypothesis |48| `confidence` | `string` | `high` / `medium` / `low` |4950---5152## Example5354```python55import anthropic56import json5758client = anthropic.Anthropic()5960def abductive_analysis(observations: list[str], domain: str = "") -> dict:61 """62 Return ranked hypotheses explaining the given observations.63 observations: list of factual observations (e.g. error messages, symptoms)64 """65 obs_text = "\n".join(f"- {o}" for o in observations)66 domain_hint = f"Domain context: {domain}\n" if domain else ""6768 response = client.messages.create(69 model="claude-opus-4-5",70 max_tokens=2048,71 messages=[{72 "role": "user",73 "content": (74 f"{domain_hint}"75 "Observations:\n"76 f"{obs_text}\n\n"77 "Using abductive reasoning, return JSON with:\n"78 "- hypotheses: top 3 [{hypothesis, plausibility (0-1), "79 "supporting_evidence (list), falsification_test}]\n"80 "- best_explanation: string\n"81 "- confidence: high | medium | low\n"82 "- missing_evidence: what additional data would help\n"83 "Return ONLY valid JSON."84 )85 }]86 )87 return json.loads(response.content[0].text)8889result = abductive_analysis(90 observations=[91 "Server CPU spiked to 100% at 03:17 UTC",92 "Database slow query log shows 450ms average at the same time",93 "No deployments in the past 24 hours",94 "Traffic was 30% below normal"95 ],96 domain="software infrastructure"97)98print(json.dumps(result, indent=2))99```100101---102103## Frameworks & Models104105| Framework / Model | Implementation | Since |106|---|---|---|107| Claude claude-opus-4-5 | Extended thinking + direct prompt | 2025-01 |108| GPT-4o | Chain-of-thought prompt | 2024-05 |109| LangGraph | Multi-step hypothesis graph node | v0.1 |110111---112113## Notes114115- Enable extended thinking for complex multi-variable observations116- Frame observations as factual statements, not already-interpreted conclusions117- For software debugging, attach relevant log snippets to the observations list118119---120121## Failure Modes122123- **Plausibility bias:** the "best" explanation is chosen because it is familiar, not because it explains more of the evidence; rank hypotheses by coverage and simplicity, not by precedent.124- **Unfalsifiable hypotheses:** abduction can always produce *some* explanation; require each hypothesis to state a discriminating check that could refute it.125- **Treating abduction as proof:** an inferred explanation is a lead, not a conclusion; confirm it with dedicated evidence before acting on it.126- **Narrative inflation:** partial evidence plus a fluent narrative feels complete; explicitly list what the evidence does *not* explain before committing to the diagnosis.127128## Related Skills129130- [Causal Reasoning](causal.md) — determining cause-effect chains131- [Bayesian Reasoning](bayesian-reasoning.md) — probabilistic belief updating132- [Hypothesis Generation](hypothesis-generation.md) — generating ranked candidate explanations133134---135136## Changelog137138| Date | Change |139|---|---|140| `2026-04` | Expanded from stub: full description, I/O table, root-cause analysis example |141| `2025-03` | Initial stub entry |142143## Evidence144The canonical skill file is the authoritative repository implementation. Repository schema, validation workflows, and the Agent Skills projection contract define structural conformance. Implementation guidance must remain traceable to supplied or independently verified authoritative sources; no benchmark claim is made without reproducible evidence.