政府采购智能顾问 - 基于RAG的法规问答CLI工具
Project description
zcyclaw
政府采购智能顾问 — 基于 RAG 的法规问答 CLI 工具。
独立于采购平台,基于中国政府采购法律法规提供专业问答、采购方式推荐等功能。核心开源,数据本地存储,隐私第一。
功能
- 法规智能问答:基于 16 部核心法规(766 条法条),回答自动标注法条来源
- 流式输出:token-by-token 逐字显示,体验流畅
- 多 LLM 支持:DeepSeek / 智谱 GLM / 通义千问 / Moonshot / MiniMax / OpenAI / Ollama / Anthropic
- 开箱即用:预构建法规数据随包分发,安装即可使用
- 本地优先:向量库、配置、日志全部本地存储,API Key 直连 LLM 厂商
快速开始
# 安装
uv tool install zcyclaw
# 或使用 pip
pip install zcyclaw
# 初始化配置(选择 LLM 提供商 + 输入 API Key)
zcyclaw init
# 单次问答
zcyclaw ask "询价采购需要满足什么条件?"
# 交互式多轮问答
zcyclaw ask -i
# 更新法规数据
zcyclaw update
# 查看数据统计
zcyclaw stats
配置
配置文件位置:~/.zcyclaw/config.json
交互式配置
运行 zcyclaw init 将引导完成以下配置:
- 选择提供商:从已注册列表中选择
- API Key:输入对应厂商的 API Key(Ollama 不需要)
- 模型名称:可使用默认值,也可自定义为其他模型(如
deepseek-reasoner、glm-4-plus) - API 地址:可使用默认值,也可自定义为兼容 OpenAI 协议的第三方地址
手动编辑
直接编辑 ~/.zcyclaw/config.json:
{
"default_provider": "deepseek",
"providers": {
"deepseek": {
"api_key": "sk-xxx",
"base_url": "https://api.deepseek.com/v1",
"model": "deepseek-chat",
"temperature": 0.3,
"max_tokens": 2048
},
"minimax": {
"api_key": "sk-xxx",
"base_url": "https://api.minimax.chat/v1",
"model": "MiniMax-Text-01",
"temperature": 0.3,
"max_tokens": 2048
}
}
}
环境变量覆盖
前缀 ZCYCLAW_,双下划线分隔嵌套:
export ZCYCLAW_PROVIDERS__DEEPSEEK__API_KEY=sk-xxx
export ZCYCLAW_PROVIDERS__DEEPSEEK__MODEL=deepseek-reasoner
export ZCYCLAW_DEFAULT_PROVIDER=deepseek
支持的提供商
| 提供商 | 默认模型 | 需要API Key |
|---|---|---|
| DeepSeek | deepseek-chat | 是 |
| 智谱 GLM | glm-4-flash | 是 |
| 通义千问 | qwen-turbo | 是 |
| Moonshot | moonshot-v1-8k | 是 |
| MiniMax | MiniMax-Text-01 | 是 |
| OpenAI | gpt-4o-mini | 是 |
| Ollama | qwen2.5:7b | 否 |
| Anthropic | claude-sonnet-4-20250514 | 是 |
可选安装
# Anthropic 后端支持
uv tool install "zcyclaw[anthropic]"
# 本地 Embedding(fastembed/BGE-M3)
uv tool install "zcyclaw[fastembed]"
# 完整安装
uv tool install "zcyclaw[full]"
内置法规
| 效力层级 | 法规 |
|---|---|
| 法律 | 政府采购法、招标投标法 |
| 行政法规 | 政府采购法实施条例、招标投标法实施条例 |
| 部门规章 | 货物和服务招标投标管理办法、非招标采购方式管理办法、竞争性磋商采购方式管理暂行办法、框架协议采购方式管理暂行办法、促进中小企业发展管理办法、需求管理办法、信息公开办法、评审专家管理办法、进口产品管理办法、代理机构管理暂行办法、政府和社会资本合作项目政府采购管理办法、关于促进政府采购公平竞争优化营商环境的通知 |
技术栈
Python 3.11+ / Typer / Rich / Pydantic / ChromaDB / httpx / loguru
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zcyclaw-0.1.3.15.tar.gz
(354.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
zcyclaw-0.1.3.15-py3-none-any.whl
(138.4 kB
view details)
File details
Details for the file zcyclaw-0.1.3.15.tar.gz.
File metadata
- Download URL: zcyclaw-0.1.3.15.tar.gz
- Upload date:
- Size: 354.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee366b728843c0f8e60ec50890f7fb10727a9899dcd16f6dc983efb4841d066c
|
|
| MD5 |
2ef93649119dde1667a9e5cb81f11117
|
|
| BLAKE2b-256 |
94d370083a9d3671927d94b90e29518ec7ac1a0f11f5c04fcfce4d0bef68ad59
|
File details
Details for the file zcyclaw-0.1.3.15-py3-none-any.whl.
File metadata
- Download URL: zcyclaw-0.1.3.15-py3-none-any.whl
- Upload date:
- Size: 138.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7d56575f88b014dd436e2b38037d81b8aa21f7c87e1f06159d13fc9e26315f0
|
|
| MD5 |
a13ddb7aac570a8f86e48024bb537c37
|
|
| BLAKE2b-256 |
3342470a3f3eb471eabce2609efeba14198000aa70b0fae89aeb963ccb1ff9e9
|