MERMAID: Memory-Enhanced Retrieval and Reasoning for Veracity Assessment
This skill enables Claude to implement the MERMAID framework -- a multi-agent system that decomposes claims into structured triplets, retrieves evidence through an iterative Thought-Action-Observation loop, and maintains a persistent evidence memory across claims. The key innovation is coupling retrieval and reasoning into a single ReAct-style cycle while reusing previously gathered evidence via an entity-indexed memory store, eliminating redundant searches and improving verification consistency.
When to Use
- When the user asks to verify factual claims, fact-check statements, or assess whether information is true or false
- When processing a batch of related claims that may share overlapping entities or evidence (e.g., checking multiple statements from the same article)
- When building an automated fact-checking or claim verification pipeline
- When the user wants to decompose a complex statement into verifiable sub-claims and check each one
- When assessing the veracity of LLM-generated responses against real-world knowledge
- When the user needs a transparent, traceable reasoning chain showing how a verdict was reached
Key Technique
MERMAID uses four coordinated components: a Decomposer agent that parses claims into structured knowledge triplets (subject, relation, object, attributions) plus topical keywords; an Executor agent that runs a ReAct-style {Thought -> Action -> Observation} loop to gather and reason over evidence; a Toolset providing granular search capabilities (Wikipedia article/section/fact retrieval, web search, scholarly databases); and a Memory Module that persists evidence in an entity-indexed key-value store across claims.
The critical insight is the memory module. Before the Executor begins reasoning on a new claim, the system extracts entities from the decomposition and queries memory for any previously retrieved evidence about those entities. This recalled evidence is injected into the initial prompt as a "warm start," letting the agent skip redundant lookups. After verification completes, newly gathered evidence is committed back to memory keyed by its associated entities. In benchmarks this reduced total tool calls by 16-30%, with the largest gains on claims requiring longer evidence chains.
The Executor's ReAct loop runs for up to T_max steps (typically 5). At each step the agent produces a thought (reasoning about what evidence is needed), selects an action (a specific tool call or the terminal Answer action), and receives an observation (tool output). The full trajectory becomes the human-readable rationale for the final verdict, providing transparency that static retrieval-then-classify pipelines lack.
Step-by-Step Workflow
Receive and normalize the claim. Accept the raw claim text. If the input contains multiple claims, split them into individual statements for sequential processing so the memory module can accumulate evidence across them.
Decompose the claim into structured triplets. Extract (subject, relation, object) triplets and topical keywords from each claim. For example, "Marie Curie won two Nobel Prizes in different scientific disciplines" yields triplets like (Marie Curie, won, Nobel Prize, {count: two, qualifier: different disciplines}) and keywords ["Nobel Prize", "Marie Curie", "physics", "chemistry"].
Extract entity keys for memory lookup. Collect all unique subjects and objects from the triplets to form the entity set E_c. These serve as lookup keys into the evidence memory.
Recall prior evidence from memory. Query the memory store for each entity in E_c. Aggregate all matching evidence entries into M_c. If evidence exists, include it in the initial context as pre-gathered facts to avoid re-searching.
Initialize the Executor's ReAct loop. Construct the initial prompt P_0 containing: the original claim, the structured decomposition, recalled evidence M_c, and an empty chat history H_0.
Execute the Thought-Action-Observation cycle. For each step t (up to T_max = 5):
- Thought: Reason about what information is still missing to verify the claim given current evidence.
- Action: Select a retrieval tool (web search, Wikipedia lookup, scholarly search) with specific query parameters, OR select the
Answer action to terminate with a verdict.
- Observation: Execute the tool and capture its output. Append
(thought_t, action_t, observation_t) to the chat history H_t.
Generate the verdict and rationale. When the Answer action is selected (or T_max is reached), produce a structured output: the veracity label (e.g., True / False / Partially True / Unverifiable), a confidence score, and the full reasoning trace as a human-readable rationale.
Validate and commit new evidence to memory. Review all evidence gathered during the ReAct loop. Filter out irrelevant or low-quality observations. Index valid evidence by the associated entities and store it in the persistent memory for future claims.
Process the next claim. Move to the next claim in the batch, repeating from step 2. The memory now contains evidence from all previously processed claims, enabling cross-claim reuse.
Return the consolidated results. Aggregate verdicts across all claims with their rationales, and optionally report memory statistics (cache hits, total searches avoided).
Concrete Examples
Example 1: Single claim verification
User: Fact-check this claim: "Tesla's Cybertruck was the best-selling electric
pickup truck in the US in 2025."
Approach:
1. Decompose: (Tesla Cybertruck, was, best-selling electric pickup truck,
{market: US, year: 2025})
Keywords: ["Cybertruck", "electric pickup truck", "US sales", "2025"]
2. Memory recall: No prior evidence (first claim). M_c = {}
3. ReAct loop:
Step 1:
Thought: I need 2025 US electric pickup truck sales data. Let me search
for Cybertruck sales figures and competing models.
Action: web_search("Cybertruck US sales 2025 electric pickup truck")
Observation: [Retrieved sales data showing Cybertruck units sold]
Step 2:
Thought: I have Cybertruck numbers but need competitor data (Ford F-150
Lightning, Rivian R1T, Chevy Silverado EV) to confirm "best-selling."
Action: web_search("electric pickup truck US sales 2025 F-150 Lightning
Rivian R1T Silverado EV")
Observation: [Retrieved competitor sales figures]
Step 3:
Thought: I now have Cybertruck and competitor sales. Cybertruck led in
total units. The claim is supported.
Action: Answer
4. Verdict: TRUE
Rationale: Based on 2025 US sales data, the Cybertruck sold [X] units,
exceeding the F-150 Lightning ([Y] units) and Rivian R1T ([Z] units).
5. Memory update: Store sales evidence under entities
["Tesla Cybertruck", "F-150 Lightning", "Rivian R1T"]
Example 2: Batch claims with cross-claim memory reuse
User: Check these three claims from an article:
1. "CRISPR was invented by Jennifer Doudna and Emmanuelle Charpentier."
2. "Doudna and Charpentier received the 2020 Nobel Prize in Chemistry."
3. "CRISPR has been approved by the FDA for treating sickle cell disease."
Approach:
Claim 1:
Decompose: (CRISPR, invented by, Jennifer Doudna AND Emmanuelle Charpentier)
Memory recall: Empty. Start fresh.
ReAct: Search Wikipedia for CRISPR history -> find that Doudna and
Charpentier developed the CRISPR-Cas9 gene editing method (2012), but
"invented" oversimplifies -- earlier work by Mojica, Zhang, etc. contributed.
Verdict: PARTIALLY TRUE
Memory update: Store CRISPR history, Doudna bio, Charpentier bio.
Claim 2:
Decompose: (Doudna AND Charpentier, received, 2020 Nobel Prize in Chemistry)
Memory recall: HIT -- Doudna and Charpentier evidence already stored from
Claim 1. The recalled evidence already mentions Nobel Prize context.
ReAct: Memory provides substantial context. One confirmatory search suffices.
Step 1: web_search("2020 Nobel Prize Chemistry") -> confirms award.
Step 2: Answer.
Verdict: TRUE
Searches saved: ~2 tool calls avoided via memory warm start.
Claim 3:
Decompose: (CRISPR, approved by, FDA, {application: treating sickle cell})
Memory recall: HIT on "CRISPR" -- general CRISPR evidence from Claim 1.
ReAct: Need specific FDA approval data.
Step 1: web_search("FDA CRISPR sickle cell disease approval")
-> Finds Casgevy (exagamglogene autotemcel) FDA-approved Dec 2023.
Step 2: Answer.
Verdict: TRUE (with nuance: the approved therapy is Casgevy, a CRISPR-based
treatment, not "CRISPR" as a generic tool)
Example 3: Implementing a fact-checking pipeline in code
User: Build me a Python fact-checking module using the MERMAID pattern.
Approach:
1. Create a ClaimDecomposer class that uses an LLM to extract triplets
and keywords from raw claim text.
2. Create an EvidenceMemory class with a dict-based key-value store indexed
by entity strings, supporting recall(entities) and update(entities, evidence).
3. Create an Executor class implementing the ReAct loop with configurable
tools (web search, Wikipedia API, etc.) and T_max parameter.
4. Create a MermaidPipeline class that orchestrates:
decompose -> memory_recall -> execute_react_loop -> generate_verdict ->
memory_update
5. Support batch processing with memory persisting across claims.
Output structure:
@dataclass
class VerificationResult:
claim: str
verdict: str # TRUE / FALSE / PARTIALLY_TRUE / UNVERIFIABLE
confidence: float
rationale: str # Full reasoning trace
evidence: list[str] # Key evidence snippets
search_count: int # Number of tool calls used
memory_hits: int # Evidence items recalled from memory
Best Practices
- Do: Process related claims in sequence so the memory module accumulates shared evidence. Order claims by topical similarity when possible to maximize cache hits.
- Do: Set
T_max to 5 for general claims. Increase to 7-8 for claims requiring multi-hop reasoning (e.g., "X happened because of Y, which was caused by Z").
- Do: Include the full ReAct trajectory in your rationale output. Transparency in the reasoning chain is what distinguishes this approach from opaque classifiers.
- Do: Validate evidence quality before committing to memory. Discard tool outputs that returned errors, empty results, or clearly irrelevant content.
- Avoid: Treating the decomposition as optional. Structured triplets are essential for both targeted retrieval queries and entity-based memory indexing.
- Avoid: Overfilling the initial prompt with recalled memory. If
M_c exceeds context limits, prioritize evidence most relevant to the current claim's triplets and discard tangential entries.
Error Handling
- Decomposition produces malformed triplets: Fall back to keyword extraction from the raw claim and proceed with keyword-based memory lookup and search queries. Log the decomposition failure for review.
- All retrieval tools return empty results: After exhausting retries, mark the claim as
UNVERIFIABLE with a rationale explaining that no supporting or refuting evidence could be found. Do not guess.
- Memory recall returns excessive or irrelevant evidence: The current entity-matching approach uses string-based keywords, not semantic similarity. If recalled evidence exceeds a reasonable threshold (e.g., >10 items), rank by recency and relevance to the claim's topical keywords, then truncate.
- Executor reaches
T_max without selecting Answer: Force verdict generation from accumulated evidence in the chat history. Flag the result with lower confidence and note that the reasoning loop was truncated.
- Conflicting evidence retrieved: Report the conflict explicitly in the rationale. Assess source reliability (e.g., primary sources over secondary, recent over outdated) and produce a nuanced verdict (PARTIALLY_TRUE or include caveats).
Limitations
- String-based memory matching: The entity-indexed memory uses keyword matching, not semantic similarity. Paraphrased entities (e.g., "US" vs. "United States") will miss cache hits. Normalize entities where possible.
- No temporal reasoning: The memory does not track evidence freshness. Stale evidence about rapidly changing facts (stock prices, election results) may produce incorrect verdicts if not re-verified.
- Single-claim decomposition granularity: Very complex claims with nested conditionals or multiple temporal scopes may not decompose cleanly into flat triplets.
- Tool dependency: Verdict quality depends directly on the availability and accuracy of search tools. Claims about niche or non-English topics may suffer from retrieval gaps.
- Not suitable for opinion or subjective claims: The framework is designed for factual veracity, not for assessing opinions, predictions, or value judgments.
Reference
MERMAID: Memory-Enhanced Retrieval and Reasoning with Multi-Agent Iterative Knowledge Grounding for Veracity Assessment -- Cao et al., 2026. Focus on Section 3 (framework architecture), Figure 2 (system diagram), and Section 4.4 (memory ablation study showing 16-30% search reduction).
1---2name: mermaid-memory-enhanced-retrieval-reasoning3description: Memory-enhanced multi-agent retrieval and reasoning for veracity assessment and fact-checking. Use when: 'verify this claim', 'fact-check these statements', 'check if this is true', 'assess the veracity of', 'cross-reference these claims', 'build a fact-checking pipeline'.4---56# MERMAID: Memory-Enhanced Retrieval and Reasoning for Veracity Assessment78This skill enables Claude to implement the MERMAID framework -- a multi-agent system that decomposes claims into structured triplets, retrieves evidence through an iterative Thought-Action-Observation loop, and maintains a persistent evidence memory across claims. The key innovation is coupling retrieval and reasoning into a single ReAct-style cycle while reusing previously gathered evidence via an entity-indexed memory store, eliminating redundant searches and improving verification consistency.910## When to Use1112- When the user asks to verify factual claims, fact-check statements, or assess whether information is true or false13- When processing a batch of related claims that may share overlapping entities or evidence (e.g., checking multiple statements from the same article)14- When building an automated fact-checking or claim verification pipeline15- When the user wants to decompose a complex statement into verifiable sub-claims and check each one16- When assessing the veracity of LLM-generated responses against real-world knowledge17- When the user needs a transparent, traceable reasoning chain showing how a verdict was reached1819## Key Technique2021MERMAID uses four coordinated components: a **Decomposer agent** that parses claims into structured knowledge triplets `(subject, relation, object, attributions)` plus topical keywords; an **Executor agent** that runs a ReAct-style `{Thought -> Action -> Observation}` loop to gather and reason over evidence; a **Toolset** providing granular search capabilities (Wikipedia article/section/fact retrieval, web search, scholarly databases); and a **Memory Module** that persists evidence in an entity-indexed key-value store across claims.2223The critical insight is the memory module. Before the Executor begins reasoning on a new claim, the system extracts entities from the decomposition and queries memory for any previously retrieved evidence about those entities. This recalled evidence is injected into the initial prompt as a "warm start," letting the agent skip redundant lookups. After verification completes, newly gathered evidence is committed back to memory keyed by its associated entities. In benchmarks this reduced total tool calls by 16-30%, with the largest gains on claims requiring longer evidence chains.2425The Executor's ReAct loop runs for up to `T_max` steps (typically 5). At each step the agent produces a thought (reasoning about what evidence is needed), selects an action (a specific tool call or the terminal `Answer` action), and receives an observation (tool output). The full trajectory becomes the human-readable rationale for the final verdict, providing transparency that static retrieval-then-classify pipelines lack.2627## Step-by-Step Workflow28291. **Receive and normalize the claim.** Accept the raw claim text. If the input contains multiple claims, split them into individual statements for sequential processing so the memory module can accumulate evidence across them.30312. **Decompose the claim into structured triplets.** Extract `(subject, relation, object)` triplets and topical keywords from each claim. For example, "Marie Curie won two Nobel Prizes in different scientific disciplines" yields triplets like `(Marie Curie, won, Nobel Prize, {count: two, qualifier: different disciplines})` and keywords `["Nobel Prize", "Marie Curie", "physics", "chemistry"]`.32333. **Extract entity keys for memory lookup.** Collect all unique subjects and objects from the triplets to form the entity set `E_c`. These serve as lookup keys into the evidence memory.34354. **Recall prior evidence from memory.** Query the memory store for each entity in `E_c`. Aggregate all matching evidence entries into `M_c`. If evidence exists, include it in the initial context as pre-gathered facts to avoid re-searching.36375. **Initialize the Executor's ReAct loop.** Construct the initial prompt `P_0` containing: the original claim, the structured decomposition, recalled evidence `M_c`, and an empty chat history `H_0`.38396. **Execute the Thought-Action-Observation cycle.** For each step `t` (up to `T_max = 5`):40 - **Thought**: Reason about what information is still missing to verify the claim given current evidence.41 - **Action**: Select a retrieval tool (web search, Wikipedia lookup, scholarly search) with specific query parameters, OR select the `Answer` action to terminate with a verdict.42 - **Observation**: Execute the tool and capture its output. Append `(thought_t, action_t, observation_t)` to the chat history `H_t`.43447. **Generate the verdict and rationale.** When the `Answer` action is selected (or `T_max` is reached), produce a structured output: the veracity label (e.g., True / False / Partially True / Unverifiable), a confidence score, and the full reasoning trace as a human-readable rationale.45468. **Validate and commit new evidence to memory.** Review all evidence gathered during the ReAct loop. Filter out irrelevant or low-quality observations. Index valid evidence by the associated entities and store it in the persistent memory for future claims.47489. **Process the next claim.** Move to the next claim in the batch, repeating from step 2. The memory now contains evidence from all previously processed claims, enabling cross-claim reuse.495010. **Return the consolidated results.** Aggregate verdicts across all claims with their rationales, and optionally report memory statistics (cache hits, total searches avoided).5152## Concrete Examples5354**Example 1: Single claim verification**5556```57User: Fact-check this claim: "Tesla's Cybertruck was the best-selling electric58pickup truck in the US in 2025."5960Approach:611. Decompose: (Tesla Cybertruck, was, best-selling electric pickup truck,62 {market: US, year: 2025})63 Keywords: ["Cybertruck", "electric pickup truck", "US sales", "2025"]64652. Memory recall: No prior evidence (first claim). M_c = {}66673. ReAct loop:68 Step 1:69 Thought: I need 2025 US electric pickup truck sales data. Let me search70 for Cybertruck sales figures and competing models.71 Action: web_search("Cybertruck US sales 2025 electric pickup truck")72 Observation: [Retrieved sales data showing Cybertruck units sold]7374 Step 2:75 Thought: I have Cybertruck numbers but need competitor data (Ford F-15076 Lightning, Rivian R1T, Chevy Silverado EV) to confirm "best-selling."77 Action: web_search("electric pickup truck US sales 2025 F-150 Lightning78 Rivian R1T Silverado EV")79 Observation: [Retrieved competitor sales figures]8081 Step 3:82 Thought: I now have Cybertruck and competitor sales. Cybertruck led in83 total units. The claim is supported.84 Action: Answer85864. Verdict: TRUE87 Rationale: Based on 2025 US sales data, the Cybertruck sold [X] units,88 exceeding the F-150 Lightning ([Y] units) and Rivian R1T ([Z] units).89905. Memory update: Store sales evidence under entities91 ["Tesla Cybertruck", "F-150 Lightning", "Rivian R1T"]92```9394**Example 2: Batch claims with cross-claim memory reuse**9596```97User: Check these three claims from an article:98 1. "CRISPR was invented by Jennifer Doudna and Emmanuelle Charpentier."99 2. "Doudna and Charpentier received the 2020 Nobel Prize in Chemistry."100 3. "CRISPR has been approved by the FDA for treating sickle cell disease."101102Approach:103Claim 1:104 Decompose: (CRISPR, invented by, Jennifer Doudna AND Emmanuelle Charpentier)105 Memory recall: Empty. Start fresh.106 ReAct: Search Wikipedia for CRISPR history -> find that Doudna and107 Charpentier developed the CRISPR-Cas9 gene editing method (2012), but108 "invented" oversimplifies -- earlier work by Mojica, Zhang, etc. contributed.109 Verdict: PARTIALLY TRUE110 Memory update: Store CRISPR history, Doudna bio, Charpentier bio.111112Claim 2:113 Decompose: (Doudna AND Charpentier, received, 2020 Nobel Prize in Chemistry)114 Memory recall: HIT -- Doudna and Charpentier evidence already stored from115 Claim 1. The recalled evidence already mentions Nobel Prize context.116 ReAct: Memory provides substantial context. One confirmatory search suffices.117 Step 1: web_search("2020 Nobel Prize Chemistry") -> confirms award.118 Step 2: Answer.119 Verdict: TRUE120 Searches saved: ~2 tool calls avoided via memory warm start.121122Claim 3:123 Decompose: (CRISPR, approved by, FDA, {application: treating sickle cell})124 Memory recall: HIT on "CRISPR" -- general CRISPR evidence from Claim 1.125 ReAct: Need specific FDA approval data.126 Step 1: web_search("FDA CRISPR sickle cell disease approval")127 -> Finds Casgevy (exagamglogene autotemcel) FDA-approved Dec 2023.128 Step 2: Answer.129 Verdict: TRUE (with nuance: the approved therapy is Casgevy, a CRISPR-based130 treatment, not "CRISPR" as a generic tool)131```132133**Example 3: Implementing a fact-checking pipeline in code**134135```136User: Build me a Python fact-checking module using the MERMAID pattern.137138Approach:1391. Create a ClaimDecomposer class that uses an LLM to extract triplets140 and keywords from raw claim text.1412. Create an EvidenceMemory class with a dict-based key-value store indexed142 by entity strings, supporting recall(entities) and update(entities, evidence).1433. Create an Executor class implementing the ReAct loop with configurable144 tools (web search, Wikipedia API, etc.) and T_max parameter.1454. Create a MermaidPipeline class that orchestrates:146 decompose -> memory_recall -> execute_react_loop -> generate_verdict ->147 memory_update1485. Support batch processing with memory persisting across claims.149150Output structure:151@dataclass152class VerificationResult:153 claim: str154 verdict: str # TRUE / FALSE / PARTIALLY_TRUE / UNVERIFIABLE155 confidence: float156 rationale: str # Full reasoning trace157 evidence: list[str] # Key evidence snippets158 search_count: int # Number of tool calls used159 memory_hits: int # Evidence items recalled from memory160```161162## Best Practices163164- **Do:** Process related claims in sequence so the memory module accumulates shared evidence. Order claims by topical similarity when possible to maximize cache hits.165- **Do:** Set `T_max` to 5 for general claims. Increase to 7-8 for claims requiring multi-hop reasoning (e.g., "X happened because of Y, which was caused by Z").166- **Do:** Include the full ReAct trajectory in your rationale output. Transparency in the reasoning chain is what distinguishes this approach from opaque classifiers.167- **Do:** Validate evidence quality before committing to memory. Discard tool outputs that returned errors, empty results, or clearly irrelevant content.168- **Avoid:** Treating the decomposition as optional. Structured triplets are essential for both targeted retrieval queries and entity-based memory indexing.169- **Avoid:** Overfilling the initial prompt with recalled memory. If `M_c` exceeds context limits, prioritize evidence most relevant to the current claim's triplets and discard tangential entries.170171## Error Handling172173- **Decomposition produces malformed triplets:** Fall back to keyword extraction from the raw claim and proceed with keyword-based memory lookup and search queries. Log the decomposition failure for review.174- **All retrieval tools return empty results:** After exhausting retries, mark the claim as `UNVERIFIABLE` with a rationale explaining that no supporting or refuting evidence could be found. Do not guess.175- **Memory recall returns excessive or irrelevant evidence:** The current entity-matching approach uses string-based keywords, not semantic similarity. If recalled evidence exceeds a reasonable threshold (e.g., >10 items), rank by recency and relevance to the claim's topical keywords, then truncate.176- **Executor reaches `T_max` without selecting `Answer`:** Force verdict generation from accumulated evidence in the chat history. Flag the result with lower confidence and note that the reasoning loop was truncated.177- **Conflicting evidence retrieved:** Report the conflict explicitly in the rationale. Assess source reliability (e.g., primary sources over secondary, recent over outdated) and produce a nuanced verdict (PARTIALLY_TRUE or include caveats).178179## Limitations180181- **String-based memory matching:** The entity-indexed memory uses keyword matching, not semantic similarity. Paraphrased entities (e.g., "US" vs. "United States") will miss cache hits. Normalize entities where possible.182- **No temporal reasoning:** The memory does not track evidence freshness. Stale evidence about rapidly changing facts (stock prices, election results) may produce incorrect verdicts if not re-verified.183- **Single-claim decomposition granularity:** Very complex claims with nested conditionals or multiple temporal scopes may not decompose cleanly into flat triplets.184- **Tool dependency:** Verdict quality depends directly on the availability and accuracy of search tools. Claims about niche or non-English topics may suffer from retrieval gaps.185- **Not suitable for opinion or subjective claims:** The framework is designed for factual veracity, not for assessing opinions, predictions, or value judgments.186187## Reference188189[MERMAID: Memory-Enhanced Retrieval and Reasoning with Multi-Agent Iterative Knowledge Grounding for Veracity Assessment](https://arxiv.org/abs/2601.22361v1) -- Cao et al., 2026. Focus on Section 3 (framework architecture), Figure 2 (system diagram), and Section 4.4 (memory ablation study showing 16-30% search reduction).