How gefolgwar/kolobot works
Kolobot is a Telegram-first document-processing and warehouse system with an embedded web dashboard. A user submits a photo, PDF, or document; intake stores and registers it, then a background queue runs OCR and structuring, archives the result, updates inventory, and returns a chat card. Users can also search the archive with natural-language RAG, import/export stock through Excel, and review or edit records in the web UI. The graph combines README-described workflows with shown source references; unsampled route and M-11 internals are represented cautiously.
Main entry points: queue_service.py Background queue · routes Dashboard routes · handlers Bot handlers · warehouse_db.py Warehouse records
Components 22
Telegram workflows
- Bot handlers
kolobot/handlers - Document intake
kolobot/intake_service.py - Result cards
kolobot/card_view.py - Semantic search
kolobot/rag_service.py - Source delivery
kolobot/archive_delivery.py
Document processing
- Background queue
kolobot/queue_service.py - OCR structuring
kolobot/doc_structurer.py - Gemini services
kolobot/gemini_gateway.py
Archive and inventory
- Document archive
kolobot/archive_service.py - Original files
kolobot/file_store.py - Vector archive
kolobot/vector_store.py - Warehouse records
kolobot/warehouse_db.py - Stock updates
kolobot/warehouse_writer.py - M-11 matching
kolobot/m11_matcher.py
Web management
- HTTP server
kolobot/web/server.py - Route discovery
kolobot/web/router.py - Dashboard routes
kolobot/web/routes - Excel import/export
kolobot/excel_service.py
Shared services
- Gemini key pools
kolobot/key_pool.py - Live log buffer
kolobot/log_service.py
Other components
- Telegram user
- Web user
Connections 29
- Telegram user → Bot handlers: submits documents
- Bot handlers → Document intake: registers files
kolobot/handlers/context.py - Document intake → Original files: stores originals
kolobot/intake_service.py - Document intake → Warehouse records: registers queued
kolobot/intake_service.py - Bot handlers → Background queue: enqueues documents
kolobot/handlers/context.py - Background queue → OCR structuring: structures documents
kolobot/queue_service.py - Background queue → Gemini services: requests recognition
kolobot/queue_service.py - Background queue → Document archive: saves results
- Background queue → Stock updates: updates stock
kolobot/handlers/cards.py - Background queue → Result cards: returns result card
kolobot/main.py - Document archive → Gemini services: creates embeddings
kolobot/archive_service.py - Document archive → Vector archive: stores archive entry
kolobot/archive_service.py - Document archive → Original files: promotes original
kolobot/archive_service.py - Bot handlers → Semantic search: answers questions
kolobot/handlers/context.py - Semantic search → Gemini services: embeds and answers
kolobot/rag_service.py - Semantic search → Vector archive: queries documents
kolobot/rag_service.py - Bot handlers → Source delivery: delivers sources
kolobot/handlers/query.py - Web user → HTTP server: opens dashboard
- HTTP server → Route discovery: discovers routes
kolobot/web/server.py - Route discovery → Dashboard routes: registers handlers
kolobot/web/router.py - Dashboard routes → Warehouse records: manages records
kolobot/web/routes/items.py - Dashboard routes → Excel import/export: handles spreadsheets
kolobot/web/routes/excel.py - Excel import/export → Warehouse records: imports and exports stock
- Dashboard routes → Original files: serves document files
kolobot/web/routes/document_files.py - Dashboard routes → Background queue: retries processing
- Dashboard routes → Live log buffer: streams logs
- Stock updates → Warehouse records: records transactions
kolobot/warehouse_writer.py - Gemini services → Gemini key pools: rotates API keys
kolobot/gemini_gateway.py - Warehouse records → M-11 matching: matches documents