Turn raw incident reports into structured Notion knowledge base entries — automatically.
Built with Python, Groq (Llama 3.3 70B), and Notion API. Runs entirely on free tools.
After a production incident, engineers are exhausted. Documentation gets skipped. Knowledge dies. The same mistakes get made again.
Paste your raw postmortem notes — the kind you'd write in Slack at 2am — and this tool does the rest:
- AI reads the messy text and extracts structured data
- A formatted Notion database entry gets created automatically
- Your KB builds itself over time into a searchable library of every incident your team has ever faced
$ python3 kb_builder.py
=== DevOps KB Auto-Builder ===
Paste your incident report below.
When done, press Enter then Ctrl+D
Database connection pool exhausted during peak traffic on March 20.
App servers couldn't get DB connections, causing 500 errors for 20 mins.
We increased pool size and restarted. Need connection monitoring.
^D
Extracting with Groq...
Title: DB Connection Pool Exhausted
Severity: High
Tags: database, connectionpool, performance
Creating Notion page...
Success! Page created: https://www.notion.so/DB-Connection-Pool-Exhausted-...Open Notion. The page is there. All fields populated. Zero manual work.
Raw incident text → Groq LLM → Structured JSON → Notion API → KB Entry
Three moving parts:
- Groq (Llama 3.3 70B) reads the raw text and extracts: title, root cause, fix applied, prevention steps, tags, and severity
- Notion API creates a structured database page with all fields mapped correctly
- python-dotenv keeps your secrets safe out of the code
| Property | Type |
|---|---|
| Name | Title |
| Root Cause | Text |
| Fix Applied | Text |
| Prevention | Text |
| Tags | Multi-select |
| Severity | Multi-select |
| Date | Date |
git clone https://github.com/nkydigitech/devops-kb-builder
cd devops-kb-builder
pip install -r requirements.txt- Groq API key — free at console.groq.com
- Notion token — create an internal integration at notion.so/my-integrations
- Notion database ID — query the API after connecting your integration (see full docs)
cp .env.example .env
nano .envGROQ_API_KEY=your_groq_key_here
NOTION_TOKEN=secret_your_token_here
NOTION_DATABASE_ID=your_database_id_herepython3 kb_builder.pyPaste your incident text, press Enter then Ctrl+D. Done.
| Tool | Role | Cost |
|---|---|---|
| Python 3.10 (WSL) | Runtime | Free |
| Groq API — Llama 3.3 70B | AI extraction | Free tier |
| Notion API | Knowledge base storage | Free |
| Notion MCP Integration | Workspace auth | Free |
| Aider | AI-assisted coding | Free |
Total cost: $0
- Slack bot watching
#incidents— auto-creates KB entries with zero manual steps - Weekly digest agent surfacing trending failure patterns from Notion
- Natural language queries: "show me all Critical database incidents this month"
- Full Notion MCP conversational access via Claude
Step by step setup guide, every error I hit, how I fixed them, and screenshots of the whole build:
DevOps KB Auto-Builder — Full Project Documentation
Notion MCP Challenge Submission
Built by @nkydigitech for the Notion MCP Challenge