<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>pgvector on </title>
    <link>/tags/pgvector/</link>
    <description>Recent content in pgvector on </description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 05 Mar 2026 09:00:00 +0800</lastBuildDate><atom:link href="/tags/pgvector/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>用 Spring AI &#43; pgvector 落地 RAG 知识库：新加坡数学 AI 辅导 Phase 2 记录</title>
      <link>/posts/sg-math-tutor-phase2-rag-pgvector/</link>
      <pubDate>Thu, 05 Mar 2026 09:00:00 +0800</pubDate>
      
      <guid>/posts/sg-math-tutor-phase2-rag-pgvector/</guid>
      <description>回顾 Phase 1 搭建了 Java 25 + Spring AI 的多 Agent 解题管线。但当时 Planner Agent &amp;ldquo;裸跑&amp;rdquo;，没有任何参考题库。Phase 2 要解决的核心问题：让 Agent 带着&amp;quot;知识&amp;quot;回答问题。
具体目标：
导入 40 道 PSLE 真题/模拟题到向量数据库 解题前先做 RAG 检索，找到相似题作为 Prompt 上下文 按年级过滤，P5 请求不会看到 P6 难度的参考题 Redis 缓存相同题目的 AI 响应，避免重复调用 LLM 整体架构变化 graph TD A[SolveRequest] --&gt; B[SolveService - Redis @Cacheable] B --&gt;|Cache Miss| C[MathSolverOrchestrator] C --&gt; D[RagRetrievalService] D --&gt; E[(pgvector - vector_store)] D --&gt;|Top-5 相似题| F[Planner Agent + RAG Context] F --&gt; G{StructuredTaskScope} G --&gt; H[CPA Designer Agent] G --&gt; I[Persona Agent] H --&gt; J[SolveResult] I --&gt; J J --&gt; K[(Redis Cache - 24h TTL)] B --&gt;|Cache Hit| L[直接返回缓存结果] classDef cache fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#e65100 classDef rag fill:#e8f5e9,stroke:#388e3c,stroke-width:2px,color:#2e7d32 classDef agent fill:#ffffff,stroke:#1976d2,stroke-width:3px,color:#0d47a1 classDef db fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#4a148c class B,K,L cache class D,E rag class C,F,H,I agent class J db Phase 1 的数据流是 请求 → Planner → CPA + Persona → 响应。</description>
    </item>
    
  </channel>
</rss>
