面向财务团队的中国税率查询助手。系统原则是 证据优先、模型辅助:税率结论来自结构化税码/政策依据库,AI 只负责理解输入、消歧、解释依据和生成合规建议。
apps/
api/ FastAPI backend: tax search pipeline, evidence objects, LLM provider abstraction
web/ Next.js frontend: search workspace, tax result cards, official evidence panel
cd apps/api
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000cd apps/web
npm install
npm run devOpen http://localhost:3000.
The backend runs without an API key by using a deterministic local provider. When a key is available, set one of:
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=...
LLM_PROVIDER=gemini
GEMINI_API_KEY=...
LLM_PROVIDER=kimi
KIMI_API_KEY=...
KIMI_BASE_URL=https://api.moonshot.cn/v1
KIMI_MODEL=kimi-k2.5
KIMI_VERIFY_MODEL=kimi-k2.6
KIMI_VISION_MODEL=moonshot-v1-8k-vision-preview
KIMI_SEARCH_MODEL=kimi-k2.6
KIMI_SEARCH_TIMEOUT_SECONDS=120
KIMI_BUILDER_MODEL=moonshot-v1-128k
LLM_TIMEOUT_SECONDS=45The current code keeps model calls behind LLMProvider, so provider changes do not affect the tax classification pipeline.
Query Normalizer
-> Candidate Retrieval
-> AI Research Fallback
-> Evidence Verifier
-> Recommendation Gate
-> Compliance Advice
The evidence verifier can use Kimi to re-check whether the selected official sources appear to support the candidate tax rate. If the model is unavailable or times out, the app falls back to local evidence checks.
Generate draft VAT knowledge-base records from seed terms:
cd apps/api
python3 scripts/build_knowledge.py --limit 3The builder writes JSONL drafts to apps/api/data/knowledge_drafts/vat_drafts.jsonl. Records stay in needs_review until official sources and applicability are reviewed.
Kimi Code keys that start with sk-kimi- use the Kimi Code endpoint and kimi-for-coding model. That quota is intended for coding agents; for this product's server-side tax query pipeline, use a Kimi Platform key from platform.kimi.ai.
Never produce a final tax-rate answer without an evidence object. Low-confidence queries should return candidate classifications and clarifying questions rather than pretending to know the answer.