{"id":28712506,"url":"https://github.com/rootly-ai-labs/incidentdiagram","last_synced_at":"2025-06-14T23:06:22.955Z","repository":{"id":280008407,"uuid":"939699509","full_name":"Rootly-AI-Labs/IncidentDiagram","owner":"Rootly-AI-Labs","description":"A tool for creating diagrams from Incident Reviews/PostMortems using LLMs and AI","archived":false,"fork":false,"pushed_at":"2025-04-09T18:02:46.000Z","size":337,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-09T18:53:04.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rootly-AI-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T00:44:52.000Z","updated_at":"2025-04-09T18:02:52.000Z","dependencies_parsed_at":"2025-02-28T21:59:25.360Z","dependency_job_id":"e2df1a76-448f-4a45-abef-9b9af2a6780f","html_url":"https://github.com/Rootly-AI-Labs/IncidentDiagram","commit_stats":null,"previous_names":["rootly-ai-lab/incidentdiagram","rootly-ai-labs/incidentdiagram"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rootly-AI-Labs/IncidentDiagram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rootly-AI-Labs%2FIncidentDiagram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rootly-AI-Labs%2FIncidentDiagram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rootly-AI-Labs%2FIncidentDiagram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rootly-AI-Labs%2FIncidentDiagram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rootly-AI-Labs","download_url":"https://codeload.github.com/Rootly-AI-Labs/IncidentDiagram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rootly-AI-Labs%2FIncidentDiagram/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259896237,"owners_count":22928332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-14T23:06:22.029Z","updated_at":"2025-06-14T23:06:22.937Z","avatar_url":"https://github.com/Rootly-AI-Labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eIncident Diagram 🗾\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/OpenAI_Compatible-Compatible?style=flat-square\u0026logo=openai\u0026labelColor=black\u0026color=white\" alt=\"OpenAI logo\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Gemini_Compatible-Compatible?style=flat-square\u0026logo=googlegemini\u0026labelColor=black\u0026color=%238E75B2\" alt=\"Gemini logo\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Anthropic_Compatible-Compatible?style=flat-square\u0026logo=anthropic\u0026labelColor=black\u0026color=white\" alt=\"Anthropic logo\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/smolagents-Compatible?style=flat-square\u0026logo=huggingface\u0026logoColor=%23FF9D00\u0026labelColor=%23FFD21E\u0026color=white\" alt=\"Huggingface logo\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Made%20by%20-%20Rootly%20AI%20Lab-blue?style=flat-square\" alt=\"Made by Rootly AI Lab\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Project_episode-video?style=flat-square\u0026logo=youtube\u0026logoColor=%23FF0000\u0026color=white\" alt=\"YouTube\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\nGenerates a diagram highlighting what happened during an incident by ingesting the retrospective and associated codebase. LLM-powered.\n\n```\n$ incidentdiagram -f example_incident.txt  -u https://github.com/user/impactedcodebase\n.\nChart generated in artifacts/incident.md\n```\n\n\u003cdiv align=\"center\"\u003e\n   \u003cimg src=\"images/incidentdiagramexample.png\" alt=\"Diagram generated using IncidentDiagram\"\u003e\n\u003c/div\u003e\n\nIn the fictional scenario illustrated above, the diagram shows an outage affecting a blog. A developer introduced a new feature to verify disk space before image uploads, but mistakenly set the requirement to 500GB. Production servers did not have this amount of available space, preventing the blog admin from uploading images to new posts and readers from adding images to their comments.\n\n## Requirements 📋\n* `.env` file with OpenAPI/Gemini/Anthropic API Key (at least one)\n* Python \u003e 3.10\n\n## Getting started 🚀\n```\npython -m venv .venv\nsource .venv/bin/activate\npip install .\ncp .example.env .env # Add api keys to .env after copying\nincidentdiagram -f example_incident.txt  -u https://github.com/Rootly-AI-Labs/EventOrOutage\n```\nThe example above uses an incident that goes along with the app `https://github.com/Rootly-AI-Labs/EventOrOutage` and a fictive incident retrospective in  `example_incident.txt`.\n\n## How it works\nIncidentDiagram process works in 3 main steps:\n\n 1. Understand the impacted codebase, the file structure, and the code within the files to generate a description of components and their relationships. Returned in JSON format.\n 2. Understand postmortem/incident retrospective and provide a list of components that were affected, matching the components of the codebase. Returned in JSON format.\n 3. Create a diagram(mermaid.js) showing the components and their relationships, highlighting the components the incident affected. Returned in a MD format.\n\n[![YouTube video explaining the project](images/youtube-video.png)](https://www.youtube.com/watch?v=vsqnxa0UFJw)\n\nAll of these steps are done by prompting LLMs\n## Examples 📖\nHere are a few ways you can use IncidentDiagram:\n* `incidentdiagram -f incident.txt  -u https://github.com/Rootly-AI-Labs/EventOrOutage` – will download the code from github and generate a diagram based on the incident summary in incident.txt\n* `incidentdiagram -f incident.txt  -u https://github.com/Rootly-AI-Labs/EventOrOutage/tree/main -m gpt-4o` – Use a different model\n* `incidentdiagram -iu www.postmortems.com/1345  -u https://github.com/Rootly-AI-Labs/EventOrOutage -m claude-3.5` – Download the incident summary from a URL and generate a diagram\n\n## Stack 🛠️\n-   **LLMs:** [Open AI LLMs](https://platform.openai.com/docs/api-reference/models), [Anthropic LLMs](https://docs.anthropic.com/en/api/models-list), [Gemini LLMs](https://ai.google.dev/api/models).\n-   **Agent:** HuggingFace smolagents\n-   **Data Sources:** External APIs for holidays, news, and event tracking\n\n## Notes \u0026 Future Improvements\n- Ability to handle a large application code base\n- Ability to ingest multiple code bases and IaC files\n- Add ollama models\n\nThis is a prototype meant to demonstrate how LLM can have a positive impact on SRE teams and is not meant to be used in production.\n\n## Backstory for this prototype\nExplaining an outage can be challenging, especially for complex incidents in distributed systems, which have become the norm. People also have different preferences for how information is presented, and often, a visual representation is worth a thousand words. However, manually creating application and infrastructure diagrams is time-consuming, making it impractical to do so for every incident. That's why we believe **Incident Diagram** could be a valuable tool for SREs and on-call practitioners, helping them quickly visualize and understand what went wrong.\n\n## About the Rootly AI Labs\nThis project was developed by the [Rootly AI Labs](https://labs.rootly.ai/). The AI Labs is building the future of system reliability and operational excellence. We operate as an open-source incubator, sharing ideas, experimenting, and rapidly prototyping. We're committed to ensuring our research benefits the entire community.\n![Rootly AI logo](https://github.com/Rootly-AI-Labs/EventOrOutage/raw/main/rootly-ai.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootly-ai-labs%2Fincidentdiagram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootly-ai-labs%2Fincidentdiagram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootly-ai-labs%2Fincidentdiagram/lists"}