CSVLoader document loaders. For detailed documentation of all CSVLoader features and configurations head to the API reference.
This example goes over how to load data from CSV files. The second argument is the column name to extract from the CSV file. One document will be created for each row in the CSV file. When column is not specified, each row is converted into a key/value pair with each key/value pair outputted to a new line in the document’s pageContent. When column is specified, one document is created for each row, and the value of the specified column is used as the document’s pageContent.
概述
集成详情
设置
要访问CSVLoader document loader,你需要install the @langchain/community integration, along with the d3-dsv@2 peer dependency.
安装
The LangChain CSVLoader integration lives in the@langchain/community integration package.
实例化
Now we can instantiate our model object and load documents:Load
Usage, extracting a single column
Example CSV file:API 参考
有关所有 CSVLoader 功能和配置的详细文档,请前往 API 参考。将这些文档连接到 Claude、VSCode 等工具,通过 MCP 获取实时答案。

