> ## Documentation Index
> Fetch the complete documentation index at: https://nvd-54.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack 集成

> 使用 LangChain Python 集成 Slack 文档加载器。

> [Slack](https://slack.com/) is an instant messaging program.

本 notebook 介绍如何load documents from a Zipfile generated from a `Slack` export.

In order to get this `Slack` export, follow these instructions:

## 🧑 Instructions for ingesting your own dataset

Export your Slack data. You can do this by going to your Workspace Management page and clicking the Import/Export option (\{your\_slack\_domain}.slack.com/services/export). Then, choose the right date range and click `Start export`. Slack will send you an email and a DM when the export is ready.

The download will produce a `.zip` file in your Downloads folder (or wherever your downloads can be found, depending on your OS configuration).

Copy the path to the `.zip` file, and assign it as `LOCAL_ZIPFILE` below.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_community.document_loaders import SlackDirectoryLoader
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# Optionally set your Slack URL. This will give you proper URLs in the docs sources.
SLACK_WORKSPACE_URL = "https://xxx.slack.com"
LOCAL_ZIPFILE = ""  # Paste the local path to your Slack zip file here.

loader = SlackDirectoryLoader(LOCAL_ZIPFILE, SLACK_WORKSPACE_URL)
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
docs = loader.load()
docs
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [通过 MCP 将这些文档连接到](/use-these-docs) Claude、VSCode 等工具以获取实时答案。
  </Callout>

  <Callout icon="edit">
    [在 GitHub 上编辑此页面](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/document_loaders/slack.mdx) 或 [提交 issue](https://github.com/langchain-ai/docs/issues/new/choose)。
  </Callout>
</div>
