Problem
AI integrations become difficult to operate when teams cannot answer basic questions: which channel received the request, which model handled it, which evidence was used, how long it took and what failed.
Telegram used as a secondary operational channel to test a backend while preserving traces, metrics and error visibility.
AI integrations become difficult to operate when teams cannot answer basic questions: which channel received the request, which model handled it, which evidence was used, how long it took and what failed.
A trace is an execution record. It connects a request to the model, retrieval status, latency, token counts and errors. A trace_id is the identifier used to follow that execution across components.
Tokens are small pieces of text processed by the model. Tracking input and output tokens helps estimate cost, latency and model workload. Latency is the time the system takes to return a response.
JSONL means one JSON record per line. It is a simple local format for storing many execution records without needing a database or external monitoring service.
Keep Telegram as a channel adapter, not as the core system. Telegram messages pass through bot logic into the backend, and the backend handles retrieval, provider calls, response generation and trace writing.
account_tree Telegram message -> bot service -> backend API -> optional RAG -> LLM provider -> response -> JSONL trace.
{
"trace_id": "trc_public_demo_ok_001",
"source": "telegram",
"provider": "ollama",
"retrieval_status": "evidence_found",
"tokens_input": 1210,
"tokens_output": 286,
"latency_ms": 1730,
"status": "ok"
}
Ability to connect AI behavior to operational evidence: channel, model, retrieval status, token workload, latency and error state. No real user identifiers, chat identifiers, user text, tokens or logs are published.
FastAPI, Telegram Bot API, JSON/JSONL traces, local model providers, synthetic examples and deterministic evaluation scripts.