完整指南
构建您自己的
垂直应用程序
使用18个核心技术栈服务构建医疗、法律、房地产或任何垂直AI应用的分步指南。从零到生产。
18
核心服务
7
阶段
2-4周
时间线
1
设置与架构
2-3天 · 基础设置和垂直规划
1.1. 安装Nexus-Forge
安装Nexus-Forge CLI,提供所有开发工具、Docker Compose设置和Claude Desktop集成。
npm install -g @adverant/nexus-forge
forge --version # Verify installation前提条件:Node.js 18+、Docker Desktop运行中、8GB+可用RAM
1.2. 创建您的垂直项目
选择垂直模板或从空白开始。模板包含特定行业的数据模型、API路由和示例查询。
# Interactive setup
forge create my-vertical
# Or specify a template
forge create healthcare-crm --template healthcare
forge create legal-research --template legal
forge create property-mgmt --template property
# Or start completely blank
forge create custom-vertical --template blank🏥
医疗模板
患者、预约、EHR、HIPAA合规
⚖️
法律模板
案件、文档、客户、事务管理
🏠
房地产模板
房源、租户、租约、维护
⚡
空白模板
仅使用核心技术栈从零开始
1.3. 了解可用的核心服务
所有18个核心服务自动可用。以下是每个服务为您的垂直应用提供的功能:
GraphRAG记忆
存储患者记录、案件文件、房产数据
MageAgent LLM网关
聊天界面、文档分析、摘要
多代理编排
复杂工作流、多步骤研究
视频智能
医学影像、房产参观、庭审录像
文档处理
PDF、扫描件、合同、表单
地理空间服务
房产位置、服务区域、路线规划
认证与RBAC
多租户工作区、用户权限
API Gateway
速率限制、负载均衡、路由
2
数据模型与认证
3-4天 · 定义数据结构和访问控制
2.1. 设计您的GraphRAG Schema
为您的垂直应用定义实体类型、关系和向量嵌入。GraphRAG同时提供PostgreSQL(结构化)和Neo4j(图)存储。
// src/schema/entities.ts
export const HealthcareSchema = {
entities: {
Patient: {
properties: ['name', 'dateOfBirth', 'medicalHistory'],
embeddings: ['medicalHistory', 'symptoms'],
relationships: ['HAS_APPOINTMENT', 'HAS_DIAGNOSIS']
},
Appointment: {
properties: ['datetime', 'status', 'notes'],
embeddings: ['notes', 'diagnosis'],
relationships: ['WITH_PATIENT', 'WITH_DOCTOR']
}
}
}
// Forge automatically creates:
// - PostgreSQL tables
// - Neo4j nodes/relationships
// - Qdrant vector collections
// - VoyageAI embedding pipelines2.2. 配置多租户认证
设置工作区、角色和权限。Auth服务自动处理JWT令牌、SSO集成和工作区隔离。
// src/config/auth.ts
export const authConfig = {
workspaces: {
enabled: true,
isolation: 'strict' // Each workspace = separate data
},
roles: {
admin: ['read', 'write', 'delete', 'manage_users'],
doctor: ['read', 'write', 'view_patients'],
nurse: ['read', 'write_limited'],
patient: ['read_own']
},
sso: {
providers: ['google', 'okta', 'auth0']
}
}
// Forge generates:
// - Login/signup API routes
// - JWT middleware
// - RBAC enforcement
// - Workspace switching UI3
AI集成
4-5天 · 连接LLM并构建智能功能
3.1. 配置AI模型
选择用于不同任务的AI模型。MageAgent通过OpenRouter、Anthropic和OpenAI提供320+模型的访问,并通过智能路由节省成本。
// src/config/ai.ts
export const aiConfig = {
chat: {
model: 'anthropic/claude-opus-4.6',
fallback: 'openai/gpt-4o'
},
analysis: {
model: 'anthropic/claude-opus-4',
temperature: 0.1
},
summarization: {
model: 'anthropic/claude-haiku-4', // Faster, cheaper
maxTokens: 1000
},
routing: {
enabled: true, // Intelligent cost optimization
costSavings: '45-60%'
}
}3.2. 构建多代理工作流
创建多个AI代理协作的工作流。示例:包含症状分析、研究和推荐代理的医疗诊断工作流。
// src/workflows/diagnosis.ts
export const diagnosisWorkflow = {
name: 'Medical Diagnosis Assistant',
agents: [
{
id: 'symptom-analyzer',
model: 'claude-opus-4',
task: 'Analyze patient symptoms and medical history',
tools: ['graphrag_query', 'vector_search']
},
{
id: 'research-agent',
model: 'gpt-4o',
task: 'Research similar cases in medical literature',
tools: ['web_search', 'document_fetch']
},
{
id: 'recommendation-agent',
model: 'claude-opus-4-6-20260206',
task: 'Generate treatment recommendations',
tools: ['graphrag_query', 'guideline_lookup']
}
],
orchestration: 'parallel', // Run simultaneously
synthesis: true // Combine results into final output
}
// Frontend shows real-time progress per agent4
前端构建
4-5天 · 创建用户界面
使用预构建组件构建您的React/Next.js前端,包含聊天界面、数据表格、表单和仪表板。TypeScript SDK提供完整的类型安全。
- 使用Forge UI组件库(50+预构建组件)
- 使用WebSocket流实现实时聊天
- 创建带无限滚动和筛选器的数据表格
- 添加与VideoAgent/FileProcessAgent集成的文件上传
- 构建带图表和指标的仪表板
5
高级功能
3-4天 · 添加专业化能力
视频处理
医学影像、房产参观、庭审录像
地理空间功能
地图、路线规划、基于位置的搜索
文档智能
OCR、表单提取、合同分析
通知
邮件、短信、推送通知、Webhook
6
测试与质量保证
2-3天 · 确保质量和性能
单元测试
80%+
Vitest
集成测试
关键路径
Playwright
负载测试
1000+用户
k6
7
部署
1-2天 · 发布到生产环境
$ forge deploy --environment production
✓ Running pre-deployment checks...
✓ Building Docker images...
✓ Pushing to registry...
✓ Updating Kubernetes...
✓ Running smoke tests...
✓ Health checks passing...
🎉 Deployed to: https://my-vertical.adverant.cloud
📊 Dashboard: https://my-vertical.adverant.cloud/admin
📈 Metrics: https://metrics.adverant.cloud/my-vertical✓
零停机
1-1000+用户
自动扩展
内置
监控
准备好构建了吗?
安装Nexus-Forge,今天就开始构建您的垂直应用。全部18个核心服务已包含。
2-4周
构建时间
18
核心服务
550+
API端点
1M+
每应用用户数
