agents.rag.multi_query.agentΒΆ

Multi-Query RAG Agent.

Improves recall through query diversification. Generates multiple query variations and retrieves from all.

ClassesΒΆ

MultiQueryRAGAgent

Multi-Query RAG with query expansion for improved recall.

MultiRetrievalAgent

Agent that performs parallel retrieval with multiple queries.

QueryVariations

Structured output for query variations.

Module ContentsΒΆ

class agents.rag.multi_query.agent.MultiQueryRAGAgentΒΆ

Bases: haive.agents.multi.enhanced_sequential_agent.SequentialAgent

Multi-Query RAG with query expansion for improved recall.

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

Create Multi-Query 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 for vector store

  • **kwargs – Additional arguments

Returns:

MultiQueryRAGAgent instance

class agents.rag.multi_query.agent.MultiRetrievalAgentΒΆ

Bases: haive.agents.base.agent.Agent

Agent that performs parallel retrieval with multiple queries.

build_graph()ΒΆ

Build graph that retrieves with multiple queries in parallel.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

class agents.rag.multi_query.agent.QueryVariations(/, **data)ΒΆ

Bases: pydantic.BaseModel

Structured output for query variations.

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)