VerifiedReasoningRetriever<T>

Models & Types · AiDotNet.RetrievalAugmentedGeneration.AdvancedPatterns

Verified reasoning retriever that validates each reasoning step with critic models.

Inheritance: RetrieverBase<T> → VerifiedReasoningRetriever<T>

For Beginners

Think of this like having a fact-checker review each step of your reasoning.

Regular Chain-of-Thought:

  • Generate reasoning steps
  • Retrieve documents
  • Return results

Verified Reasoning:

  • Generate a reasoning step
  • Retrieve supporting documents
  • Ask a critic: “Is this step well-supported by the documents?”
  • If not, refine the step or try a different approach
  • Continue only with verified steps

This is useful when:

  • Accuracy is critical (medical, legal, scientific domains)
  • You want to avoid hallucinations or unsupported claims
  • You need transparent, verifiable reasoning chains

How It Works

This advanced retrieval pattern adds verification and self-refinement to chain-of-thought reasoning. Each reasoning step is evaluated by a critic model to ensure it’s well-supported by retrieved evidence. If a step is found to be weak or unsupported, the system can refine it or generate alternative reasoning paths.

Constructors

Constructor Summary
VerifiedReasoningRetriever(IGenerator<T> generator, RetrieverBase<T> baseRetriever, double verificationThreshold, int maxRefinementAttempts, int defaultTopK) Initializes a new instance of the VerifiedReasoningRetriever class.

Methods

Method Summary
VerifiedReasoningResult<T> RetrieveWithVerification(string query, int topK, Dictionary<string, object> metadataFilters) Retrieves documents using verified reasoning with critic feedback.