A LangChain agent that reads Slack content needs a summary of the conversation, not the interface around it. Slack’s web interface requires authentication for most content, and the Slack API returns paginated JSON across separate endpoints for channels, messages, threads, and replies, all of which you have to assemble and summarise before an agent can use them. Shared Slack links and public message archives are easier to reach, but raw fetching returns the page template with navigation chrome, emoji reactions, member panels, and read-status indicators wrapped around the conversation. EnConvert’s Distill endpoint takes a Slack URL or exported message content and returns a clean summary in one API call, ready to pass into a LangChain tool.
How to Summarise Slack with LangChain
How to summarise Slack content inside a LangChain agent with EnConvert Distill, returning a clean LLM-ready summary of any thread or archive in one call
Get API keyExample
python
import os
import requests
from langchain.agents import create_agent
from langchain.tools import tool
from langchain_openai import ChatOpenAI
ENCONVERT_API_KEY = os.environ["ENCONVERT_API_KEY"]
# A Slack thread or public archive page that loads without a login
SLACK_URL = os.environ["SLACK_URL"]
# Step 1: Wrap EnConvert Distill as a LangChain tool
@tool
def summarise_slack_thread(url: str) -> str:
"""Takes the URL of a Slack thread or public archive page and returns a summary of the conversation, including decisions and owners."""
response = requests.post(
"https://api.enconvert.com/v2/distill",
headers={
"X-API-Key": ENCONVERT_API_KEY,
"Content-Type": "application/json",
},
json={
"urls": [url],
"schema": {
"summary": (
"a thorough summary of the conversation, including every "
"decision made and who owns each action"
),
},
},
timeout=60,
)
response.raise_for_status()
# Distill reports per-URL failures inside a 200 response
item = response.json()["results"][0]
summary = (item.get("data") or {}).get("summary")
if item.get("error") or not summary:
raise RuntimeError(
f"Distill failed for {url}: {item.get('error') or 'no summary found'}"
)
return summary
# Step 2: Give the tool to a LangChain agent
agent = create_agent(
model=ChatOpenAI(model="gpt-5.5", api_key=os.environ["OPENAI_API_KEY"]),
tools=[summarise_slack_thread],
system_prompt=(
"You help teams recover decisions from Slack conversations. "
"Use the tool to read a thread before answering."
),
)
result = agent.invoke(
{
"messages": [
{
"role": "user",
"content": (
f"Summarise {SLACK_URL} and list the decisions made "
"and who owns each action."
),
}
]
}
)
print(result["messages"][-1].text)
What you get back
Distill returns the conversation thread as clean prose, with emoji reactions, member panels, navigation chrome, and read-status indicators stripped before the response comes back. The Slack API returns paginated JSON across the channels, messages, and replies endpoints, and that output needs assembly before it is useful. Fetching a shared Slack link as raw HTML returns the full page template with Slack UI chrome embedded in the text.