Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bazi Engine

基于 AI 的智能八字排盘系统。

支持:

  • 自然语言出生信息提取
  • 多轮对话槽位补全
  • 农历 / 公历识别
  • 真太阳时计算
  • 生辰八字排盘
  • AI 命理报告生成
  • RAG 古籍知识库(规划中)

技术栈

后端

技术 版本 用途
Python 3.11 主开发语言
FastAPI 0.116+ Web API 框架
SQLAlchemy 2.0+ ORM
psycopg 3.2+ PostgreSQL 驱动
PostgreSQL 14+ 主数据库
pgvector 0.8+ 向量检索
pydantic 2.11+ 数据校验
pydantic-settings 2.10+ 配置管理
uv latest Python 包管理
lunar-python latest 农历/八字计算
openai 1.82+ DeepSeek/OpenAI SDK

AI 模型

模型 用途
DeepSeek Chat Query Rewrite / 信息提取
BGE(规划中) 向量 Embedding
Rerank(规划中) 检索重排序

前端

技术 版本 用途
Vue3 latest 前端框架
Vite latest 构建工具
Element Plus latest UI 组件库
Axios latest HTTP 请求

核心功能

1. 自然语言出生信息提取

示例:

1999年生于浙江杭州

自动提取:

{
  "year": 1999,
  "province": "浙江",
  "city": "杭州"
}

2. 多轮槽位补全

缺失字段自动追问:

请问您的生日是农历还是公历?

3. AI 状态记忆

系统自动合并:

  • 年月日
  • 时间
  • 出生地
  • 农历/公历

形成完整排盘信息。


项目结构

app/
├── api/                # FastAPI 接口
├── config/             # 配置管理
├── db/                 # 数据库
├── llm/                # LLM 调用
├── prompts/            # Prompt 模板
├── services/           # 业务逻辑
└── main.py

启动项目

安装依赖

uv sync

启动 FastAPI

uvicorn app.main:app --reload

未来规划

  • 真太阳时计算
  • 八字排盘
  • 十神分析
  • 大运流年
  • AI 命理报告
  • RAG 古籍知识库
  • 向量检索
  • 多模型 Agent

About

基于 AI 的智能八字排盘系统

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages