Files
AIRegulation-DocAnalysis/backend
ash66 c22b03dc07 feat: Migrate document parsing to Aliyun and update embedding configurations
- Updated LocalDocumentParser to include raw_layouts and artifact_prefix from settings.
- Added new documents with failure reasons and metadata to documents.json for better error tracking.
- Created a new documentation file detailing the Aliyun ingest implementation process.
- Updated RFC to reflect changes in the parsing backend and embedding dimensions.
- Modified tests to accommodate the new embedding dimension of 1024 and updated parser and chunk builder assertions.
- Verified migration configurations to ensure correct settings for embedding model and backend.
2026-05-18 22:30:28 +08:00
..
2026-05-14 15:07:34 +08:00
2026-05-14 15:07:34 +08:00
2026-05-14 15:07:34 +08:00
2026-05-14 15:07:34 +08:00

AI+合规智能中枢后端

backend 是当前正式使用的 FastAPI 后端目录,入口为 app.main:app

启动

pip install -r backend/requirements.txt
PYTHONPATH=backend uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

也可以直接使用根目录统一脚本:

./dev.sh start api --foreground

主要接口

  • GET /health
  • GET /
  • POST /api/v1/documents/upload
  • GET /api/v1/documents/list
  • GET /api/v1/documents/management-list
  • GET /api/v1/documents/download/{doc_id}
  • POST /api/v1/knowledge/search
  • POST /api/v1/knowledge/retrieval
  • POST /api/v1/agent/ask
  • POST /api/v1/agent/chat
  • GET /api/v1/agent/chat/stream

目录说明

backend/
├── app/
│   ├── api/          # FastAPI 路由与模型
│   ├── config/       # 配置与日志
│   ├── services/     # 文档处理、LLM、RAG、存储
│   └── workers/      # 任务相关代码
├── .env.example
├── requirements.txt
└── main.py

说明

  • 路由前缀保持为 /api/v1,以兼容当前前端。
  • backend/app/api/routes/docs.pyrag.pycompliance.pystatus.py 仍保留在仓库中,但不再作为主路由入口。