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 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