VectorStoreToolkit Class — langchain Architecture
Architecture documentation for the VectorStoreToolkit class in toolkit.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 23c1d7a4_768f_2f88_a9f7_e7cef9b792a4["VectorStoreToolkit"] b55a6854_cc86_0e53_c0bf_0f3258b669aa["BaseToolkit"] 23c1d7a4_768f_2f88_a9f7_e7cef9b792a4 -->|extends| b55a6854_cc86_0e53_c0bf_0f3258b669aa 5267c032_dda3_79c4_9c44_828c1765ed44["toolkit.py"] 23c1d7a4_768f_2f88_a9f7_e7cef9b792a4 -->|defined in| 5267c032_dda3_79c4_9c44_828c1765ed44 0ec97e35_d84b_5aa1_c268_3e092ab40e57["get_tools()"] 23c1d7a4_768f_2f88_a9f7_e7cef9b792a4 -->|method| 0ec97e35_d84b_5aa1_c268_3e092ab40e57
Relationship Graph
Source Code
libs/langchain/langchain_classic/agents/agent_toolkits/vectorstore/toolkit.py lines 22–62
class VectorStoreToolkit(BaseToolkit):
"""Toolkit for interacting with a `VectorStore`."""
vectorstore_info: VectorStoreInfo = Field(exclude=True)
llm: BaseLanguageModel
model_config = ConfigDict(
arbitrary_types_allowed=True,
)
def get_tools(self) -> list[BaseTool]:
"""Get the tools in the toolkit."""
try:
from langchain_community.tools.vectorstore.tool import (
VectorStoreQATool,
VectorStoreQAWithSourcesTool,
)
except ImportError as e:
msg = "You need to install langchain-community to use this toolkit."
raise ImportError(msg) from e
description = VectorStoreQATool.get_description(
self.vectorstore_info.name,
self.vectorstore_info.description,
)
qa_tool = VectorStoreQATool(
name=self.vectorstore_info.name,
description=description,
vectorstore=self.vectorstore_info.vectorstore,
llm=self.llm,
)
description = VectorStoreQAWithSourcesTool.get_description(
self.vectorstore_info.name,
self.vectorstore_info.description,
)
qa_with_sources_tool = VectorStoreQAWithSourcesTool(
name=f"{self.vectorstore_info.name}_with_sources",
description=description,
vectorstore=self.vectorstore_info.vectorstore,
llm=self.llm,
)
return [qa_tool, qa_with_sources_tool]
Extends
Source
Frequently Asked Questions
What is the VectorStoreToolkit class?
VectorStoreToolkit is a class in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent_toolkits/vectorstore/toolkit.py.
Where is VectorStoreToolkit defined?
VectorStoreToolkit is defined in libs/langchain/langchain_classic/agents/agent_toolkits/vectorstore/toolkit.py at line 22.
What does VectorStoreToolkit extend?
VectorStoreToolkit extends BaseToolkit.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free