Vercel-AI-SDKRAG知识库系统本页总览RAG知识库系统 案例 bash1. 搭 Next.js + AI SDK useChat2. 用 streamText 做普通聊天3. 建 resources 表4. 实现 chunkText5. 用 embedMany 写入知识库6. 用 embed + pgvector 做相似度检索7. 把检索结果塞进 streamText 的 context8. 前端展示流式答案9. 加 source / citation10. 升级成 tool calling Agent