---
title: "Summarise Medium Articles with AutoGen — EnConvert API"
description: "Use EnConvert Distill to summarise Medium articles in one API call and pass clean, LLM-ready output directly into an AutoGen pipeline or memory layer."
canonical: "https://www.enconvert.com/solutions/summarise-medium-articles-with-autogen-enconvert-api"
locale: "en"
---

# How to Summarise Medium Articles with AutoGen

If you are building an AutoGen agent that reads Medium articles, you need the article content, not everything Medium wraps around it. Medium pages include author bios, related article carousels, clap counts, comment sections, publication metadata, and membership prompts that inflate token usage and pull agent context toward noise rather than the article itself. Writing your own extraction and summarisation logic works until Medium updates its page structure, at which point your pipeline breaks silently and returns degraded output with no error signal. EnConvert’s Distill endpoint takes a Medium URL and returns a clean, concise summary of the article content, ready to pass into an AutoGen agent as context or store in a memory layer.

## Example

```python
import asyncio
import os

import requests
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient

ENCONVERT_API_KEY = os.environ["ENCONVERT_API_KEY"]
MEDIUM_URL = os.environ["MEDIUM_URL"]  # a public Medium article URL

# Step 1: Summarise the Medium article with Enconvert Distill
response = requests.post(
    "https://api.enconvert.com/v2/distill",
    headers={
        "X-API-Key": ENCONVERT_API_KEY,
        "Content-Type": "application/json",
    },
    json={
        "urls": [MEDIUM_URL],
        "schema": {
            "summary": (
                "a thorough summary of the article, including its main "
                "argument and any key recommendations it makes"
            ),
        },
    },
    timeout=60,
)
response.raise_for_status()

item = response.json()["results"][0]
if item.get("error") or not item.get("data"):
    raise RuntimeError(f"Distill failed for {MEDIUM_URL}: {item.get('error')}")
summary = item["data"]["summary"]


# Step 2: Pass the summary into an AutoGen agent as context
async def main() -> None:
    model_client = OpenAIChatCompletionClient(
        model="gpt-4.1",
        api_key=os.environ["OPENAI_API_KEY"],
    )
    agent = AssistantAgent(
        name="medium_article_assistant",
        model_client=model_client,
        system_message=(
            "Answer questions using the supplied Medium article summary. "
            "If the summary does not contain the answer, say so."
        ),
    )
    task = (
        "Use this article summary as context:\n\n"
        f"{summary}\n\n"
        "Explain the article's main argument and list its key recommendations."
    )
    await Console(agent.run_stream(task=task))
    await model_client.close()


if __name__ == "__main__":
    asyncio.run(main())
```

## Output

Distill returns the Medium article as a clean summary: the core content condensed into coherent paragraphs or structured points, with author bios, related article links, clap counts, comment sections, membership prompts, and publication metadata removed before the response is returned. Passing raw Medium page content into an AutoGen agent context instead produces bloated token usage from surrounding noise, inconsistent output structure across articles from different publications, and a higher probability of the agent reasoning over promotional or navigational content rather than the article itself. The difference is most visible when running agents across multiple articles where token budgets and context consistency both affect output quality.

## Get started

[Get free API key — 500 ops per month, no card required.](https://www.enconvert.com/auth?mode=signup)

## Related solutions

- [How to Summarise Notion Pages with Claude Code](https://www.enconvert.com/solutions/summarise-notion-pages-in-claude-code-enconvert-api.md)
- [How to Summarise Substack Newsletters with LangChain](https://www.enconvert.com/solutions/summarise-substack-newsletters-with-langchain-enconvert.md)
- [How to Summarise Wikipedia Articles with LlamaIndex](https://www.enconvert.com/solutions/summarise-wikipedia-articles-with-llamaindex-enconvert-api.md)
- [Best Firecrawl Alternative for RAG Pipeline Ingestion](https://www.enconvert.com/solutions/best-firecrawl-alternative-enconvert-api.md)
- [How to Scrape Jira with AutoGen](https://www.enconvert.com/solutions/scrape-jira-with-autogen-enconvert-api.md)
- [How to Scrape Stripe Docs with OpenAI Agents SDK](https://www.enconvert.com/solutions/scrape-stripe-docs-with-openai-agents-sdk-enconvert-api.md)
