agents.rag.query_planning.agent_chain¶
Query Planning RAG using ChainAgent.
Simplified version using the new ChainAgent approach.
Classes¶
Simplified query plan. |
|
Result from a sub-query. |
Functions¶
|
Adaptive planning based on query complexity. |
|
Create query planning RAG using ChainAgent. |
|
Even simpler version - just decompose and answer. |
Get I/O schema for query planning chain. |
Module Contents¶
- class agents.rag.query_planning.agent_chain.QueryPlan(/, **data)¶
Bases:
pydantic.BaseModel
Simplified query plan.
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)
- class agents.rag.query_planning.agent_chain.SubQueryResult(/, **data)¶
Bases:
pydantic.BaseModel
Result from a sub-query.
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)
- agents.rag.query_planning.agent_chain.create_adaptive_planning_chain(documents, llm_config=None)¶
Adaptive planning based on query complexity.
- Parameters:
documents (list[langchain_core.documents.Document])
llm_config (haive.core.models.llm.base.LLMConfig | None)
- Return type:
haive.agents.chain.ChainAgent
- agents.rag.query_planning.agent_chain.create_query_planning_chain(documents, llm_config=None, name='Query Planning RAG')¶
Create query planning RAG using ChainAgent.
- agents.rag.query_planning.agent_chain.create_simple_decomposition_chain(documents, llm_config=None)¶
Even simpler version - just decompose and answer.
- Parameters:
documents (list[langchain_core.documents.Document])
llm_config (haive.core.models.llm.base.LLMConfig | None)
- Return type:
haive.agents.chain.ChainAgent