{"id":50807039,"url":"https://github.com/thaolst/tara-bot","last_synced_at":"2026-06-13T02:07:10.725Z","repository":{"id":357391932,"uuid":"1235682971","full_name":"thaolst/tara-bot","owner":"thaolst","description":"Tara Bot — AI Telegram agent: search flights, compare prices, inject affiliate links","archived":false,"fork":false,"pushed_at":"2026-06-10T13:33:48.000Z","size":51,"stargazers_count":55,"open_issues_count":0,"forks_count":67,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-10T15:14:25.462Z","etag":null,"topics":["affiliate-marketing","ai-agent","automation","claude-ai","flight-search","price-comparison","python","telegram-bot","travel","vietnam"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thaolst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-11T14:55:02.000Z","updated_at":"2026-06-10T13:35:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thaolst/tara-bot","commit_stats":null,"previous_names":["thaolst/tara-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thaolst/tara-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaolst%2Ftara-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaolst%2Ftara-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaolst%2Ftara-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaolst%2Ftara-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thaolst","download_url":"https://codeload.github.com/thaolst/tara-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaolst%2Ftara-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34269381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["affiliate-marketing","ai-agent","automation","claude-ai","flight-search","price-comparison","python","telegram-bot","travel","vietnam"],"created_at":"2026-06-13T02:07:10.182Z","updated_at":"2026-06-13T02:07:10.720Z","avatar_url":"https://github.com/thaolst.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TARA BOT 🤖✈️🛒\n\n[![Version](https://img.shields.io/badge/version-v2.0.0-brightgreen?style=flat-square)](https://github.com/thaolst/tara-bot/releases)\n[![GitHub stars](https://img.shields.io/github/stars/thaolst/tara-bot?style=flat-square\u0026color=yellow)](https://github.com/thaolst/tara-bot/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/thaolst/tara-bot?style=flat-square\u0026color=blue)](https://github.com/thaolst/tara-bot/network/members)\n\n**AI agent cá nhân trên Telegram — săn vé máy bay, so sánh giá, cào deal.**\n\n[![Deploy on Fly.io](https://img.shields.io/badge/deploy-fly.io-6a0dad?style=flat-square)](https://fly.io)\n[![License: MIT](https://img.shields.io/badge/license-MIT-4ade80?style=flat-square)](LICENSE)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-60a5fa?style=flat-square)](https://python.org)\n\n\u003e Build bởi **Lê Song Tiên Thảo** · [GitHub](https://github.com/thaolst) · [LinkedIn](https://www.linkedin.com/in/thaolst/) · [Facebook](https://www.facebook.com/LeSongTienThao)\n\u003e\n\u003e Đây là side project. Repo chính của mình về AI x growth marketing: [growth-mcp](https://github.com/thaolst/growth-mcp) (MCP server, `pip install growth-mcp`) và [ai-growth-prompts](https://github.com/thaolst/ai-growth-prompts).\n\n## ✨ Tính năng\n\n| Tính năng | Mô tả | Trạng thái |\n|---|---|---|\n| 💬 **Chat tự nhiên** | Hỏi \"tìm vé SG Đà Nẵng cuối tuần\" — Claude hiểu ngữ cảnh, tự gọi đúng tool | ✅ |\n| ✈️ **Tìm vé máy bay** | Giá real-time từ Google Flights, top 5 chuyến, link Google Flights | ✅ |\n| 🛒 **So sánh giá sản phẩm** | Google Shopping — giá, rating, shop, link mua trực tiếp | ✅ |\n| 🔔 **Daily price monitor** | 9AM mỗi sáng tự động check giá 4 tuyến SGN↔HAN/DAD/PQC, gửi Telegram | ✅ |\n| 🧠 **Memory trong session** | LLM nhớ toàn bộ lịch sử chat, hỏi tiếp không cần nhắc lại | ✅ |\n| ⚡ **Prompt caching** | Cache system prompt từ turn 2 → tiết kiệm ~90% token cost (Anthropic) | ✅ |\n| 🧩 **Adaptive thinking** | Claude tự bật extended thinking khi câu hỏi phức tạp (Anthropic) | ✅ |\n| 🔄 **LLM mode switch** | Hỗ trợ Anthropic Claude hoặc OpenAI-compatible (Gemini, local LLM) | ✅ |\n| 🔁 **Multi-turn tool loop** | Một lượt hỏi có thể gọi nhiều tool liên tiếp, tối đa 5 vòng | ✅ |\n| 🔗 **Google Flights link** | Mỗi kết quả vé kèm link tìm thêm trên Google Flights | ✅ |\n| 🛡️ **Private mode** | `ALLOWED_USER_ID` — chỉ bạn mới dùng được bot | ✅ |\n| 🔄 **Commands** | `/start` `/reset` `/uptime` | ✅ |\n| 🏥 **Health check** | HTTP endpoint cho Fly.io keepalive | ✅ |\n| 🆕 **Shopee cào giá** | | 🔜 |\n| 🔔 **Auto-deal alert** | Notify khi giá rẻ hơn ngưỡng đặt | 🔜 |\n| 👥 **Multi-user** | | 🔜 |\n\n## 🎬 Demo\n\n```\n👤: tìm vé SG Hà Nội thứ 7 tuần này\n\n🤖: ✈️ Sài Gòn → Hà Nội\n    📅 2026-05-16 → 2026-05-21 (5 chuyến)\n\n    🏆 1,450,000đ 06:00→08:05 (2h5)\n       `Vietjet Air VJ123` · *Thẳng*\n\n    🥈 1,890,000đ 09:30→11:35 (2h5)\n       `Bamboo Airways QH201` · *Thẳng*\n\n    🥉 2,100,000đ 08:30→10:30 (2h0)\n       `Vietnam Airlines VN123` · *Thẳng*\n\n    [🔍 Xem thêm trên Google Flights](https://google.com/travel/flights?...)\n```\n\n```\n👤: iPhone 16 giá bao nhiêu\n\n🤖: 🛒 iPhone 16 (6 kết quả)\n\n    🥇 *22,990,000đ* 🔥 — CellphoneS\n       ⭐⭐⭐⭐ 4.8 (2,341 đánh giá)\n       🔗 https://cellphones.com.vn/...\n\n    🥈 *23,500,000đ* — Thế Giới Di Động\n       ⭐⭐⭐⭐ 4.7 (1,890 đánh giá)\n```\n\n## 🧱 Tech stack\n\n```\n┌──────────────┐     ┌──────────────────────────┐     ┌──────────────────┐\n│   Telegram   │ ←→  │      LLM Backend          │ ←→  │     SerpAPI      │\n│     Bot      │     │(Anthropic / OpenAI-compat)│     │  · Google Flights│\n│              │     │  · Multi-turn tool loop   │     │  · Google Shopping│\n│  /start      │     │  · Prompt caching         │     └──────────────────┘\n│  /reset      │     │  · Adaptive thinking      │\n│  /uptime     │     │  · Session memory         │\n└──────────────┘     └──────────────────────────┘\n│  /uptime     │     └──────────────────────────┘\n└──────────────┘\n                      ┌──────────────────────────┐\n                      │      GitHub Actions       │\n                      │  · 9AM daily monitor      │\n                      │  · 4 tuyến bay cố định    │\n                      └──────────────────────────┘\n```\n\n| Thành phần | Chi tiết |\n|---|---|\n| **AI** | Claude Sonnet 4.6 (Anthropic) hoặc OpenAI-compatible (Gemini, ...) |\n| **Bot** | python-telegram-bot v20+ |\n| **Search** | SerpAPI — Google Flights + Google Shopping |\n| **Host** | Fly.io free tier, region Singapore |\n| **Scheduler** | GitHub Actions cron, 9AM Vietnam (UTC+7) |\n| **Language** | Python 3.11+ |\n\n## 🚀 Deploy trong 5 phút\n\n### 1. Chuẩn bị API keys\n\n| Key | Lấy ở đâu | Free quota |\n|---|---|---|\n| `TELEGRAM_TOKEN` | [@BotFather](https://t.me/botfather) → `/newbot` | Không giới hạn |\n| `ALLOWED_USER_ID` | [@userinfobot](https://t.me/userinfobot) → `/start` | — |\n| `TELEGRAM_CHAT_ID` | Giống `ALLOWED_USER_ID` | — |\n| `LLM_MODE` | `anthropic` or `openai` | `anthropic` |\n| `ANTHROPIC_API_KEY` | [console.anthropic.com](https://console.anthropic.com/settings/keys) | $5 free credit |\n| `OPENAI_API_KEY` | [Google AI Studio](https://aistudio.google.com/app/apikey) | Free tier |\n| `SERPAPI_KEY` | [serpapi.com](https://serpapi.com) | 250 req/tháng |\n\n### 2. Deploy lên Fly.io\n\n```bash\ngit clone https://github.com/thaolst/tara-bot\ncd tara-bot\n\nfly auth login\nfly launch --from Dockerfile --name tara-bot-yourname\n\nfly secrets set \\\n  TELEGRAM_TOKEN=xxx \\\n  ANTHROPIC_API_KEY=xxx \\\n  SERPAPI_KEY=xxx \\\n  ALLOWED_USER_ID=xxx \\\n  TELEGRAM_CHAT_ID=xxx\n\nfly deploy\n```\n\n### 3. Bật daily monitor\n\n- GitHub repo → **Settings → Secrets → Actions** → thêm 3 secrets: `SERPAPI_KEY`, `TELEGRAM_TOKEN`, `TELEGRAM_CHAT_ID`\n- **Actions tab** → **Flight Monitor** → Enable workflow\n\n*Chi tiết đầy đủ: [DEPLOY.md](./DEPLOY.md)*\n\n## ⚙️ Cấu hình\n\n| Env var | Bắt buộc | Mô tả |\n|---|---|---|\n| `ANTHROPIC_API_KEY` | ✅ | Anthropic API key |\n| `TELEGRAM_TOKEN` | ✅ | Telegram Bot token từ @BotFather |\n| `ALLOWED_USER_ID` | ✅ | Telegram user ID — chỉ ID này mới dùng được bot |\n| `SERPAPI_KEY` | ✅ | SerpAPI key cho Flights + Shopping |\n| `TELEGRAM_CHAT_ID` | ✅ | Chat ID nhận daily monitor (thường = ALLOWED_USER_ID) |\n| `AFFILIATE_TEMPLATE` | ❌ | Template URL affiliate (coming soon) |\n\n## 📁 Cấu trúc\n\n```\ntara-bot/\n├── src/\n│   ├── bot.py          # Telegram bot — polling, session, /start /reset /uptime\n│   ├── agents.py       # Claude agent — tool loop, prompt caching, adaptive thinking\n│   ├── config.py       # Env config loader\n│   └── tools/\n│       └── serpapi.py  # Flight search + Shopping search\n├── scripts/\n│   └── monitor.py      # Daily price check — chạy bởi GitHub Actions\n├── .github/workflows/\n│   └── monitor.yml     # Cron 9AM Vietnam daily\n├── Dockerfile\n├── fly.toml            # Fly.io config — region Singapore, 1GB RAM\n├── DEPLOY.md\n└── CHANGELOG.md\n```\n\n## 💰 Chi phí\n\n| Service | Cost | Ghi chú |\n|---|---|---|\n| Fly.io | $0 | Free tier đủ dùng |\n| SerpAPI | $0 | 250 req/tháng free |\n| Anthropic | ~$0.50/tháng | Prompt caching giảm ~90% cost |\n| GitHub Actions | $0 | Public repo free |\n| **Tổng** | **~$0.50/tháng** | |\n\n## 🗺️ Roadmap\n\n- [x] Flight search — top 5 chuyến, compact format, Google Flights link\n- [x] Shopping search — giá, rating, shop, link mua\n- [x] Daily price monitor 9AM (GitHub Actions)\n- [x] 24/7 bot trên Fly.io (Singapore)\n- [x] Prompt caching — tiết kiệm token cost\n- [x] Adaptive thinking — extended thinking tự động\n- [x] Multi-turn tool loop (max 5 iter)\n- [x] Private mode (ALLOWED_USER_ID)\n- [x] /reset /uptime commands\n- [ ] Affiliate link injection đầy đủ\n- [ ] Shopee price scraper\n- [ ] Auto-deal alert (notify khi giá rẻ hơn ngưỡng)\n- [ ] Multi-user support\n\n## 📝 License\n\nMIT — free to use, fork, modify.\n\n\u003e *Tara Bot — build public để chia sẻ và học hỏi, không phải product thương mại.*\n\n\n## Các repo khác của mình\n\nNếu bạn làm growth marketing hoặc quan tâm đến AI agent cho công việc thực tế:\n\n| Repo | Mô tả |\n|------|-------|\n| [ai-growth-agents-for-marketers](https://github.com/thaolst/ai-growth-agents-for-marketers) | Prompts và Python agents cho campaign brief, MEU planning, A/B test — build từ campaign fintech thực tế |\n| [growth-mcp](https://github.com/thaolst/growth-mcp) | MCP server cho growth marketing, có CSV data layer phân tích A/B test và retention từ data thật — `pip install growth-mcp` |\n| [ai-growth-prompts](https://github.com/thaolst/ai-growth-prompts) | Prompt collection cho voucher design, segmentation, game mechanics |\n\n---\n\n## Other repos\n\nIf you work in growth marketing or are interested in AI agents for real work:\n\n| Repo | Description |\n|------|-------------|\n| [ai-growth-agents-for-marketers](https://github.com/thaolst/ai-growth-agents-for-marketers) | Prompts and Python agents for campaign brief, MEU planning, A/B test — built from real fintech campaigns |\n| [growth-mcp](https://github.com/thaolst/growth-mcp) | MCP server for growth marketing with a CSV data layer for A/B test and retention analysis on real data — `pip install growth-mcp` |\n| [ai-growth-prompts](https://github.com/thaolst/ai-growth-prompts) | Prompt collection for voucher design, segmentation, game mechanics |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaolst%2Ftara-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthaolst%2Ftara-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaolst%2Ftara-bot/lists"}