AI Brief 是一个命令行优先的每日情报机器人。它默认优先通过 Serper 搜索 API 按关键词采集资讯;如果用户没有配置搜索 API token,系统会自动使用预置的权威 RSS 源兜底。采集后,AI Brief 会根据用户自定义主题过滤内容,使用可配置的大模型生成摘要,并把每日早报推送到 Telegram。
这个项目适合个人或小团队使用:通过 CLI 和本地配置文件完成设置,不需要网页后台。
- 按主题关键词过滤资讯。
- 默认优先使用 Serper 新闻搜索采集。
- 未配置搜索 API token 时,自动使用 RSS fallback。
- 预置多个官方/权威 RSS 源,包括 OpenAI、Google AI、Google DeepMind、Meta、Hugging Face、Microsoft Research 和 NVIDIA。
- 使用 SQLite 保存历史记录、去重和已推送链接。
- 支持 Telegram Bot API 推送。
- 支持前台运行的每日定时任务。
- 支持多种模型:
- 豆包、OpenAI、DeepSeek、通义千问、Kimi、智谱,以及其他 OpenAI-compatible API。
- Anthropic Claude。
- Google Gemini。
python -m venv .venv
source .venv/bin/activate
pip install -e .
ai-brief initai-brief init 会创建本地运行文件:
config.yaml.envdata/ai_brief.sqlite
这些文件不会被提交到 Git。公开模板是 config.example.yaml 和 .env.example。
ai-brief topic list
ai-brief topic add "OpenAI"
ai-brief topic add "AI Agent"
ai-brief topic remove "OpenAI"搜索采集默认开启,但需要你提供自己的 Serper API key。编辑 .env:
SERPER_API_KEY=your_api_key默认配置如下:
sources:
search:
enabled: true
provider: serper
api_key_env: SERPER_API_KEY
num_results_per_topic: 10
fallback_to_rss: true如果没有配置 SERPER_API_KEY,系统会自动使用 RSS fallback。
项目已经预置了一批官方/权威 RSS 源。你可以查看或继续添加:
ai-brief source list
ai-brief source add-rss "https://example.com/feed.xml" --name "Example"
ai-brief source disable "Example"默认模型服务是 doubao,通过 OpenAI-compatible 适配器调用。你需要配置 provider、模型名、base URL 和 API key 环境变量:
ai-brief model set doubao \
--model "YOUR_MODEL_NAME" \
--base-url "YOUR_OPENAI_COMPATIBLE_BASE_URL" \
--api-key-env DOUBAO_API_KEY然后在 .env 中设置密钥:
DOUBAO_API_KEY=your_api_key查看支持的 provider:
ai-brief model listOpenAI-compatible providers:
doubaoopenaideepseekqwenkimizhipuopenai-compatible
原生适配器:
anthropicgemini
- 在 Telegram 中通过
@BotFather创建一个机器人。 - 把机器人 token 写入
.env:
TELEGRAM_BOT_TOKEN=your_bot_token- 配置你的 chat ID:
ai-brief telegram setup --chat-id "YOUR_CHAT_ID"
ai-brief telegram test只预览,不发送:
ai-brief preview不调用大模型,只用源摘要预览:
ai-brief preview --no-ai生成并推送到 Telegram:
ai-brief run启动前台定时任务:
ai-brief schedule start定时任务会读取 config.yaml 中的 app.send_time 和 app.timezone。
ai_brief/
collectors/ RSS 和搜索采集器
llm/ 大模型 provider 适配器
pipeline/ 过滤、去重、格式化和运行编排
prompts/ prompt 模板
cli.py 命令行入口
config.py 配置加载和初始化
db.py SQLite 存储
scheduler.py 每日定时任务
telegram.py Telegram 推送
docs/
ARCHITECTURE.md
python -m compileall ai_brief
ai-brief --help
ai-brief preview --no-aiGitHub Actions 会执行一个基础冒烟测试:安装项目、编译源码、检查 CLI 入口。
- 不要提交
.env,它包含密钥。 config.yaml是本地运行配置,已被忽略。data/存放本地 SQLite 数据库,已被忽略。- 当前项目仍是 MVP,定时任务以前台进程运行。生产环境建议用
systemd、Docker、进程管理器或托管 worker 来运行。
MIT
AI Brief is a CLI-first daily intelligence bot. It uses the Serper Search API first to collect topic-based updates; if the user has not configured a search API token, it automatically falls back to a curated set of authoritative RSS feeds. After collection, it filters updates by user-defined topics, summarizes them with a configurable LLM, and sends the daily brief to Telegram.
It is designed for personal or small-team workflows where configuration happens through the command line and local files, without a web dashboard.
- Topic-based news filtering.
- Serper news search as the default collection path.
- Automatic RSS fallback when no search API token is configured.
- Curated official/authoritative RSS defaults, including OpenAI, Google AI, Google DeepMind, Meta, Hugging Face, Microsoft Research, and NVIDIA.
- SQLite history for dedupe and sent-item tracking.
- Telegram Bot API delivery.
- Foreground daily scheduler.
- Multi-model LLM adapters:
- Doubao, OpenAI, DeepSeek, Qwen, Kimi, Zhipu, and other OpenAI-compatible APIs.
- Anthropic Claude.
- Google Gemini.
python -m venv .venv
source .venv/bin/activate
pip install -e .
ai-brief initai-brief init creates local runtime files:
config.yaml.envdata/ai_brief.sqlite
These files are ignored by Git. Public templates live in config.example.yaml and .env.example.
ai-brief topic list
ai-brief topic add "OpenAI"
ai-brief topic add "AI Agent"
ai-brief topic remove "OpenAI"Search collection is enabled by default, but you need to provide your own Serper API key. Add it to .env:
SERPER_API_KEY=your_api_keyThe default config looks like this:
sources:
search:
enabled: true
provider: serper
api_key_env: SERPER_API_KEY
num_results_per_topic: 10
fallback_to_rss: trueIf SERPER_API_KEY is missing, AI Brief automatically uses RSS fallback.
The project includes a curated set of official/authoritative RSS feeds. You can list or extend them:
ai-brief source list
ai-brief source add-rss "https://example.com/feed.xml" --name "Example"
ai-brief source disable "Example"The default provider is doubao, using the OpenAI-compatible adapter. Configure the provider, model name, base URL, and environment variable:
ai-brief model set doubao \
--model "YOUR_MODEL_NAME" \
--base-url "YOUR_OPENAI_COMPATIBLE_BASE_URL" \
--api-key-env DOUBAO_API_KEYThen set the key in .env:
DOUBAO_API_KEY=your_api_keySupported provider names:
ai-brief model listOpenAI-compatible providers:
doubaoopenaideepseekqwenkimizhipuopenai-compatible
Native adapters:
anthropicgemini
- Create a bot with Telegram
@BotFather. - Put the bot token in
.env:
TELEGRAM_BOT_TOKEN=your_bot_token- Configure your chat ID:
ai-brief telegram setup --chat-id "YOUR_CHAT_ID"
ai-brief telegram testPreview without sending:
ai-brief previewPreview without calling an LLM:
ai-brief preview --no-aiGenerate and send to Telegram:
ai-brief runStart the foreground scheduler:
ai-brief schedule startThe scheduler uses app.send_time and app.timezone from config.yaml.
ai_brief/
collectors/ RSS and search collectors
llm/ LLM provider adapters
pipeline/ filtering, dedupe, formatting, and run orchestration
prompts/ prompt templates
cli.py command-line interface
config.py config loading and initialization
db.py SQLite storage
scheduler.py daily scheduler
telegram.py Telegram delivery
docs/
ARCHITECTURE.md
python -m compileall ai_brief
ai-brief --help
ai-brief preview --no-aiThe GitHub Actions workflow runs a smoke test that installs the package, compiles the source, and checks the CLI entry point.
- Never commit
.env; it contains secrets. config.yamlis local runtime configuration and is ignored.data/contains the local SQLite database and is ignored.- This project is an MVP and the scheduler currently runs in the foreground. For production use, run it under
systemd, Docker, a process manager, or a hosted worker.
MIT