Files
AIclinicalresearch/backend/test-pkb-migration.http
HaHafeng dfc0fe0b9a 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
2026-01-20 00:00:58 +08:00

178 lines
4.8 KiB
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
###
# PKB - API
# v1v2<EFBFBD>?
###
@baseUrl = http://localhost:3000
@userId = user-mock-001
### ============================================
### 3.1: <EFBFBD>?
### ============================================
### 1. PKB v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/health
Accept: application/json
### ============================================
### 3.2: CRUD
### ============================================
### 2. v1<EFBFBD>?
GET {{baseUrl}}/api/v1/knowledge-bases
Accept: application/json
### 3. v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases
Accept: application/json
### 4. v2<EFBFBD>?
POST {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases
Content-Type: application/json
{
"name": "v2-{{$timestamp}}",
"description": "v2 API"
}
### 5. v1 - <EFBFBD>?
POST {{baseUrl}}/api/v1/knowledge-bases
Content-Type: application/json
{
"name": "v1-{{$timestamp}}",
"description": "v1 API"
}
### 6. v2<EFBFBD>?
# ID
@kbId = f6ebe476-c50f-4222-83d2-c2525edc6054
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}
Accept: application/json
### 7. v1 - <EFBFBD>?
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}
Accept: application/json
### 8. v2<EFBFBD>?
PUT {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}
Content-Type: application/json
{
"name": "v2",
"description": "v2 API<EFBFBD>?
}
### 9. v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/stats
Accept: application/json
### 10. v1 - <EFBFBD>?
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/stats
Accept: application/json
### ============================================
### 3.3: RAG<EFBFBD>?
### ============================================
### 11. RAGv2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=<EFBFBD>?top_k=5
Accept: application/json
### 12. RAGv1 - <EFBFBD>?
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/search?query=<EFBFBD>?top_k=5
Accept: application/json
### ============================================
### 3.4:
### ============================================
### 13. v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/document-selection?max_files=7&max_tokens=750000
Accept: application/json
### 14. v1 - <EFBFBD>?
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/document-selection?max_files=7&max_tokens=750000
Accept: application/json
### ============================================
### 3.5:
### ============================================
### 15.
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}
Accept: application/json
### 16. v2<EFBFBD>?
# ID
@docId = your-document-id
GET {{baseUrl}}/api/v1/pkb/knowledge/documents/{{docId}}
Accept: application/json
### ============================================
### 3.6: <EFBFBD>?
### ============================================
### 17. v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/batch-tasks/batch/templates
Accept: application/json
### 18. v2<EFBFBD>?
POST {{baseUrl}}/api/v1/pkb/batch-tasks/batch/execute
Content-Type: application/json
{
"kb_id": "{{kbId}}",
"document_ids": [],
"template_type": "preset",
"template_id": "clinical_research_method",
"model_type": "deepseek-v3",
"task_name": "v2"
}
### ============================================
### 3.7:
### ============================================
### 19. v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/00000000-0000-0000-0000-000000000000
Accept: application/json
### 20. v2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=&top_k=0
Accept: application/json
### 21. top_kv2<EFBFBD>?
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=&top_k=1000
Accept: application/json
### ============================================
### 3.8:
### ============================================
### 22. v2<EFBFBD>?
# @testKbId = ID
DELETE {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{testKbId}}
###