feat(pkb): Integrate pgvector and create Dify replacement plan
Summary: - Migrate PostgreSQL to pgvector/pgvector:pg15 Docker image - Successfully install and verify pgvector 0.8.1 extension - Create comprehensive Dify-to-pgvector migration plan - Update PKB module documentation with pgvector status - Update system documentation with pgvector integration Key changes: - docker-compose.yml: Switch to pgvector/pgvector:pg15 image - Add EkbDocument and EkbChunk data model design - Design R-C-R-G hybrid retrieval architecture - Add clinical data JSONB fields (pico, studyDesign, regimen, safety, criteria, endpoints) - Create detailed 10-day implementation roadmap Documentation updates: - PKB module status: pgvector RAG infrastructure ready - System status: pgvector 0.8.1 integrated - New: Dify replacement development plan (01-Dify替换为pgvector开发计划.md) - New: Enterprise medical knowledge base solution V2 Tested: PostgreSQL with pgvector verified, frontend and backend functionality confirmed
This commit is contained in:
@@ -51,5 +51,6 @@ Status: Day 1 complete (11/11 tasks), ready for Day 2
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -281,5 +281,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
23
Dockerfile.postgres-pgvector
Normal file
23
Dockerfile.postgres-pgvector
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# 基于已有的 postgres:15-alpine 镜像构建 pgvector 版本
|
||||||
|
# pgvector 版本:0.8.0(与阿里云 RDS PostgreSQL 15 保持一致)
|
||||||
|
FROM postgres:15-alpine
|
||||||
|
|
||||||
|
# 使用阿里云镜像源加速 Alpine 包下载
|
||||||
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
|
|
||||||
|
# 复制本地下载的 pgvector 源码包
|
||||||
|
COPY pgvector-0.8.0.tar.gz /tmp/pgvector-0.8.0.tar.gz
|
||||||
|
|
||||||
|
# 安装编译依赖并编译 pgvector(禁用 LLVM bitcode 编译)
|
||||||
|
RUN apk add --no-cache --virtual .build-deps \
|
||||||
|
build-base \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& tar -xzf pgvector-0.8.0.tar.gz \
|
||||||
|
&& cd pgvector-0.8.0 \
|
||||||
|
&& sed -i 's/^with_llvm.*/with_llvm = no/' /usr/local/lib/postgresql/pgxs/src/Makefile.global \
|
||||||
|
&& make USE_PGXS=1 PG_CONFIG=/usr/local/bin/pg_config \
|
||||||
|
&& make USE_PGXS=1 PG_CONFIG=/usr/local/bin/pg_config install \
|
||||||
|
&& cd / \
|
||||||
|
&& rm -rf /tmp/pgvector-0.8.0 /tmp/pgvector-0.8.0.tar.gz \
|
||||||
|
&& apk del .build-deps
|
||||||
|
|
||||||
@@ -227,5 +227,6 @@ https://iit.xunzhengyixue.com/api/v1/iit/health
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -156,5 +156,6 @@ https://iit.xunzhengyixue.com/api/v1/iit/health
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,5 +57,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -317,5 +317,6 @@ npx tsx src/modules/iit-manager/test-patient-wechat-url-verify.ts
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -179,5 +179,6 @@ npm run dev
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -58,3 +58,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,3 +52,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,3 +47,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,3 +79,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,3 +42,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -83,3 +83,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,3 +30,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -118,3 +118,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,3 +89,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,3 +75,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -117,3 +117,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,3 +28,4 @@ ON CONFLICT (id) DO NOTHING;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -60,3 +60,4 @@ ON CONFLICT (id) DO NOTHING;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,5 +76,6 @@ WHERE table_schema = 'dc_schema'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,5 +114,6 @@ ORDER BY ordinal_position;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -127,5 +127,6 @@ runMigration()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,5 +61,6 @@ COMMENT ON COLUMN "dc_schema"."dc_tool_c_sessions"."column_mapping" IS '列名
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,5 +88,6 @@ COMMENT ON COLUMN dc_schema.dc_tool_c_sessions.expires_at IS '过期时间(创
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -128,5 +128,6 @@ Write-Host ""
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -238,5 +238,6 @@ function extractCodeBlocks(obj, blocks = []) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,3 +37,4 @@ CREATE TABLE IF NOT EXISTS platform_schema.job_common (
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -111,3 +111,4 @@ CREATE OR REPLACE FUNCTION platform_schema.delete_queue(queue_name text) RETURNS
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -257,5 +257,6 @@ checkDCTables();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ CREATE SCHEMA IF NOT EXISTS capability_schema;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -209,5 +209,6 @@ createAiHistoryTable()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -196,5 +196,6 @@ createToolCTable()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -193,5 +193,6 @@ createToolCTable()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -315,3 +315,4 @@ main()
|
|||||||
})
|
})
|
||||||
.finally(() => prisma.$disconnect());
|
.finally(() => prisma.$disconnect());
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -122,3 +122,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -342,3 +342,4 @@ runTests().catch(error => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,3 +88,4 @@ testAPI().catch(console.error);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -118,3 +118,4 @@ async function testDeepSearch() {
|
|||||||
// ========== 运行 ==========
|
// ========== 运行 ==========
|
||||||
testDeepSearch().catch(console.error);
|
testDeepSearch().catch(console.error);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -307,3 +307,4 @@ verifySchemas()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -195,3 +195,4 @@ export const jwtService = new JWTService();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -325,5 +325,6 @@ export function getBatchItems<T>(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -78,3 +78,4 @@ export interface VariableValidation {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -199,3 +199,4 @@ export function createOpenAIStreamAdapter(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -205,3 +205,4 @@ export async function streamChat(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,3 +23,4 @@ export { THINKING_TAGS } from './types';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -98,3 +98,4 @@ export type SSEEventType =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -84,3 +84,4 @@ export async function moduleRoutes(fastify: FastifyInstance) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,3 +114,4 @@ export interface PaginatedResponse<T> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -161,3 +161,4 @@ export const ROLE_DISPLAY_NAMES: Record<UserRole, string> = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -236,3 +236,4 @@ async function matchIntent(query: string): Promise<{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -90,3 +90,4 @@ export async function uploadAttachment(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,3 +19,4 @@ export { aiaRoutes };
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -361,5 +361,6 @@ runTests().catch((error) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -302,5 +302,6 @@ runTest()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -340,5 +340,6 @@ Content-Type: application/json
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -276,5 +276,6 @@ export const conflictDetectionService = new ConflictDetectionService();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -226,5 +226,6 @@ curl -X POST http://localhost:3000/api/v1/dc/tool-c/test/execute \
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -280,5 +280,6 @@ export const streamAIController = new StreamAIController();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -189,5 +189,6 @@ logger.info('[SessionMemory] 会话记忆管理器已启动', {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -123,5 +123,6 @@ checkTableStructure();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -110,5 +110,6 @@ checkProjectConfig().catch(console.error);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,5 +92,6 @@ main();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -549,5 +549,6 @@ URL: https://iit.xunzhengyixue.com/api/v1/iit/patient-wechat/callback
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -184,5 +184,6 @@ console.log('');
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -501,5 +501,6 @@ export const patientWechatService = new PatientWechatService();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -146,5 +146,6 @@ testDifyIntegration().catch(error => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -175,5 +175,6 @@ testIitDatabase()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -161,5 +161,6 @@ if (hasError) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -187,5 +187,6 @@ async function testUrlVerification() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -268,5 +268,6 @@ main().catch((error) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -152,5 +152,6 @@ Write-Host ""
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -245,5 +245,6 @@ export interface CachedProtocolRules {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -60,3 +60,4 @@ export default async function healthRoutes(fastify: FastifyInstance) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -138,3 +138,4 @@ Content-Type: application/json
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -123,3 +123,4 @@ Write-Host " - 删除任务: DELETE $BaseUrl/api/v1/rvw/tasks/{taskId}" -Foregr
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,3 +37,4 @@ export * from './services/utils.js';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -128,3 +128,4 @@ export function validateAgentSelection(agents: string[]): void {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -426,5 +426,6 @@ SET session_replication_role = 'origin';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -128,5 +128,6 @@ WHERE key = 'verify_test';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -271,5 +271,6 @@ verifyDatabase()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
backend/src/types/global.d.ts
vendored
1
backend/src/types/global.d.ts
vendored
@@ -61,5 +61,6 @@ export {}
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -84,5 +84,6 @@ Write-Host "✅ 完成!" -ForegroundColor Green
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,3 +11,4 @@ SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT IN ('p
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -174,3 +174,4 @@ DELETE {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{testKbId}}
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -371,5 +371,6 @@ runAdvancedTests().catch(error => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -437,5 +437,6 @@ runAllTests()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -395,5 +395,6 @@ runAllTests()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,3 +31,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,3 +29,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,3 +41,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,3 +30,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -170,3 +170,4 @@ main()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
backup_before_pgvector_20260119.sql
Normal file
BIN
backup_before_pgvector_20260119.sql
Normal file
Binary file not shown.
@@ -179,5 +179,6 @@ Set-Location ..
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# PostgreSQL 数据库
|
# PostgreSQL 数据库 (with pgvector extension)
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15-alpine
|
image: pgvector/pgvector:pg15
|
||||||
container_name: ai-clinical-postgres
|
container_name: ai-clinical-postgres
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: ai_clinical_research
|
POSTGRES_DB: ai_clinical_research
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# AIclinicalresearch 系统当前状态与开发指南
|
# AIclinicalresearch 系统当前状态与开发指南
|
||||||
|
|
||||||
> **文档版本:** v3.7
|
> **文档版本:** v3.8
|
||||||
> **创建日期:** 2025-11-28
|
> **创建日期:** 2025-11-28
|
||||||
> **维护者:** 开发团队
|
> **维护者:** 开发团队
|
||||||
> **最后更新:** 2026-01-18
|
> **最后更新:** 2026-01-19
|
||||||
> **重大进展:** 🎉 **ASL 智能文献检索(DeepSearch)MVP 完成!**
|
> **重大进展:** 🎉 **pgvector 向量数据库集成完成!PKB RAG 基础设施就绪!**
|
||||||
> - 🆕 集成 unifuncs DeepSearch API,AI 驱动的 PubMed 自动检索
|
> - 🆕 pgvector 0.8.1 已安装,支持 HNSW/IVFFlat 索引
|
||||||
> - ✅ SSE 实时流式显示 AI 思考过程
|
> - ✅ 与阿里云 RDS pgvector 0.8.0 完全兼容
|
||||||
> - ✅ 自然语言输入,自动生成检索策略
|
> - ✅ PKB 模块 RAG 检索功能基础设施已就绪
|
||||||
> **部署状态:** ✅ 生产环境运行中 | 公网地址:http://8.140.53.236/
|
> **部署状态:** ✅ 生产环境运行中 | 公网地址:http://8.140.53.236/
|
||||||
> **文档目的:** 快速了解系统当前状态,为新AI助手提供上下文
|
> **文档目的:** 快速了解系统当前状态,为新AI助手提供上下文
|
||||||
|
|
||||||
@@ -100,7 +100,8 @@
|
|||||||
- 架构:增量演进(legacy + common + modules)
|
- 架构:增量演进(legacy + common + modules)
|
||||||
|
|
||||||
**数据库**:
|
**数据库**:
|
||||||
- PostgreSQL 15 (Docker: postgres:15-alpine)
|
- PostgreSQL 15 (Docker: pgvector/pgvector:pg15)
|
||||||
|
- **pgvector 0.8.1** ✅ 2026-01-19 新增(向量数据库扩展,支持 RAG)
|
||||||
- 12个Schema隔离(platform/aia/pkb/asl/dc/iit/ssa/st/rvw/admin/common/capability ✅新增)
|
- 12个Schema隔离(platform/aia/pkb/asl/dc/iit/ssa/st/rvw/admin/common/capability ✅新增)
|
||||||
|
|
||||||
**云原生部署**:
|
**云原生部署**:
|
||||||
@@ -120,9 +121,52 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🚀 当前开发状态(2026-01-18)
|
## 🚀 当前开发状态(2026-01-19)
|
||||||
|
|
||||||
### 🏆 最新进展:AIA V2.1 Prompt管理集成(2026-01-18)
|
### 🏆 最新进展:pgvector 向量数据库集成(2026-01-19)
|
||||||
|
|
||||||
|
#### ✅ pgvector 0.8.1 安装成功
|
||||||
|
|
||||||
|
**背景**:
|
||||||
|
- PKB 模块需要实现 RAG 检索功能
|
||||||
|
- 原计划依赖 Dify 知识库,现改为 PostgreSQL 原生 pgvector 方案
|
||||||
|
- 与 Postgres-Only 架构理念一致,减少外部依赖
|
||||||
|
|
||||||
|
**完成工作**:
|
||||||
|
- ✅ Docker 镜像迁移:`postgres:15-alpine` → `pgvector/pgvector:pg15`
|
||||||
|
- ✅ pgvector 扩展安装:版本 0.8.1
|
||||||
|
- ✅ 数据安全:执行双重备份(SQL dump + Volume tarball)
|
||||||
|
- ✅ 功能验证:前后端服务重启后功能全部正常
|
||||||
|
- ✅ 数据完整性:用户数据、pg-boss 队列函数全部正常
|
||||||
|
|
||||||
|
**技术细节**:
|
||||||
|
| 项目 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| Docker 镜像 | `pgvector/pgvector:pg15` |
|
||||||
|
| pgvector 版本 | 0.8.1 |
|
||||||
|
| 支持索引类型 | HNSW、IVFFlat |
|
||||||
|
| 最大向量维度 | 16000 维 |
|
||||||
|
| 阿里云 RDS 兼容性 | ✅ 完全兼容(RDS 为 0.8.0) |
|
||||||
|
|
||||||
|
**版本兼容性说明**:
|
||||||
|
- 开发环境:pgvector 0.8.1
|
||||||
|
- 生产环境(阿里云 RDS):pgvector 0.8.0
|
||||||
|
- 兼容性:0.8.x 系列向后兼容,数据格式和 API 一致
|
||||||
|
|
||||||
|
**文件变更**:
|
||||||
|
- `docker-compose.yml`:更新 postgres 服务镜像
|
||||||
|
- `Dockerfile.postgres-pgvector`:自定义构建文件(备用)
|
||||||
|
- `backup_before_pgvector_20260119.sql`:迁移前备份
|
||||||
|
- `postgres_volume_backup_20260119.tar`:Volume 备份
|
||||||
|
|
||||||
|
**下一步**:
|
||||||
|
- 设计 `pkb_schema.document_embeddings` 向量表
|
||||||
|
- 集成 Embedding 服务(OpenAI/智谱)
|
||||||
|
- 实现 RAG 检索 API
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 🏆 历史进展:AIA V2.1 Prompt管理集成(2026-01-18)
|
||||||
|
|
||||||
#### ✅ AIA 模块 Prompt 管理系统集成
|
#### ✅ AIA 模块 Prompt 管理系统集成
|
||||||
|
|
||||||
@@ -378,7 +422,7 @@ data: [DONE]\n\n
|
|||||||
|
|
||||||
**详细文档:** [AIA模块状态与开发指南](../../03-业务模块/AIA-AI智能问答/00-模块当前状态与开发指南.md)
|
**详细文档:** [AIA模块状态与开发指南](../../03-业务模块/AIA-AI智能问答/00-模块当前状态与开发指南.md)
|
||||||
|
|
||||||
#### 3. PKB模块 - 个人知识库 🎉 **前端V3设计完成!**
|
#### 3. PKB模块 - 个人知识库 🎉 **pgvector RAG基础设施就绪!**
|
||||||
|
|
||||||
**开发进度**:
|
**开发进度**:
|
||||||
- ✅ **后端API**:100%完成(v1 + v2双路由运行)
|
- ✅ **后端API**:100%完成(v1 + v2双路由运行)
|
||||||
@@ -387,7 +431,7 @@ data: [DONE]\n\n
|
|||||||
- ✅ **全文阅读模式**:90%完成(Chat组件集成)
|
- ✅ **全文阅读模式**:90%完成(Chat组件集成)
|
||||||
- ✅ **逐篇精读模式**:85%完成(文档选择+对话)
|
- ✅ **逐篇精读模式**:85%完成(文档选择+对话)
|
||||||
- 🔧 **批处理模式**:70%完成(UI完成,API待调试)
|
- 🔧 **批处理模式**:70%完成(UI完成,API待调试)
|
||||||
- ❌ **RAG检索模式**:0%(后端待实现)
|
- 🟡 **RAG检索模式**:基础设施就绪(pgvector 0.8.1 已安装),业务逻辑待实现
|
||||||
|
|
||||||
**核心功能**:
|
**核心功能**:
|
||||||
- 知识库CRUD + 文档管理
|
- 知识库CRUD + 文档管理
|
||||||
@@ -400,11 +444,12 @@ data: [DONE]\n\n
|
|||||||
- ✅ Zustand状态管理
|
- ✅ Zustand状态管理
|
||||||
- ✅ 复用shared/components/Chat通用组件
|
- ✅ 复用shared/components/Chat通用组件
|
||||||
- ✅ 单层Header + 紧凑工作模式栏设计
|
- ✅ 单层Header + 紧凑工作模式栏设计
|
||||||
|
- ✅ **pgvector 0.8.1 已集成**(2026-01-19)
|
||||||
|
|
||||||
**待解决问题**:
|
**待解决问题**:
|
||||||
- 🔧 批处理API执行待调试
|
- 🔧 批处理API执行待调试
|
||||||
- 🔧 知识资产页面导航条待完善
|
- 🔧 知识资产页面导航条待完善
|
||||||
- 🔧 UI与原型图精细化对比
|
- 🔧 RAG 检索业务逻辑待实现(向量表设计、Embedding服务)
|
||||||
|
|
||||||
**详细文档**:[PKB模块当前状态](../03-业务模块/PKB-个人知识库/00-模块当前状态与开发指南.md)
|
**详细文档**:[PKB模块当前状态](../03-业务模块/PKB-个人知识库/00-模块当前状态与开发指南.md)
|
||||||
|
|
||||||
@@ -896,7 +941,8 @@ AIclinicalresearch/
|
|||||||
| **2026-01-02** | **REDCap对接方案** 🏆 | ✅ REDCap环境部署 + DET+REST API方案确定 |
|
| **2026-01-02** | **REDCap对接方案** 🏆 | ✅ REDCap环境部署 + DET+REST API方案确定 |
|
||||||
| **2026-01-07 上午** | **PKB前端V3** 🎉 | ✅ PKB模块前端V3设计实现完成(Dashboard+Workspace+3种工作模式) |
|
| **2026-01-07 上午** | **PKB前端V3** 🎉 | ✅ PKB模块前端V3设计实现完成(Dashboard+Workspace+3种工作模式) |
|
||||||
| **2026-01-07 下午** | **PKB批处理完善** 🏆 | ✅ 批处理完整流程调试通过(执行+进度+结果导出)+ 文档上传功能 + UI优化 |
|
| **2026-01-07 下午** | **PKB批处理完善** 🏆 | ✅ 批处理完整流程调试通过(执行+进度+结果导出)+ 文档上传功能 + UI优化 |
|
||||||
| **当前** | **PKB模块生产可用** | ✅ 核心功能全部实现(90%),具备生产环境部署条件 |
|
| **2026-01-19** | **pgvector集成** 🎉 | ✅ pgvector 0.8.1 安装成功,PKB RAG基础设施就绪 |
|
||||||
|
| **当前** | **PKB模块生产可用** | ✅ 核心功能全部实现(90%),pgvector已集成,RAG业务逻辑待开发 |
|
||||||
| **2026-01-07 晚** | **RVW模块开发完成** 🎉 | ✅ Phase 1-3完成(后端迁移+数据库扩展+前端重构) |
|
| **2026-01-07 晚** | **RVW模块开发完成** 🎉 | ✅ Phase 1-3完成(后端迁移+数据库扩展+前端重构) |
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -1001,7 +1047,8 @@ AIclinicalresearch/
|
|||||||
### 环境要求
|
### 环境要求
|
||||||
```
|
```
|
||||||
Node.js: v22.18.0+
|
Node.js: v22.18.0+
|
||||||
PostgreSQL: 15+(当前使用15.14)
|
PostgreSQL: 15+(当前使用15.14,Docker镜像: pgvector/pgvector:pg15)
|
||||||
|
pgvector: 0.8.1(向量数据库扩展)
|
||||||
npm: 10+
|
npm: 10+
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -1194,14 +1241,15 @@ if (items.length >= 50) {
|
|||||||
|
|
||||||
## 🌟 技术亮点
|
## 🌟 技术亮点
|
||||||
|
|
||||||
1. ✅ **Platform-Only 架构**:统一任务管理,零代码重复 🏆 **新!**
|
1. ✅ **Platform-Only 架构**:统一任务管理,零代码重复 🏆
|
||||||
2. ✅ **智能双模式处理**:小任务快速响应,大任务可靠执行 🏆 **新!**
|
2. ✅ **智能双模式处理**:小任务快速响应,大任务可靠执行 🏆
|
||||||
3. ✅ **适配器模式**:存储/缓存/日志支持本地↔云端零代码切换
|
3. ✅ **pgvector 向量数据库**:PostgreSQL 原生 RAG 支持 🏆 **2026-01-19 新增!**
|
||||||
4. ✅ **10个Schema一次性完成**:架构一次到位
|
4. ✅ **适配器模式**:存储/缓存/日志支持本地↔云端零代码切换
|
||||||
5. ✅ **Prisma自动路由**:Schema迁移后,代码无需修改
|
5. ✅ **12个Schema隔离**:架构一次到位
|
||||||
6. ✅ **4个LLM集成**:DeepSeek、Qwen、GPT、Claude
|
6. ✅ **Prisma自动路由**:Schema迁移后,代码无需修改
|
||||||
7. ✅ **增量演进**:新旧并存,降低风险
|
7. ✅ **4个LLM集成**:DeepSeek、Qwen、GPT、Claude
|
||||||
8. ✅ **云原生就绪**:为SAE部署做好准备
|
8. ✅ **增量演进**:新旧并存,降低风险
|
||||||
|
9. ✅ **云原生就绪**:为SAE部署做好准备
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -1213,9 +1261,9 @@ if (items.length >= 50) {
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**文档版本**:v3.1
|
**文档版本**:v3.8
|
||||||
**最后更新**:2026-01-10
|
**最后更新**:2026-01-19
|
||||||
**下次更新**:RVW生产环境部署 或 ASL智能文献筛选模块启动
|
**下次更新**:PKB RAG检索功能实现 或 生产环境pgvector部署
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -618,5 +618,6 @@ async saveProcessedData(recordId, newData) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -231,3 +231,4 @@ const userId = 'test'; // ❌ 应该用 getUserId(request)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user