Automated market briefings for Telegram, built for production reliability.
Ingest curated news feeds and market data, score and select high-signal items, generate structured updates with an LLM, validate output, and publish on schedule across multiple streams.
Warning
TELEGRAM_BOT_TOKEN, OPENROUTER_API_KEY, and DATABASE_URL are secrets.
Keep them in .env only. Never commit .env.
- What Argus does
- Architecture
- Run modes
- Quick start
- Command reference
- Configuration
- Telegram control plane
- Debugging and QA
- Production operations
- Development
- Repository layout
- Documentation
- Security notes
- License
- Multi-stream execution (for example
us_markets,crypto). - End-to-end pipeline:
ingest -> score -> enrich -> bundle -> generate -> validate -> publish. - Pluggable providers per stage (
rssorapi_newsapi, multiple scoring versions,telegramornullpublisher). - DB-backed broadcast fanout for per-stream Telegram subscriptions.
- Long-running daemon scheduler with health endpoints and job history.
Feeds/APIs -> Ingestion -> Scoring -> Enrichment -> Facts Bundle -> LLM Generate -> Validator -> Publisher
\___________________________________________________________/
PostgreSQL persistence
Core runtime path:
- CLI entrypoint:
src/argus/cli.py - Config loading:
src/argus/config.py - Orchestration:
src/argus/orchestrator/orchestrator.py - Stage provider registry:
src/argus/pipeline/registry.py - Facts bundle builders:
src/argus/facts_bundle/builder.py(US markets)src/argus/facts_bundle/crypto_builder.py(crypto)
| Mode | Primary use | Window | Typical daemon schedule |
|---|---|---|---|
us_close |
Daily US close recap | 24h | Tue-Fri, SGT |
weekend_wrap |
Weekly wrap | 120h | Saturday, SGT |
monday_preview |
Risk-gated week-ahead preview | 120h | Sunday, New York |
crypto_daily |
Daily crypto recap | 24h | Daily, UTC |
monday_preview supports conditional publish using risk_score from calendar + market + headline components.
Windows (PowerShell):
copy .env.example .env
notepad .env
pip install -e ".[dev]"
argus --version
argus smokeLinux/macOS:
cp .env.example .env
$EDITOR .env
pip install -e ".[dev]"
argus --version
argus smokeargus run --stream us_markets --mode us_close --dry-run
argus run --stream us_markets --mode us_close --skip-publish --print-messageargus db migrate
argus run --stream us_markets --mode us_closeargus run --stream us_markets --mode us_close
argus run --stream us_markets --mode monday_preview --conditional
argus run --stream crypto --mode crypto_dailyargus ingest --stream us_markets
argus score --stream us_markets --window-hours 24
argus enrich --stream us_markets --window-hours 24
argus bundle --mode us_close --output bundle.json --dry-run
argus generate --bundle-file bundle.json --output message.txt
argus publish --file message.txt --dry-runargus daemon start
argus daemon status
argus daemon trigger ingest:crypto
argus daemon history crypto_daily:cryptoargus db status
argus calendar status
argus newsapi sources --categories business
argus show --run-id 15Argus reads:
.envfor secrets and deployment-specific values.config.yamlfor streams, schedules, providers, constraints, and daemon behavior.
| Variable | Purpose |
|---|---|
TELEGRAM_BOT_TOKEN |
Bot token from @BotFather |
TELEGRAM_CHAT_ID |
Legacy fallback destination when stream subscriptions are empty |
DATABASE_URL |
PostgreSQL connection string |
OPENROUTER_API_KEY |
LLM generation key |
| Variable | Default | Purpose |
|---|---|---|
NEWS_API_KEYS |
unset | Comma-separated keys for TheNewsAPI provider |
TELEGRAM_OWNER_USER_ID |
unset | Control-plane owner for approvals |
TELEGRAM_ADMIN_CHAT_ID |
unset | Admin chat for approval workflow |
TELEGRAM_PARSE_MODE |
MarkdownV2 |
Telegram parse mode |
CHARTINSPECT_API |
unset | Optional crypto OHLCV source |
LOG_LEVEL |
INFO |
Runtime logging level |
| Stage | Supported values |
|---|---|
providers.ingestion |
rss, api_newsapi |
providers.scoring |
heuristic_v1, heuristic_v2, heuristic_v3 |
providers.enrichment |
fetch_extract |
providers.publisher |
telegram, null |
streams:
us_markets:
enabled: true
providers:
ingestion: rss
scoring: heuristic_v2
enrichment: fetch_extract
publisher: telegram
rss:
allowlist_files: ["rss/us_markets.txt"]
schedule:
daily_us_close_sgt: "06:00"
weekend_wrap_sgt: "10:00"
monday_preview_ny: "SUN 18:10"
crypto:
enabled: true
providers:
ingestion: rss
scoring: heuristic_v3
enrichment: fetch_extract
publisher: telegram
rss:
allowlist_files: ["rss/crypto.txt"]
schedule:
daily_crypto_utc: "00:00"RSS allowlists are one URL per line in rss/*.txt.
If both TELEGRAM_OWNER_USER_ID and TELEGRAM_ADMIN_CHAT_ID are configured, daemon mode also runs Telegram onboarding/subscription control.
User flow:
/start/access- After approval:
/streams,/subscribe <stream>,/unsubscribe <stream>,/status
Admin flow (owner only):
/requests/approve <id>or/deny <id> [reason]
Publish routing:
- If enabled stream subscriptions exist, Argus broadcasts to authorized subscribers.
- If none exist, Argus falls back to
TELEGRAM_CHAT_ID.
argus smoke
argus smoke --verbose
argus smoke --test-invalidargus rss preview --url "https://feeds.bbci.co.uk/news/rss.xml" --limit 3
argus rss preview --allowlist "rss/us_markets.txt" --json --limit 5
argus rss preview --stream crypto --limit 5argus trace --stream us_markets --output trace.json
argus trace --stream crypto --mode crypto_daily --scoring v3 --output trace.json
argus trace --stream us_markets --skip-generate --output trace.jsonTrace output includes stage timing, scored-item breakdowns, selected bundle items, and generated message (unless skipped).
argus evaluate --days 1
argus evaluate --json --topk 20Daemon mode is the recommended production deployment:
- Internal APScheduler for ingest/report/retention jobs.
- Local health endpoints (
/ping,/health,/health/jobs/{job_id}/history). - Per-stream job IDs and manual triggering (
job:stream). - Catch-up policy support for missed jobs.
See docs/OPERATIONS.md for systemd setup and operational runbooks.
pip install -e ".[dev]"
pytest
pytest --cov=argus
mypy src/
ruff check src/
ruff check --fix src/src/argus/: main package and CLI.tests/: unit/integration test suite and fixtures.rss/: feed allowlists (*.txt).docs/: operations, design, and integration docs.scripts/: helper scripts for local workflows.
- Operations:
docs/OPERATIONS.md - Design:
docs/design/ - Integrations:
docs/integrations/ - Config baseline:
config.yaml - Environment template:
.env.example
- Never commit
.envor API keys. - Rotate credentials immediately after any leak.
- Keep
config.yamlnon-secret and reviewable. - Use
--dry-run/--skip-publishafter config changes before live publishing.
MIT