这个仓库已经从“单一 games 的 GitHub 游戏项目自动研究系统”升级为“可扩展到多领域的 GitHub 研究系统 MVP”。
当前依然保留一个统一的 github-watch 服务,但配置、prompt、规则和数据输出已经按 domain 分层,后续可以继续扩展新的研究领域。
gamesimage-processingshort-videofinanceinfra
- Windows 11
- Docker Desktop(启用 WSL2)
- WSL2 Ubuntu
- 宿主机已安装 Ollama
.
├─ compose/
├─ config/
│ ├─ repos/
│ ├─ prompts/
│ └─ pipelines.yaml
├─ data/
│ └─ github-watch/
│ ├─ raw/<domain>/
│ ├─ normalized/<domain>/
│ ├─ reports/daily/
│ ├─ reports/weekly/
│ ├─ reports/by-domain/
│ ├─ embeddings/
│ ├─ training-samples/
│ └─ state/
├─ github-watch/
│ └─ app/
│ ├─ exporters/
│ └─ domain_rules/
├─ scripts/
├─ start.ps1
├─ stop.ps1
└─ backup.ps1
先复制环境文件:
Copy-Item .\compose\.env.example .\compose\.env然后编辑 compose/.env,至少填写:
GITHUB_TOKENOLLAMA_BASE_URL或OLLAMA_HOSTOLLAMA_MODEL_OVERRIDE(可选,调试时才填写)POSTGRES_PASSWORDN8N_BASIC_AUTH_PASSWORD
Ollama 地址支持自动判定:当
OLLAMA_BASE_URL与OLLAMA_HOST都未设置时,github-watch会自动区分“宿主机直跑”与“容器内运行”并选择默认地址(并带可达性兜底)。
ollama serve
ollama list
ollama pull qw-14b项目已支持基于 qw-14b 的 5 个持久化角色模型(见 ollama/modelfiles/):
gh-research-qw-14bgh-games-qw-14bgh-image-qw-14bgh-video-qw-14bgh-finance-qw-14b
先构建角色模型(Windows):
.\ollama\build-models.ps1WSL/Linux/macOS:
bash ./ollama/build-models.sh- 角色定义随模型别名保存,重启 Ollama 后仍可直接
ollama run <alias> - 避免每次请求拼大段临时 prompt,行为更稳定
- 便于长期维护:角色调整集中在
ollama/modelfiles/*.Modelfile
- 持久角色:通过 Modelfile 固化“长期人格/风格/关注点”
- 临时覆盖:通过环境变量或代码参数短期改写 system prompt,适合调试
- 两者可叠加:默认走角色模型,必要时再临时覆盖
映射文件:config/ollama_models.yaml
games -> gh-games-qw-14bimage-processing -> gh-image-qw-14bshort-video -> gh-video-qw-14bfinance -> gh-finance-qw-14binfra -> gh-research-qw-14bdefault -> gh-research-qw-14b
若某个 domain 未配置,自动回退到 default。
直接修改 config/ollama_models.yaml 中的 default 即可。
OLLAMA_MODEL_OVERRIDE:强制覆盖所有 domain 的模型(调试用,推荐)OLLAMA_MODEL:历史兼容覆盖变量(不推荐长期使用)OLLAMA_SYSTEM_PROMPT:临时覆盖 system prompt(调试用)OLLAMA_NUM_CTX/OLLAMA_TEMPERATURE/OLLAMA_TOP_P/OLLAMA_REPEAT_PENALTY
在 compose/.env 设置:
OLLAMA_MODEL_OVERRIDE=gh-research-qw-14b这样会覆盖 domain 映射,所有 domain 都走同一个通用模型。
.\start.ps1docker compose --env-file .\compose\.env -f .\compose\docker-compose.yml run --rm github-watch python -m app.main生成物重点看这里:
data/github-watch/raw/<domain>/data/github-watch/normalized/<domain>/data/github-watch/reports/daily/data/github-watch/reports/by-domain/data/github-watch/state/
- 新建
config/repos/<new-domain>.yaml - 新建
config/prompts/repo_summary_<new-domain>.md - 在
github-watch/app/domain_rules/增加对应规则文件 - 如果需要更强输出,可在 exporter 层补该 domain 的特殊导出逻辑
- 若要独立角色模型,再增加
ollama/modelfiles/+config/ollama_models.yaml映射
当前实现是轻量 MVP,不需要新增服务,也不需要新增容器。
推荐 Windows 任务计划程序,每天执行:
docker compose --env-file E:\aiauto\compose\.env -f E:\aiauto\compose\docker-compose.yml run --rm github-watch python -m app.main完整任务计划程序配置示例见:WINDOWS_TASK_SCHEDULER_GITHUB_WATCH.md
- 安装 Docker Desktop + WSL2 + Ollama
- 拷贝整个项目目录
- 还原备份压缩包
- 重新填写
compose/.env - 执行
.\start.ps1
compose/config/data/github-watch/data/openwebui/data/qdrant/data/postgres/data/redis/data/n8n/
一键备份:
.\backup.ps1github-watch/app/exporters/qdrant_exporter.py(stub:仅创建目录并记录日志,不写入远端 Qdrant)github-watch/app/exporters/training_exporter.py(stub:仅保证placeholder.jsonl存在)
当前只有 markdown_exporter.py 在实际输出链路中生效。
启动后最小检查项(目录、日报文件、服务地址)见:ACCEPTANCE_CHECKLIST.md
- 某个 repo 不存在、重命名、权限不足、API 异常时,不会中断整批任务
- Ollama 不可用时,会自动退回基础文本摘要
- 没有 Qdrant / Postgres / Redis,也可以先只验证最小日报链路
- 旧的单文件
config/repos.yaml已废弃,改为config/repos/*.yaml - 旧的
data/github-watch/raw/*.json与normalized/*.json顶层输出结构已废弃,改为按 domain 分目录