AgenTG is a pre-alpha Telegram client runtime for a personal agent.
It runs as a local developer stack: Telegram ingestion, Postgres, NATS, OpenTelemetry Collector, VictoriaMetrics, Jaeger, Grafana, NATS and Postgres exporters, gateway, and the Dashboard UI.
- Node.js and npm
- Docker with Compose
- Process Compose
- Telegram API credentials:
TELEGRAM_API_IDTELEGRAM_API_HASH
Set the Telegram credentials in your shell before running Telegram commands:
export TELEGRAM_API_ID=12345
export TELEGRAM_API_HASH=your_api_hashnpm install
brew install f1bonacc1/tap/process-composeRun the interactive auth command once before starting the dev stack:
npm run telegram:authThe command asks for the phone number, Telegram login code, email code when Telegram requests it, and 2FA password when enabled. Secret codes and passwords are not echoed back to the terminal.
TDLib session data is stored under td-data/ by default.
Start the full local stack:
npm run devThis command starts Postgres, NATS, OpenTelemetry Collector, VictoriaMetrics, Jaeger, Grafana, and the NATS and Postgres exporters through Docker Compose, runs database migrations, and starts the Telegram runtime, gateway, Dashboard server, and the Vite Dashboard app through Process Compose in detached mode. The Dashboard server owns the Telemetry page backend procedures.
After npm run dev:status shows dashboard as healthy, open:
Development observability UIs:
- Jaeger traces: http://127.0.0.1:16686/
- Grafana TDLib updates dashboard: http://127.0.0.1:3000/d/agentg-tdlib-updates/agentg-tdlib-updates
- Grafana Postgres dashboard: http://127.0.0.1:3000/d/agentg-postgres/agentg-postgres
- VictoriaMetrics VMUI: http://127.0.0.1:8428/vmui/
The Telegram RPC server listens on 127.0.0.1:8702. The Dashboard server
listens on 127.0.0.1:8789.
Manage the detached Process Compose app stack with:
npm run dev:status
npm run dev:attach
npm run dev:logs -- dashboard-server --tail 100
npm run dev:restart -- telegram
npm run dev:downnpm run dev:down stops app processes and leaves Docker-owned infrastructure
running.
Authenticate TDLib on the host first, because the Docker stack mounts the same
td-data/ directory:
npm run telegram:authPut Telegram credentials in .env or export them in the shell:
TELEGRAM_API_ID=12345
TELEGRAM_API_HASH=your_api_hashBuild and start the product stack:
docker compose --profile container-client --profile dashboard up --buildDocker Compose defaults AGENTG_TELEMETRY to 0. To run the same stack with
OpenTelemetry metrics, traces, NATS exporter metrics, and Postgres exporter
metrics enabled:
AGENTG_TELEMETRY=1 docker compose --profile telemetry --profile container-client --profile dashboard up --buildThis starts Postgres, NATS, OpenTelemetry Collector, VictoriaMetrics, Jaeger, Grafana, the NATS exporter, the Postgres exporter, Telegram ingestion, Gateway, and Dashboard. Open:
Gateway listens on 127.0.0.1:8787. Stop the stack with Ctrl+C, or from
another terminal:
docker compose --profile container-client --profile dashboard downnpm run db:recreate
npm run checknpm run db:recreate drops and recreates the local database from the current
generated schema.
npm run check runs typecheck, lint, source audit, formatting check, and tests.