Logo: Notion Ingest

Notion Ingest

Organisatioun
ai-analyst-lab
notion-ingest

Requires the Notion connector. Crawl a Notion workspace to extract business terms, metrics, product docs, and team structure into the organization knowledge system. Trigger on "/notion-ingest", "import our team's Notion docs", "sync our product roadmap from Notion", "pull in our metric definitions from Notion", "I have all our context in Notion, can you use it?". Handles full or partial crawls and incremental updates.

Iwwersiicht

Editeurai-analyst-lab
Repositoryai-analyst-plugin
Skill-Nummnotion-ingest
Stären
34
Forks
13
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    ai-analyst-lab huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Notion Ingest an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/ai-analyst-lab/ai-analyst-plugin/tree/main/ai-analyst-plus/skills/notion-ingest
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst-plugin.git /tmp/ai-analyst-plugin
mkdir -p .claude/skills
cp -r /tmp/ai-analyst-plugin/ai-analyst-plus/skills/notion-ingest .claude/skills/notion-ingest
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Notion Ingest an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Notion Ingest automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Notion Ingest net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

/notion-ingest — Notion Workspace Crawler

Requires the Notion connector enabled in Cowork.

Crawls a Notion workspace to extract business terms, metrics, product docs, and team structure. Populates the organization knowledge system.

Trigger

Invoked as /notion-ingest or /notion-ingest {workspace_url}

Prerequisites

  • Notion access: the Notion connector enabled in Cowork (preferred), or a Notion integration token configured in .knowledge/user/integrations.yaml under notion.token for the raw-API path
  • Organization directory exists at .knowledge/organizations/{org}/
  • If neither is available: "Notion is not connected. Enable the Notion connector in Cowork (run /setup-notion), or add an integration token to .knowledge/user/integrations.yaml under notion.token."

Overview

This skill uses a breadth-first crawl strategy to systematically traverse a Notion workspace, converting pages to structured knowledge entries. It does NOT require external Python packages — all Notion API calls use inline HTTP requests.

Execution Guidance

When running in an environment without actual Notion API access (e.g., for testing or evaluation):

  • EXECUTE a detailed simulation showing exactly what would happen step-by-step
  • Walk through the full 9-step workflow as if you had API access
  • Show example API requests and expected responses
  • Demonstrate classification logic on realistic page content
  • Create example output files showing the structure
  • Keep simulations concise: aim for 200-400 lines, not 1000+
  • Focus on 2-3 representative examples per category rather than exhaustive listings

The goal is to demonstrate you understand the workflow completely, not to produce encyclopedic output.

Step 1: Authentication Check

Preferred: the Notion connector. Try a test call to the connector's search tool (the Notion connector's search tool). If it works, use the connector's fetch/search tools for all Notion reads in the steps below; the crawl structure is unchanged, only the fetch mechanism differs.

Fallback: raw API with an integration token.

python
import yaml, os

# Load integration config
integrations_path = ".knowledge/user/integrations.yaml"
with open(integrations_path) as f:
    config = yaml.safe_load(f)

notion_token = config.get("notion", {}).get("token")
if not notion_token:
    print("No Notion connector and no token found. Run /setup-notion first.")
    # HALT

Verify the token works with a simple API call:

GET https://api.notion.com/v1/users/me
Authorization: Bearer {token}
Notion-Version: 2022-06-28

Step 2: Workspace Discovery

IMPORTANT: Always ASK the user for crawl scope — do not assume. Present these options clearly and wait for their choice:

Notion workspace connected. How would you like to crawl?

1. **Full workspace** — Crawl all accessible pages (may be slow for large workspaces)
2. **Specific database** — Provide a database URL to crawl
3. **Specific page tree** — Provide a root page URL to crawl its children
4. **Search by keyword** — Search for pages matching specific terms

If the user already specified a scope in their request (e.g., "crawl our OKR database at [URL]"), proceed with that scope. Otherwise, present the options and wait for their selection before proceeding.

Step 3: BFS Crawl Strategy

Algorithm: Breadth-First Search (BFS)

Queue ← [root_page_id]
Visited ← {}
Results ← []

WHILE Queue is not empty:
    page_id ← Queue.dequeue()
    IF page_id IN Visited: CONTINUE
    Visited.add(page_id)

    page ← fetch_page(page_id)        # GET /v1/pages/{id}
    children ← fetch_children(page_id) # GET /v1/blocks/{id}/children

    result ← convert_to_knowledge(page, children)
    Results.append(result)

    # Enqueue child pages and linked databases
    FOR child IN children:
        IF child.type == "child_page" OR child.type == "child_database":
            Queue.enqueue(child.id)

    rate_limit_pause()  # See Step 4

Page Fetch

GET https://api.notion.com/v1/pages/{page_id}
Authorization: Bearer {token}
Notion-Version: 2022-06-28

Block Children Fetch (paginated)

GET https://api.notion.com/v1/blocks/{block_id}/children?page_size=100
Authorization: Bearer {token}
Notion-Version: 2022-06-28

Handle pagination via has_more and next_cursor.

Step 4: Rate Limiting

Notion API limits: 3 requests per second for integration tokens.

python
import time

class RateLimiter:
    """Simple token-bucket rate limiter for Notion API."""

    def __init__(self, requests_per_second=2.5):
        self.min_interval = 1.0 / requests_per_second
        self.last_request = 0

    def wait(self):
        elapsed = time.time() - self.last_request
        if elapsed < self.min_interval:
            time.sleep(self.min_interval - elapsed)
        self.last_request = time.time()

Backoff strategy:

  • On 429 (rate limited): wait Retry-After header seconds, minimum 1s
  • On 5xx: exponential backoff (1s, 2s, 4s), max 3 retries
  • On 4xx (not 429): log error, skip page, continue crawl

Step 5: Page-to-Markdown Conversion

Convert Notion block types to markdown:

Notion Block TypeMarkdown Output
paragraphPlain text
heading_1# Title
heading_2## Title
heading_3### Title
bulleted_list_item- Item
numbered_list_item1. Item
code```lang\ncode\n```
quote> Quote
callout> ℹ️ Callout
tableMarkdown table
divider---
toggleTreat as heading + nested content
child_page[Page Title](notion://page_id)
child_database[Database Title](notion://db_id)

Rich text extraction:

  • Bold → **text**
  • Italic → *text*
  • Code → `text`
  • Links → [text](url)
  • Mentions → @{mention_name}

Step 6: Knowledge Extraction

For each crawled page, attempt to classify and extract structured knowledge:

Auto-Classification Rules

Page ContainsClassificationTarget File
Term definitions, glossary entriesGlossary termbusiness/glossary/terms.yaml
KPI, metric, formulaMetric definitionbusiness/metrics/index.yaml
Product name, feature listProduct entrybusiness/products/index.yaml
OKR, objective, key resultObjectivebusiness/objectives/index.yaml
Team name, org chartTeam entrybusiness/teams/index.yaml
SQL query, data patternQuery archaeology.knowledge/query-archaeology/raw/

Classification Heuristics

  • Glossary: Page title contains "glossary", "definitions", "terms", OR content has definition-like patterns ("X is defined as", "X means")
  • Metrics: Content contains "KPI", "metric", "formula", "calculated as", OR has numeric targets/thresholds
  • Products: Content contains "product", "feature", "roadmap", OR is in a database with product-like properties
  • Objectives: Content contains "OKR", "objective", "key result", "goal", "target", OR has quarterly references
  • Teams: Content contains "team", "squad", "org chart", OR has role/person properties

Raw Storage

All crawled pages are saved as raw markdown to:

.knowledge/query-archaeology/raw/notion_{page_id_short}.md

With YAML frontmatter:

yaml
---
source: notion
page_id: {full_page_id}
title: {page_title}
url: {page_url}
crawled_at: {timestamp}
classification: {auto_class or "unclassified"}
---

Step 7: Progress Reporting

During crawl, show progress updates periodically (every ~10-15 pages) to keep the user informed without overwhelming them:

🔄 Crawling Notion workspace...

  Pages crawled:    45/~120 (estimated)
  Terms extracted:  12
  Metrics found:    5
  Products found:   3
  Errors:           1 (skipped)

  Current: "Q4 2025 OKR Tracker"

For simulations: Show 2-3 progress snapshots (beginning, middle, end) rather than every single page. Focus on demonstrating the pattern, not exhaustive detail.

Step 8: Post-Crawl Summary

After crawl completes:

✅ Notion ingest complete!

  Pages crawled:     127
  Pages skipped:     3 (errors logged)

  Knowledge extracted:
    Glossary terms:  23 → business/glossary/terms.yaml
    Metrics:         8  → business/metrics/index.yaml
    Products:        5  → business/products/index.yaml
    Objectives:      12 → business/objectives/index.yaml
    Teams:           4  → business/teams/index.yaml

  Raw pages saved:   127 → .knowledge/query-archaeology/raw/

  Review extracted knowledge with `/business` to verify accuracy.
  Auto-classifications may need manual correction.

Step 9: Capture to Query Archaeology

For pages containing SQL queries or data patterns, create cookbook entries directly in the archaeology store. For each page with SQL content:

  1. Allocate the next entry id CK-{NNN} (scan .knowledge/query-archaeology/curated/cookbook/ for the highest existing number and increment)
  2. Write .knowledge/query-archaeology/curated/cookbook/{entry_id}.yaml with: id, title (the page title), description ("Reusable pattern: {title}"), sql (the extracted SQL), dataset, tables, tags (["notion-import", classification]), source_analysis ("notion:{page_id}"), created_at and last_used (today), use_count: 0
  3. Update the counts in .knowledge/query-archaeology/curated/index.yaml

Error Handling

ErrorResponse
Invalid token"Notion token is invalid or expired. Update in .knowledge/user/integrations.yaml."
Permission denied (403)"Cannot access page '{title}'. Check integration permissions in Notion."
Rate limited (429)Auto-retry with backoff (transparent to user)
Network errorRetry 3x, then skip page and continue
Empty workspace"No accessible pages found. Verify the integration has access to your workspace."
Large workspace (500+)"Large workspace detected (~{n} pages). This may take several minutes. Continue? [Y/n]"

Incremental Updates

For subsequent runs, support incremental mode:

/notion-ingest --incremental
  1. Read .knowledge/organizations/{org}/notion_sync_state.yaml for last sync timestamp
  2. Use Notion search API with filter.timestamp.last_edited_time.after parameter
  3. Only process pages modified since last sync
  4. Update sync state after completion

Reset

/notion-ingest reset — Clears all raw Notion pages and sync state. Does NOT remove extracted knowledge entries (those must be cleaned via /business or manually).

Heefeg gestallte Froen

Wat mécht de KI-Skill Notion Ingest?

Requires the Notion connector. Crawl a Notion workspace to extract business terms, metrics, product docs, and team structure into the organization knowledge system. Trigger on "/notion-ingest", "import our team's Notion docs", "sync our product roadmap from Notion", "pull in our metric definitions from Notion", "I have all our context in Notion, can you use it?". Handles full or partial crawls and incremental updates.

Firwat Notion Ingest op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Notion Ingest besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Notion Ingest an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/ai-analyst-lab/ai-analyst-plugin/tree/main/ai-analyst-plus/skills/notion-ingest an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Notion Ingest benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Notion Ingest benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Notion Ingest domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Notion Ingest gratis?

Jo. ai-analyst-lab huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇