Skip to content

feat: index aiogram, python-telegram-bot and grammY documentation - #1

Merged
Kay0k1 merged 3 commits into
mainfrom
feat/library-docs
Nov 10, 2026
Merged

Kay0k1 merged 3 commits into
mainfrom
feat/library-docs

Conversation

@Kay0k1

@Kay0k1 Kay0k1 commented Nov 10, 2026

Copy link
Copy Markdown
Owner

What

Agents most often break bot code at the library level, and the server indexed none of the library docs. This adds the official docs of the three most-used bot libraries:

Library Entry point Version described Pages
aiogram 3 https://docs.aiogram.dev/en/latest/ 3.31.0 (latest is built from the main branch; aiogram's stable alias redirects to it) 55
python-telegram-bot https://docs.python-telegram-bot.org/en/stable/ + official wiki (_Sidebar.md) v22.8 (stable = release tag) 85 docs + 43 wiki
grammY https://grammy.dev/sitemap.xml → Markdown sources in grammyjs/website current site 68 + sitemap index

About 250 pages in total, next to 6,600+ core pages in a full corpus. A real crawl of all of them took 58 s.

Left out on purpose: generated per-type pages that mirror the Bot API (aiogram api/types, api/methods, api/enums, the api/ TOC with 916k characters; PTB telegram.<Type>, ~300 pages; grammY /ref/, ~880 pages), translations, contributor pages. Not added: Telegraf (last release v4.16.3, Feb 2024), Telethon and Pyrogram (GitHub repos archived), TON Connect SDK reference (TypeDoc; TON Connect is already covered through docs.ton.org).

How

  • library_path() holds a strict boundary per host: no query strings, assets, _modules/_static/_sources, other languages or repos. telegram.ext. is matched with the dot, so telegram.externalreplyinfo stays out.
  • Markdown where it exists (grammY site sources, PTB wiki) through fetch_location(), cited by human URLs — the same pattern as TON. GitHub wiki [[Title|Page]] links are resolved.
  • INDEX_ONLY: the grammY sitemap and the PTB wiki sidebar feed discovery but get no search chunks (their URL lists would match everything).
  • Sphinx pages: links also come from the sidebar table of contents (otherwise 5 PTB pages, including the changelog, were unreachable); heading anchors and [source] links are stripped.
  • Released versions (/en/vX.Y.Z/) can be read on demand to match an installed version and are never added to the frontier.
  • Search areas aiogram, python-telegram-bot, grammy — per library, because the agent knows which library the project uses and Python and TypeScript snippets should not mix. Core Telegram docs rank first unless the query names a library (aiogram, PTB, python-telegram-bot, telegram.ext, grammY, optionally with a version). The name is removed from the full-text terms, because most chunks never repeat it.
  • Skill: new references/bot-libraries.md (installed version first, pinned docs, compare with the Bot API page and changelog, say when versions differ) and a row in SKILL.md.

Checks

  • uv run --frozen python -m unittest discover -s tests -v: 70 passed (15 new in tests/test_libraries.py).
  • Real crawl into a temp DB: every in-scope aiogram (55/55) and PTB (85/85) page compared with each site's searchindex.js; 3 PTB wiki links are 404 on GitHub itself.
  • scripts/check_sources.py on the four new entry points: healthy.
  • Search: aiogram 3 callback query handler → dispatcher/router.html § Callback query; PTB ConversationHandler → telegram.ext.conversationhandler.html; grammY inline keyboard → plugins/keyboard; inline keyboard, answerCallbackQuery, webhook → only Bot API / Bot FAQ in the top five. Details in docs/validation.md.

Worth a look

  • With 61 seeds, the default 120-page budget is below 2 × len(SEEDS), so maintenance_tick() now takes the round-robin _fair_maintenance path by default (the same path small budgets already used).
  • README/CHANGELOG edits are small and local; another branch (evals) also edits them.

🤖 Generated with Claude Code

Kay0k1 and others added 3 commits November 10, 2026 17:55
Add the guides and bot-facing references of the three most-used bot
libraries: aiogram (docs.aiogram.dev/en/latest), python-telegram-bot
(docs.python-telegram-bot.org/en/stable and the official wiki) and grammY
(grammy.dev, read from the site's Markdown sources). Generated per-type
pages that mirror the Bot API, grammY's /ref/ and translations stay out.

- library_path() sets a strict boundary per host; released versions
  (/en/vX.Y.Z/) are readable on demand and never queued for crawling
- the grammY sitemap and the PTB wiki sidebar feed discovery only
- search areas aiogram, python-telegram-bot and grammy; core Telegram
  docs rank first unless the query names a library
- skill guide bot-libraries.md: match the installed version and compare
  with the Bot API page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kay0k1
Kay0k1 merged commit da8153c into main Nov 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant