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:
2026-01-20 00:00:58 +08:00
parent 1ece9a4ae8
commit dfc0fe0b9a
289 changed files with 1897 additions and 41 deletions

View File

@@ -195,3 +195,4 @@ export const jwtService = new JWTService();

View File

@@ -325,5 +325,6 @@ export function getBatchItems<T>(

View File

@@ -78,3 +78,4 @@ export interface VariableValidation {

View File

@@ -199,3 +199,4 @@ export function createOpenAIStreamAdapter(

View File

@@ -205,3 +205,4 @@ export async function streamChat(

View File

@@ -23,3 +23,4 @@ export { THINKING_TAGS } from './types';

View File

@@ -98,3 +98,4 @@ export type SSEEventType =

View File

@@ -84,3 +84,4 @@ export async function moduleRoutes(fastify: FastifyInstance) {

View File

@@ -114,3 +114,4 @@ export interface PaginatedResponse<T> {

View File

@@ -161,3 +161,4 @@ export const ROLE_DISPLAY_NAMES: Record<UserRole, string> = {

View File

@@ -236,3 +236,4 @@ async function matchIntent(query: string): Promise<{

View File

@@ -90,3 +90,4 @@ export async function uploadAttachment(
}

View File

@@ -19,3 +19,4 @@ export { aiaRoutes };

View File

@@ -361,5 +361,6 @@ runTests().catch((error) => {

View File

@@ -340,5 +340,6 @@ Content-Type: application/json

View File

@@ -276,5 +276,6 @@ export const conflictDetectionService = new ConflictDetectionService();

View File

@@ -226,5 +226,6 @@ curl -X POST http://localhost:3000/api/v1/dc/tool-c/test/execute \

View File

@@ -280,5 +280,6 @@ export const streamAIController = new StreamAIController();

View File

@@ -189,5 +189,6 @@ logger.info('[SessionMemory] 会话记忆管理器已启动', {

View File

@@ -123,5 +123,6 @@ checkTableStructure();

View File

@@ -110,5 +110,6 @@ checkProjectConfig().catch(console.error);

View File

@@ -92,5 +92,6 @@ main();

View File

@@ -549,5 +549,6 @@ URL: https://iit.xunzhengyixue.com/api/v1/iit/patient-wechat/callback

View File

@@ -184,5 +184,6 @@ console.log('');

View File

@@ -501,5 +501,6 @@ export const patientWechatService = new PatientWechatService();

View File

@@ -146,5 +146,6 @@ testDifyIntegration().catch(error => {

View File

@@ -175,5 +175,6 @@ testIitDatabase()

View File

@@ -161,5 +161,6 @@ if (hasError) {

View File

@@ -187,5 +187,6 @@ async function testUrlVerification() {

View File

@@ -268,5 +268,6 @@ main().catch((error) => {

View File

@@ -152,5 +152,6 @@ Write-Host ""

View File

@@ -245,5 +245,6 @@ export interface CachedProtocolRules {

View File

@@ -60,3 +60,4 @@ export default async function healthRoutes(fastify: FastifyInstance) {

View File

@@ -138,3 +138,4 @@ Content-Type: application/json

View File

@@ -123,3 +123,4 @@ Write-Host " - 删除任务: DELETE $BaseUrl/api/v1/rvw/tasks/{taskId}" -Foregr

View File

@@ -37,3 +37,4 @@ export * from './services/utils.js';

View File

@@ -128,3 +128,4 @@ export function validateAgentSelection(agents: string[]): void {

View File

@@ -426,5 +426,6 @@ SET session_replication_role = 'origin';

View File

@@ -128,5 +128,6 @@ WHERE key = 'verify_test';

View File

@@ -271,5 +271,6 @@ verifyDatabase()

View File

@@ -61,5 +61,6 @@ export {}