feat: RAG 文献问答、天体目标识别、解析器模块化与批量管线扩展

核心新增:
  - RAG 问答系统:Markdown 安全切片器 (LaTeX 保护) + 向量化 + sqlite-vec 检索 + LLM 生成
  - 天体目标识别:IAU 标准正则提取 15+ 星表标识符,CDS SIMBAD/Sesame 查询与本地缓存
  - 多模态 LLM:chat_completion_with_image 支持图表视觉分析
  - CLI Skills Agent (cli.rs):对外暴露 rag/target/ingest 等 5 个子命令
  - 解析器模块化重构:单体 778 行 → 按期刊拆分 (A&A/ar5iv/IOP/Generic/PDF) +
    common.rs 静态正则工具库

  管线与 Schema:
  - AssetSync→AssetBatch 重命名,批量管线新增 embed/target 两个处理阶段
  - 新增 paper_chunks_content (RAG 切片) 和 paper_targets (天体缓存) 两张表
  - StandardPaper 新增 has_vector 字段,所有查询同步更新

  前端:
  - 新增 AI 助手侧边栏 (RAG 问答 + 来源跳转高亮)
  - 最近浏览文献列表 (localStorage 持久化)、跨面板无缝导航
  - SyncPanel 批量阶段扩展为下拉选项,支持向量化/天体识别

  测试与清理:
  - 集成测试合并至 ads.rs 和 llm.rs,新增 chunker + target 单元测试 15 个
  - 删除旧单体 parser.rs、独立测试文件及过期 scratch 脚本
This commit is contained in:
fmq
2026-06-15 13:25:18 +08:00
parent 3f1935678b
commit 22e7e1dcee
45 changed files with 5289 additions and 1411 deletions
+6 -2
View File
@@ -15,8 +15,9 @@ path = "src/main.rs"
name = "health_check"
path = "src/bin/health_check.rs"
[[bin]]
name = "astroresearch_cli"
path = "src/bin/cli.rs"
[dependencies]
tokio = { version = "1", features = ["full"] }
axum = { version = "0.7", features = ["macros", "multipart"] }
@@ -47,6 +48,9 @@ uuid = { version = "1.23.2", features = ["v4"] }
tracing-appender = "0.2.5"
obscura-browser = { path = "libs/obscura/crates/obscura-browser", optional = true }
obscura-net = { path = "libs/obscura/crates/obscura-net", optional = true }
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }
sqlite-vec = "0.1.9"
clap = { version = "4", features = ["derive"] }
[features]
default = []