Skip to content

Case Study: Self-Writing Community Wiki via Telegram Bot

Case Study: Self-Writing Community Wiki via Telegram Bot

TL;DR: A Telegram bot reads all community messages, extracts knowledge using LLM, and builds a self-maintaining wiki. Members can query “who knows about X?” and get answers with clickable links to experts. Zero manual maintenance.

The Problem

Two Russian-speaking communities (“Meshok” and “Research Mastermind”) faced severe information overload:

  • Mastermind sessions with valuable presentations
  • “Useful calls” discussing strategies
  • Hundreds of daily messages with GitHub links, tool recommendations, implementation stories
  • Finding experts impossible — thousands of messages to search through

“How do you not drown in this flood of information?”

The Solution

A Telegram bot that implements the LLM Wiki Pattern:

Chat messages → LLM processing → Structured wiki → Queryable knowledge

Key insight: “A wiki reference book for the community that writes itself.”

How It Works

The Bot (“ZK Steward” Agent)

Lives 24/7 in the chat and:

  1. Reads every message
  2. Processes through LLM (Gemini)
  3. Extracts useful content:
    • Who talked about what topic
    • What tools were recommended
    • What experiences were described
  4. Organizes into structured wiki:
    • Participant profiles
    • Projects
    • Tools
    • Extracted knowledge

Multi-Source Ingestion

The bot doesn’t just read chat — it also watches YouTube recordings:

  1. Downloads audio via yt-dlp
  2. Transcribes via GigaAM (Russian-optimized speech model)
  3. Segments by speakers using pyannote
  4. Adds to the same knowledge base

Two sources, one unified wiki.

User Experience

User: @bot Who has experience with free traffic strategies?
Bot: Several members have discussed this:
• @AlexK implemented SEO automation for his SaaS — got 2x traffic in 3 months
• @MariaP shared her content repurposing workflow on last week's mastermind
• @DimitriV recommended using Perplexity for competitor research
[Names are clickable Telegram links — message them directly]

Technical Architecture

ComponentPurpose
aiogramTelegram bot framework
GeminiLLM for knowledge extraction and Q&A
GigaAMRussian speech-to-text model
pyannoteSpeaker diarization (who said what)
yt-dlp + FFmpegYouTube audio download
Markdown filesWiki storage (Zettelkasten format)
VPSHosting

Workflow

┌─────────────────────────────────────────────────┐
│ INGESTION │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Chat msgs │ │ YouTube │ │
│ │ (real-time) │ │ recordings │ │
│ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ Message logs (accumulate) │ │
│ └──────────────┬──────────────────┘ │
│ │ Every few hours │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ LLM batch processing (Gemini) │ │
│ └──────────────┬──────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ Wiki files (Markdown/Zettel) │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ QUERY │
│ ┌─────────────┐ │
│ │ User asks │ │
│ │ question │ │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ Gather context from wiki │ │
│ └──────────────┬──────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────┐ │
│ │ LLM generates answer │ │
│ │ (with profile links) │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────────────────┘

Key Implementation Details

Anti-Recursion Pattern

Problem: Bot writes messages to chat. If it indexed its own responses:

  • Respond → index → process as new knowledge → update wiki → respond to changes → infinite loop

Solution: Mark every bot message with a signature that the indexer skips.

This is a critical pattern for any self-referential system.

Access Control

  • Each community has its own separate wiki
  • “Mastermind” members → Mastermind wiki only
  • “Meshok” members → Both wikis
  • Proper data segregation

Zettelkasten Structure

Uses glossary/zettelkasten methodology:

  • Each knowledge unit is a connected note
  • Notes link to related notes
  • Emerges into a networked knowledge graph

Why This Works

Traditional CommunityThis Approach
Knowledge lost in chat scrollKnowledge permanently captured
Finding experts = manual searchFinding experts = ask the bot
New members start from zeroNew members query accumulated wisdom
Valuable discussions forgottenDiscussions become wiki entries
Maintenance = human effortMaintenance = zero

Business Applications

This pattern applies to:

  • Company Slack/Teams — Internal knowledge base that writes itself
  • Customer communities — Searchable support knowledge
  • Professional networks — Expert finder
  • Research groups — Literature and discussion synthesis

Lessons Learned

  1. Batch processing works — Don’t process every message immediately; accumulate and batch
  2. Anti-recursion is critical — Mark bot outputs to prevent loops
  3. Multiple sources are powerful — Chat + video creates richer knowledge
  4. Clickable links = action — Connecting knowledge to people enables follow-up
  5. Separate bases for access control — One bot, multiple isolated wikis

Connection to LLM Wiki Pattern

This is the glossary/llm-wiki-pattern in production:

  • Raw sources = chat messages + YouTube
  • Wiki = Zettelkasten markdown files
  • Schema = bot’s extraction logic
  • Operations = ingest (continuous), query (on-demand)

The creator explicitly credits Andrej Karpathy’s LLM Knowledge Base as inspiration.

Key Takeaways

  • Community knowledge can be automatically captured and structured
  • Multi-source ingestion (chat + video) creates comprehensive knowledge
  • Anti-recursion is a critical implementation detail
  • The wiki writes itself — zero manual maintenance
  • People links make knowledge actionable

Sources

  • Community post describing the implementation — Telegram channel