agents.rag.corrective.agent_v2ΒΆ

Corrective RAG (CRAG) Agent V2.

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

ClassesΒΆ

CorrectiveRAGAgentV2

Corrective RAG with proper self-correcting retrieval.

Module ContentsΒΆ

class agents.rag.corrective.agent_v2.CorrectiveRAGAgentV2ΒΆ

Bases: haive.agents.multi.base.ConditionalAgent

Corrective RAG with proper 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 (0-1)

  • **kwargs – Additional arguments

Returns:

CorrectiveRAGAgentV2 instance