How to Summarise GitHub Issues with CrewAI

GitHub Issues summarisation in CrewAI: use EnConvert Distill to return schema-defined fields from up to 50 issue URLs in one synchronous call, no HTML parsing

Get API key

A CrewAI agent that reads GitHub Issues needs clean, structured content before it can reason about severity, ownership, or resolution. Issue pages combine the report body with labels, comments, assignee metadata, and event history, so custom selectors break whenever GitHub changes its markup. EnConvert Distill takes the issue URL, applies the schema your agent defines, and returns matching fields in a single synchronous call. The result is structured content ready for downstream LLM reasoning with no HTML parsing.

Example

python
import os

import requests
from crewai import Agent, Crew, Process, Task
from crewai.tools import tool

ENCONVERT_API_KEY = os.environ["ENCONVERT_API_KEY"]
# CrewAI reads OPENAI_API_KEY from the environment for the gpt-4.1 model

ISSUE_SCHEMA = {
    "title": "The issue title",
    "body_summary": "A concise summary of the issue description and reported problem",
    "labels": "The labels applied to the issue",
    "status": "Whether the issue is open or closed",
    "author": "The username that opened the issue",
    "comment_summary": "A short summary of the comment thread and any stated resolution",
}

@tool("summarise_github_issue")
def summarise_github_issue(issue_url: str) -> str:
    """Summarise a GitHub Issue into schema-defined fields using EnConvert Distill."""
    response = requests.post(
        "https://api.enconvert.com/v2/distill",
        headers={
            "X-API-Key": ENCONVERT_API_KEY,
            "Content-Type": "application/json",
        },
        json={"urls": [issue_url], "schema": ISSUE_SCHEMA},
        timeout=60,
    )

    if response.status_code == 402:
        raise RuntimeError("Distill requires a paid plan. Free tier returns 402.")

    response.raise_for_status()
    result = response.json()["results"][0]

    if result["status"] != "completed":
        return f"Distill could not process {result['url']} (status: {result['status']})"

    if result.get("render_quality", 1.0) < 0.5:
        return f"Low render quality ({result['render_quality']}) for {result['url']} — may be a login wall"

    data = result["data"]  # keys match ISSUE_SCHEMA exactly
    labels = data["labels"]
    return (
        f"Title: {data['title']}\n"
        f"Status: {data['status']}\n"
        f"Author: {data['author']}\n"
        f"Labels: {', '.join(labels) if isinstance(labels, list) else labels}\n"
        f"Summary: {data['body_summary']}\n"
        f"Comments: {data['comment_summary']}"
    )

analyst = Agent(
    role="GitHub Issue Analyst",
    goal="Read GitHub issues and summarise the reported problem, status, and resolution",
    backstory="You read issue threads closely and cite the issue behind every statement.",
    tools=[summarise_github_issue],
    llm="gpt-4.1",
    verbose=True,
)

task = Task(
    description=(
        "Use summarise_github_issue on https://github.com/langchain-ai/langchain/issues/2303 "
        "and return a short report covering the reported problem, labels, status, and any resolution."
    ),
    expected_output="A concise issue summary with the reported problem, labels, status, and any resolution.",
    agent=analyst,
)

crew = Crew(
    agents=[analyst],
    tasks=[task],
    process=Process.sequential,
    verbose=True,
)
print(crew.kickoff())

What you get back

Distill returns the schema-defined fields inline as structured JSON in the data object, with no polling, no job_id, and no signed URL to fetch. The render_quality score lets the agent detect a login wall or challenge page before reasoning over incomplete content. Scraping GitHub Issues directly returns HTML with label badges, timeline events, and comment threads embedded throughout, and a dedicated parser needs CSS selectors that break when GitHub changes its layout.

Get free API key — 500 ops per month, no card required. Note: Distill runs on paid plans. Free tier returns 402.