[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80114":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":14,"forks30d":14,"starsTrendScore":15,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":14,"starSnapshotCount":14,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},80114,"tara-bot","thaolst\u002Ftara-bot","thaolst","Tara Bot — AI Telegram agent: search flights, compare prices, inject affiliate links",null,"Python",56,67,1,0,3,45.1,false,"main",true,[21,22,23,24,25,26,27,28],"ai-agent","claude-ai","flight-search","price-comparison","python","serpapi","telegram-bot","travel","2026-06-12 04:01:26","# TARA BOT 🤖✈️🛒\n\n[![Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-v2.0.0-brightgreen?style=flat-square)](https:\u002F\u002Fgithub.com\u002Fthaolst\u002Ftara-bot\u002Freleases)\n[![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fthaolst\u002Ftara-bot?style=flat-square&color=yellow)](https:\u002F\u002Fgithub.com\u002Fthaolst\u002Ftara-bot\u002Fstargazers)\n[![GitHub forks](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fthaolst\u002Ftara-bot?style=flat-square&color=blue)](https:\u002F\u002Fgithub.com\u002Fthaolst\u002Ftara-bot\u002Fnetwork\u002Fmembers)\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:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdeploy-fly.io-6a0dad?style=flat-square)](https:\u002F\u002Ffly.io)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-4ade80?style=flat-square)](LICENSE)\n[![Python 3.11+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.11+-60a5fa?style=flat-square)](https:\u002F\u002Fpython.org)\n\n> Build bởi **Lê Song Tiên Thảo** · [GitHub](https:\u002F\u002Fgithub.com\u002Fthaolst) · [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fthaolst\u002F) · [Facebook](https:\u002F\u002Fwww.facebook.com\u002FLeSongTienThao)\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\u002FDAD\u002FPQC, 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** | `\u002Fstart` `\u002Freset` `\u002Fuptime` | ✅ |\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:\u002F\u002Fgoogle.com\u002Ftravel\u002Fflights?...)\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:\u002F\u002Fcellphones.com.vn\u002F...\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 \u002F OpenAI-compat)│     │  · Google Flights│\n│              │     │  · Multi-turn tool loop   │     │  · Google Shopping│\n│  \u002Fstart      │     │  · Prompt caching         │     └──────────────────┘\n│  \u002Freset      │     │  · Adaptive thinking      │\n│  \u002Fuptime     │     │  · Session memory         │\n└──────────────┘     └──────────────────────────┘\n│  \u002Fuptime     │     └──────────────────────────┘\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:\u002F\u002Ft.me\u002Fbotfather) → `\u002Fnewbot` | Không giới hạn |\n| `ALLOWED_USER_ID` | [@userinfobot](https:\u002F\u002Ft.me\u002Fuserinfobot) → `\u002Fstart` | — |\n| `TELEGRAM_CHAT_ID` | Giống `ALLOWED_USER_ID` | — |\n| `LLM_MODE` | `anthropic` or `openai` | `anthropic` |\n| `ANTHROPIC_API_KEY` | [console.anthropic.com](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys) | $5 free credit |\n| `OPENAI_API_KEY` | [Google AI Studio](https:\u002F\u002Faistudio.google.com\u002Fapp\u002Fapikey) | Free tier |\n| `SERPAPI_KEY` | [serpapi.com](https:\u002F\u002Fserpapi.com) | 250 req\u002Ftháng |\n\n### 2. Deploy lên Fly.io\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fthaolst\u002Ftara-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](.\u002FDEPLOY.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\u002F\n├── src\u002F\n│   ├── bot.py          # Telegram bot — polling, session, \u002Fstart \u002Freset \u002Fuptime\n│   ├── agents.py       # Claude agent — tool loop, prompt caching, adaptive thinking\n│   ├── config.py       # Env config loader\n│   └── tools\u002F\n│       └── serpapi.py  # Flight search + Shopping search\n├── scripts\u002F\n│   └── monitor.py      # Daily price check — chạy bởi GitHub Actions\n├── .github\u002Fworkflows\u002F\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\u002Ftháng free |\n| Anthropic | ~$0.50\u002Ftháng | Prompt caching giảm ~90% cost |\n| GitHub Actions | $0 | Public repo free |\n| **Tổng** | **~$0.50\u002Fthá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\u002F7 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] \u002Freset \u002Fuptime 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> *Tara Bot — build public để chia sẻ và học hỏi, không phải product thương mại.*\n","Tara Bot 是一个基于Telegram的AI助手，主要用于搜索航班、比较价格以及插入联盟链接。其核心功能包括自然语言处理、实时航班查询（通过Google Flights）、商品价格对比（利用Google Shopping），并且能够记忆对话上下文以提供更流畅的交互体验。此外，它还支持多轮工具调用循环、自适应思维模式切换等高级特性，有助于提高信息检索效率和用户体验。该项目采用Python编写，适合需要频繁查找旅行相关信息或希望自动监控特定航线价格变动的个人用户使用。",2,"2026-06-11 03:59:18","CREATED_QUERY"]