haive.agents.rag.corrective.agent¶

Corrective RAG (CRAG) Agent.

from typing import Any, Dict Self-correcting retrieval with quality assessment. Implements architecture from rag-architectures-flows.md: Retrieval → Relevance Check → Knowledge Refinement/Web Search/Combine

Classes¶

CorrectiveRAGAgent

Corrective RAG with self-correcting retrieval.

Module Contents¶

class haive.agents.rag.corrective.agent.CorrectiveRAGAgent¶

Bases: haive.agents.multi.base.ConditionalAgent

Corrective RAG with self-correcting retrieval.

classmethod from_documents(documents, llm_config=None, relevance_threshold=0.7, **kwargs)¶

Create Corrective RAG from documents.

Parameters:
  • documents (list[langchain_core.documents.Document]) – Documents to index

  • llm_config (haive.core.models.llm.base.LLMConfig | None) – Optional LLM configuration

  • relevance_threshold (float) – Threshold for document relevance

  • **kwargs – Additional arguments

Returns:

CorrectiveRAGAgent instance