agents.rag.adaptive.agentΒΆ

Adaptive RAG Agent.

Dynamic strategy selection based on query complexity. Routes queries to appropriate RAG strategies.

ClassesΒΆ

AdaptiveRAGAgent

Adaptive RAG that routes queries based on complexity.

QueryAnalysis

Analysis of query characteristics.

Module ContentsΒΆ

class agents.rag.adaptive.agent.AdaptiveRAGAgentΒΆ

Bases: haive.agents.multi.base.ConditionalAgent

Adaptive RAG that routes queries based on complexity.

classmethod from_documents(documents, llm_config=None, embedding_model=None, **kwargs)ΒΆ

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

  • embedding_model (str | None) – Optional embedding model

  • **kwargs – Additional arguments

Returns:

AdaptiveRAGAgent instance

class agents.rag.adaptive.agent.QueryAnalysis(/, **data)ΒΆ

Bases: pydantic.BaseModel

Analysis of query characteristics.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)