Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevOps KB Auto-Builder

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.


The Problem

After a production incident, engineers are exhausted. Documentation gets skipped. Knowledge dies. The same mistakes get made again.

The Solution

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

Demo

$ 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.


How It Works

Raw incident text → Groq LLM → Structured JSON → Notion API → KB Entry

Three moving parts:

  1. Groq (Llama 3.3 70B) reads the raw text and extracts: title, root cause, fix applied, prevention steps, tags, and severity
  2. Notion API creates a structured database page with all fields mapped correctly
  3. python-dotenv keeps your secrets safe out of the code

Notion Database Schema

Property Type
Name Title
Root Cause Text
Fix Applied Text
Prevention Text
Tags Multi-select
Severity Multi-select
Date Date

Setup

1. Clone the repo

git clone https://github.com/nkydigitech/devops-kb-builder
cd devops-kb-builder
pip install -r requirements.txt

2. Get your keys

  • 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)

3. Configure

cp .env.example .env
nano .env
GROQ_API_KEY=your_groq_key_here
NOTION_TOKEN=secret_your_token_here
NOTION_DATABASE_ID=your_database_id_here

4. Run

python3 kb_builder.py

Paste your incident text, press Enter then Ctrl+D. Done.


Stack

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


What I Would Build Next

  • 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

Full Documentation

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


DEV.to Submission

Notion MCP Challenge Submission


Built by @nkydigitech for the Notion MCP Challenge

About

Turn raw incident reports into structured Notion knowledge base entries — automatically. Built with Python, Groq (Llama 3.3 70B), and Notion API.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages