Yuxi 是一个基于大模型的智能知识库与知识图谱智能体开发平台,融合了 RAG 技术与知识图谱技术,基于 LangGraph v1 + Vue.js + FastAPI + LightRAG 架构构建。项目完全通过 Docker Compose 进行管理,支持热重载开发。
Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.
Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability.
Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use backwards-compatibility shims when you can just change the code.
Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task. Reuse existing abstractions where possible and follow the DRY principle.
本项目完全通过 Docker Compose 进行管理。所有开发和调试都应在运行的容器环境中进行。使用 docker compose up -d 命令进行构建和启动。
核心原则:
-
由于 api-dev 和 web-dev 服务均配置了热重载 (hot-reloading),本地修改代码后无需重启容器,服务会自动更新。应该先检查项目是否已经在后台启动(
docker ps),查看日志(docker logs api-dev --tail 100)具体的可以阅读 docker-compose.yml. -
开发完成之后必须进行 检查 -> 测试 -> Lint,以及端到端测试,测试脚本不完善时应完善脚本。位置:backend/test
- 使用 pnpm 管理
- API 接口规范:所有的 API 接口都应该定义在 web/src/apis 下面
- Icon 应该优先从 lucide-vue-next (推荐,但是需要注意尺寸)
- 样式使用 less,非特殊情况必须使用 base.css 中的颜色变量
- UI 设计规范详见 design
# 代码检查和格式化
make format # 格式化代码
# 直接在容器内执行命令
docker compose exec api uv run python test/your_script.py # 放在 test 文件夹注意:
- Python 代码要符合 pythonic 风格
- 尽量使用较新的语法,避免使用旧版本的语法(版本兼容到 3.12+)
- 更新 roadmap.md 文档记录本次修改,多个类似的功能更新已经补充在一起
- 开发完成后务必在 docker 中进行测试,可以读取 .env 获取管理员账户和密码
其他:
- 如果需要新建说明文档(仅开发者可见,非必要不创建),则保存在
docs/vibe文件夹下面 - 代码更新后要检查文档部分是否有需要更新的地方,文档的目录定义在
docs/.vitepress/config.mts中
- 参考 Conventional Commits 规范编写提交信息。
- 使用中文提交信息,标题简洁明了,描述具体改动内容和原因。