Skip to content

The agent engineering platform.

Agent vector store tool doc (#9029)

TRY-ER2431eca70080
diff --git a/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py b/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py
index 5ae994a9f1..82b8c90b9c 100644
--- a/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py
+++ b/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py
@@ -22,7 +22,20 @@ def create_vectorstore_agent(
agent_executor_kwargs: Optional[Dict[str, Any]] = None,
**kwargs: Dict[str, Any],
) -> AgentExecutor:
- """Construct a VectorStore agent from an LLM and tools."""
+ """Construct a VectorStore agent from an LLM and tools.
+
+ Args:
+ llm (BaseLanguageModel): LLM that will be used by the agent
+ toolkit (VectorStoreToolkit): Set of tools for the agent
+ callback_manager (Optional[BaseCallbackManager], optional): Object to handle the callback [ Defaults to None. ]
+ prefix (str, optional): The prefix prompt for the agent. If not provided uses default PREFIX.
+ verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ]
+ agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ]
+ **kwargs: Additional named parameters to pass to the ZeroShotAgent.
+
+ Returns:
+ AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response
+ """ # noqa: E501
tools = toolkit.get_tools()
prompt = ZeroShotAgent.create_prompt(tools, prefix=prefix)
llm_chain = LLMChain(
@@ -50,7 +63,20 @@ def create_vectorstore_router_agent(
agent_executor_kwargs: Optional[Dict[str, Any]] = None,
**kwargs: Dict[str, Any],
) -> AgentExecutor:
- """Construct a VectorStore router agent from an LLM and tools."""
+ """Construct a VectorStore router agent from an LLM and tools.
+
+ Args:
+ llm (BaseLanguageModel): LLM that will be used by the agent
+ toolkit (VectorStoreRouterToolkit): Set of tools for the agent which have routing capability with multiple vector stores
+ callback_manager (Optional[BaseCallbackManager], optional): Object to handle the callback [ Defaults to None. ]
+ prefix (str, optional): The prefix prompt for the router agent. If not provided uses default ROUTER_PREFIX.
+ verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ]
+ agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ]
+ **kwargs: Additional named parameters to pass to the ZeroShotAgent.
+
+ Returns:
+ AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response.
+ """ # noqa: E501
tools = toolkit.get_tools()
prompt = ZeroShotAgent.create_prompt(tools, prefix=prefix)
llm_chain = LLMChain(