feat: add new folder

This commit is contained in:
Daniel
2026-03-30 20:49:40 +08:00
commit c7788fdd92
64 changed files with 19910 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# 架构说明
## 总体架构
项目采用前后端分离部署:
- `apps/api`FastAPI 服务,负责抽取、入库、匹配、解释、查询
- `apps/web`React/Vite 控制台,负责 POC 演示
- `postgres`:结构化数据持久化
- `qdrant`LightRAG 风格向量召回层
## 后端分层
- `api`HTTP 路由
- `services`抽取、入库、匹配、RAG 适配
- `repositories`:数据库读写
- `domain`Pydantic schema 与 SQLAlchemy model
## 抽取链路
1. 读取 `packages/prompts`
2. 若配置了外部 LLM则走 OpenAI 兼容结构化抽取
3. 如果外部 LLM 不可用,则回退到本地规则抽取
4. 所有输出统一走 Pydantic 校验
## RAG 方案
当前 POC 使用 `LightRAGAdapter` 作为轻量适配层:
- 结构化卡片先落 PostgreSQL
- 关键信息序列化后写入 Qdrant
- 使用技能近义词图做扩展召回
- 对召回结果进入规则打分排序
## 匹配公式
```text
MatchScore =
0.35 * SkillScore
+ 0.20 * RegionScore
+ 0.15 * TimeScore
+ 0.15 * ExperienceScore
+ 0.15 * ReliabilityScore
```
## 部署方式
- 本地:`infrastructure/docker-compose.yml`
- 生产:`infrastructure/docker-compose.prod.yml`
- 前端通过 Nginx 独立容器部署,并反向代理 API保持前后端分离