Sprint 1-3 Completed (Backend + Frontend): Backend (Sprint 1-2): - Implement 5-layer Agent framework (Query->Planner->Executor->Tools->Reflection) - Create agent_schema with 6 tables (agent_definitions, stages, prompts, sessions, traces, reflexion_rules) - Create protocol_schema with 2 tables (protocol_contexts, protocol_generations) - Implement Protocol Agent core services (Orchestrator, ContextService, PromptBuilder) - Integrate LLM service adapter (DeepSeek/Qwen/GPT-5/Claude) - 6 API endpoints with full authentication - 10/10 API tests passed Frontend (Sprint 3): - Add Protocol Agent entry in AgentHub (indigo theme card) - Implement ProtocolAgentPage with 3-column layout - Collapsible sidebar (Gemini style, 48px <-> 280px) - StatePanel with 5 stage cards (scientific_question, pico, study_design, sample_size, endpoints) - ChatArea with sync button and action cards integration - 100% prototype design restoration (608 lines CSS) - Detailed endpoints structure: baseline, exposure, outcomes, confounders Features: - 5-stage dialogue flow for research protocol design - Conversation-driven interaction with sync-to-protocol button - Real-time context state management - One-click protocol generation button (UI ready, backend pending) Database: - agent_schema: 6 tables for reusable Agent framework - protocol_schema: 2 tables for Protocol Agent - Seed data: 1 agent + 5 stages + 9 prompts + 4 reflexion rules Code Stats: - Backend: 13 files, 4338 lines - Frontend: 14 files, 2071 lines - Total: 27 files, 6409 lines Status: MVP core functionality completed, pending frontend-backend integration testing Next: Sprint 4 - One-click protocol generation + Word export
57 lines
1.7 KiB
Docker
57 lines
1.7 KiB
Docker
# PostgreSQL 15 with pgvector + pg_bigm extensions
|
||
# 用于 AI 临床研究平台的向量检索和中文关键词检索
|
||
#
|
||
# 扩展版本:
|
||
# - pgvector: 0.8.1 (向量相似度搜索)
|
||
# - pg_bigm: 1.2 (中日韩文本全文搜索)
|
||
#
|
||
# 构建命令:
|
||
# docker build -f Dockerfile.postgres-with-extensions -t ai-clinical-postgres:v1.1 .
|
||
#
|
||
# 使用方法:
|
||
# 1. 构建镜像后,修改 docker-compose.yml:
|
||
# image: ai-clinical-postgres:v1.1
|
||
# 2. 重启服务:docker compose down && docker compose up -d
|
||
# 3. 启用扩展:
|
||
# docker exec -it ai-clinical-postgres psql -U postgres -d ai_clinical_research -c "CREATE EXTENSION IF NOT EXISTS pg_bigm;"
|
||
|
||
FROM pgvector/pgvector:pg15
|
||
|
||
# 使用阿里云镜像源加速(如果在国内)
|
||
# RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/*.sources 2>/dev/null || true
|
||
|
||
# 安装编译依赖
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
build-essential \
|
||
postgresql-server-dev-15 \
|
||
wget \
|
||
ca-certificates \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# 下载并编译 pg_bigm
|
||
# pg_bigm 是专门为中日韩(CJK)字符优化的全文搜索扩展
|
||
RUN cd /tmp \
|
||
&& wget -q https://github.com/pgbigm/pg_bigm/archive/refs/tags/v1.2-20200228.tar.gz \
|
||
&& tar -xzf v1.2-20200228.tar.gz \
|
||
&& cd pg_bigm-1.2-20200228 \
|
||
&& make USE_PGXS=1 \
|
||
&& make USE_PGXS=1 install \
|
||
&& cd / \
|
||
&& rm -rf /tmp/pg_bigm* /tmp/v1.2-20200228.tar.gz
|
||
|
||
# 清理编译依赖
|
||
RUN apt-get purge -y --auto-remove \
|
||
build-essential \
|
||
postgresql-server-dev-15 \
|
||
wget \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# 添加初始化脚本(自动创建扩展)
|
||
COPY docker-init-extensions.sql /docker-entrypoint-initdb.d/
|
||
|
||
# 暴露端口
|
||
EXPOSE 5432
|
||
|
||
|
||
|