gobrave

command module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 3 Imported by: 0

README

gobrave

gobrave

Bioinformatics Reactive Analysis & Visualization Engine — built in Go

docs license go version status


🧬 What is gobrave?

gobrave is a high-performance bioinformatics platform that bridges the gap between pipeline engineering and scientific discovery. Built from the ground up in Go, it delivers unparalleled speed, a single-binary deployment, and a modern architecture designed for scale.

🚀 One binary. Zero friction. From raw data to publication-ready insights.

graph LR
    A[🧪 Upload Data] --> B[📊 Build DAG Pipeline]
    B --> C[🐳 Containerized Execution]
    C --> D[📈 Interactive Visualization]
    D --> E[🤖 AI Copilot Assistance]
    C --> F[🌐 Real-time Streaming]

✨ Why gobrave?

Traditional Platforms ⚡ gobrave
Multi-process deployment Single static binary
Complex dependency management Zero runtime deps
Limited concurrency model Native goroutine parallelism
Heavy memory footprint ~30 MB memory baseline
Lengthy install & config Download & run

🎯 Core Capabilities

⚙️ Visual DAG Workflow Engine

Design complex bioinformatics pipelines as directed acyclic graphs — no code required.

  • 🎨 Drag-and-drop node composition (R, Python, Shell)
  • 🔄 Automatic upstream → downstream data propagation
  • 💾 Smart caching: skip unchanged nodes, re-run only what's needed
  • 🧩 Scatter/gather patterns for parallel sample processing
  • ♻️ Crash recovery with heartbeat-based lease locking

🐳 Containerized Analysis Workspaces

Launch full analysis environments on demand, right from your pipeline.

  • RStudio Server · JupyterLab · VS Code Server — one-click launch
  • Docker & Kubernetes runtime support
  • Auto-provisioned reverse proxy (Traefik / K8s Ingress / built-in gateway)
  • User-namespaced, isolated containers with host UID mapping

🌐 Real-time Collaboration

Stay in sync with every event in the system.

  • WebSocket + SSE dual-transport realtime hub
  • Per-user connection pooling with automatic eviction
  • Live DAG execution progress, node status, and container events
  • Frontend actions bridged via unified event bus

📁 Data Management

Organize your research artifacts with project-scoped CRUD.

  • Datasets, Samples, Files — hierarchical, cross-referenced
  • Role-based file annotation (e.g. FASTQ_R1, FASTQ_R2)
  • Bulk import & project-level listing
  • Transactional integrity with cascading cleanup

🏗️ Architecture

┌─────────────────────────────────────────────────────────┐
│                     Frontend (SPA)                       │
├─────────────────────────────────────────────────────────┤
│  REST API  │  WebSocket  │  SSE  │  Reverse Proxy       │
├─────────────────────────────────────────────────────────┤
│  ┌─────────┬──────────┬──────────┬──────────────────┐   │
│  │   Auth   │ Project  │   Data   │    Analysis      │   │
│  ├─────────┼──────────┼──────────┼──────────────────┤   │
│  │ Container│ Workflow │ Realtime │    LLM Bridge    │   │
│  └─────────┴──────────┴──────────┴──────────────────┘   │
├─────────────────────────────────────────────────────────┤
│                  DAG Orchestrator                        │
│  ┌──────────┬──────────┬──────────┬────────────────┐    │
│  │ Scheduler│Dispatcher│WorkerPool│ State Machine  │    │
│  └──────────┴──────────┴──────────┴────────────────┘    │
├─────────────────────────────────────────────────────────┤
│              Container Runtime (Docker / K8s)            │
├─────────────────────────────────────────────────────────┤
│              Route Registry (Traefik / Gateway)          │
└─────────────────────────────────────────────────────────┘

🚀 Quick Start

Prerequisites

  • Go ≥ 1.25
  • MySQL 8.0+
  • Docker / Kubernetes / k3s (for containerized execution)

Install & Run

# Clone
git clone https://github.com/biox-dev/gobrave.git
cd gobrave

# Configure
cp config.example.yml config.yml
# Edit config.yml with your database & settings

# Run (it's that simple)
go run .

Install via go install

# Install the latest version into $GOPATH/bin (or $GOBIN)
go install github.com/biox-dev/gobrave@latest

# Configure
cp config.example.yml config.yml
# Edit config.yml with your database & settings

# Run
gobrave

Note: go install builds a plain binary without the embedded frontend. For a single executable with the frontend bundled, see Build a Single Executable with Embedded Frontend.

Build a Static Binary

# Build for your platform
go build -o gobrave .
# Run the binary
./gobrave

Build a Single Executable with Embedded Frontend

# 1) Build frontend artifacts into gobrave/frontend/web first (for example: copy brave-ui dist)
# 2) Build server with embedded frontend assets
go build -tags embed_frontend -o gobrave .

# Run as a single executable (no external web directory required at runtime)
./gobrave

Run with Docker

# Build Docker image
docker build -t gobrave:latest .
# Run container
docker run -d -p 8082:8082 --name gobrave gobrave:latest
docker run --rm -p 8082:8082  -it registry.cn-hangzhou.aliyuncs.com/wybioinfo/gobrave 

Usage in Linux:

docker run --rm -p 8082:8082 \
  -v /home/admin/gobrave_docker:/config \
  -e PUID=$(id -u) -e PGID=$(id -g) \
  -v /var/run/docker.sock:/var/run/docker.sock \
  registry.cn-hangzhou.aliyuncs.com/wybioinfo/gobrave

Usage in Windows:

docker run --rm -p 8082:8082 `
  -e PUID=0 `
  -e PGID=0 `
  -e GOBRAVE_BASE_DIR=/config/gobrave `
  -v /config:/config `
  -v /var/run/docker.sock:/var/run/docker.sock `
  registry.cn-hangzhou.aliyuncs.com/wybioinfo/gobrave

Run with Command-Line Database Configuration

You can override database settings directly via CLI flags — no config file needed. Timezone is fixed to UTC in all database DSNs.

# 1) Start MySQL via Docker
docker run -d --rm -p 53306:3306 \
   --name mysql \
   -e MYSQL_ROOT_PASSWORD=123456 \
   -e LANG=C.UTF-8 \
   --shm-size=10G \
   -v /home/admin/data/mysql:/var/lib/mysql \
   registry.cn-hangzhou.aliyuncs.com/wybioinfo/mysql:8.0.21 \
   --default-authentication-plugin=mysql_native_password \
   --character-set-server=utf8mb4 \
   --lower-case-table-names=1 \
   --collation-server=utf8mb4_unicode_ci
# 2) Create database
docker exec -it mysql mysql -uroot -p123456 -e "CREATE DATABASE brave CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

# 3) Download the latest release (single binary with embedded frontend)
wget https://github.com/biox-dev/gobrave/releases/download/v0.1.0/gobrave-v0.1.0-linux-amd64-embed -O gobrave
chmod +x gobrave

# 4) Run gobrave with CLI-specified database (no config.yml needed)
export GOBRAVE_BASE_DIR=/home/admin/.brave
./gobrave \
   --db-driver=mysql \
   --db-host=localhost \
   --db-port=53306 \
   --db-user=root \
   --db-password=123456 \
   --db-name=brave \
   --runtime=docker

Note: The database timezone is hardcoded to UTC in the connection string (loc=UTC for MySQL, TimeZone=UTC for PostgreSQL). Make sure your application logic accounts for UTC timestamps.

Available CLI flags for database:

Flag Description Default (MySQL)
--db-driver Database driver: mysql, postgres, or sqlite sqlite
--db-host Database host 127.0.0.1
--db-port Database port 3306
--db-user Database user —
--db-password Database password —
--db-name Database name —
--db-path SQLite database file path $GOBRAVE_BASE_DIR/db/gobrave.db
--db-ssl-mode SSL mode (PostgreSQL only) disable
--runtime Container runtime: docker, k8s, or k3s docker

Runtime Environment

K3s

# Install k3s (lightweight Kubernetes)
curl -sfL https://get.k3s.io | sh -
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
# Check k3s status
kubectl get nodes

# Check kubectl version
kubectl version --client

📖 Documentation

Full documentation at gobrave.dev


🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


📄 License

gobrave is open-source under the MIT License.


Built with ❤️ by the gobrave team · Powered by Go

Documentation

Overview

@title AiAgentGo API @version 1.0 @description AiAgentGo 是一个基于 Go 语言构建的 AI Agent 框架,旨在提供高性能、可扩展的解决方案,帮助开发者快速构建智能代理应用。 @termsOfService http://swagger.io/terms/

@contact.name AiAgentGo Github @contact.url https://github.com/minebiome/ai-agent-go

@BasePath /api/v1

@securityDefinitions.apikey Bearer @in header @name Authorization @description 用户登录认证:输入 Bearer {token} 格式的 JWT 令牌

@securityDefinitions.apikey ApiKeyAuth @in header @name X-API-Key @description 租户身份认证:输入 sk- 开头的 API Key

Directories

Path Synopsis
Package builtin 打包随二进制分发的内置静态资源(内置提示词、内置技能与内置容器模板)。
Package builtin 打包随二进制分发的内置静态资源(内置提示词、内置技能与内置容器模板)。
cmd
desktop command
Command desktop 是 brave 的 Wails v3 桌面客户端入口。
Command desktop 是 brave 的 Wails v3 桌面客户端入口。
desktop/backend
Package backend 负责 brave 桌面壳与后端服务之间的连接。
Package backend 负责 brave 桌面壳与后端服务之间的连接。
desktop/windows
Package windows 为桌面端提供「多窗口」能力。
Package windows 为桌面端提供「多窗口」能力。
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
agent/application/repository
Package repository 提供 agent 域各持久化端口的基于数据库(GORM)的实现。
Package repository 提供 agent 域各持久化端口的基于数据库(GORM)的实现。
agent/logging
Package logging 是 opencode internal/logging 的最小替代。
Package logging 是 opencode internal/logging 的最小替代。
agent/lsp
Generated code.
Generated code.
agent/mcp
Package mcp 把外部 MCP(Model Context Protocol)服务提供的工具接入 gobrave 的 工具框架(从 opencode internal/llm/agent/mcp-tools.go 迁移)。
Package mcp 把外部 MCP(Model Context Protocol)服务提供的工具接入 gobrave 的 工具框架(从 opencode internal/llm/agent/mcp-tools.go 迁移)。
agent/native
Package native 是 gobrave 的原生 Agent 执行循环。
Package native 是 gobrave 的原生 Agent 执行循环。
agent/policy
Package policy 提供 PermissionPolicy 的内置实现。
Package policy 提供 PermissionPolicy 的内置实现。
agent/providers
Package providers 提供 agentclient.Provider 的内置实现。
Package providers 提供 agentclient.Provider 的内置实现。
agent/skill
Package skill 实现 Agent Skills 开放标准(https://agentskills.io)。
Package skill 实现 Agent Skills 开放标准(https://agentskills.io)。
agent/tool
Package tool 定义 Agent 工具调用(function calling)的基础设施。
Package tool 定义 Agent 工具调用(function calling)的基础设施。
agent/tool/builtin
Package builtin 提供框架内置的工具(如 get_weather)。
Package builtin 提供框架内置的工具(如 get_weather)。
agent/tool/coder
Package coder 提供从 opencode 迁移的编码类工具(bash / edit / view / write / patch / glob / grep / ls / fetch / sourcegraph / diagnostics)。
Package coder 提供从 opencode 迁移的编码类工具(bash / edit / view / write / patch / glob / grep / ls / fetch / sourcegraph / diagnostics)。
agent/tool/coder/diff
Package diff 提供文件补丁解析与应用能力(从 opencode internal/diff 迁移)。
Package diff 提供文件补丁解析与应用能力(从 opencode internal/diff 迁移)。
agent/types
Package types 定义 Agent 领域的数据库实体与值对象。
Package types 定义 Agent 领域的数据库实体与值对象。
agent/types/interface
Package interfaces 定义 Agent 领域的 Repository / Service 端口。
Package interfaces 定义 Agent 领域的 Repository / Service 端口。
appsrv
Package appsrv 负责以「库函数调用」方式启动 gobrave 后端服务。
Package appsrv 负责以「库函数调用」方式启动 gobrave 后端服务。
container
Package container 是进程级依赖装配(composition root):把业务服务、DAG 运行时 与 Agent 能力装配到一起,并提供 BuildContainer 入口。
Package container 是进程级依赖装配(composition root):把业务服务、DAG 运行时 与 Agent 能力装配到一起,并提供 BuildContainer 入口。
container/agentanalysis
Package agentanalysis 提供 Agent 内置工具所需的「分析节点」能力: 运行节点(run_analysis_node)、生成节点参数(build_analysis_node_params)、 更新节点信息(update_agent_analysis / update_script_analysis)、为已有脚本创建节点(create_script_analysis), 以及创建命令型节点并可选运行(create_agent_analysis)。
Package agentanalysis 提供 Agent 内置工具所需的「分析节点」能力: 运行节点(run_analysis_node)、生成节点参数(build_analysis_node_params)、 更新节点信息(update_agent_analysis / update_script_analysis)、为已有脚本创建节点(create_script_analysis), 以及创建命令型节点并可选运行(create_agent_analysis)。
container/agentscript
Package agentscript 提供 Agent 内置工具所需的脚本能力: 创建脚本(create_script)、更新脚本信息(update_script),以及脚本 io_schema.json 的默认模板与清洗逻辑。
Package agentscript 提供 Agent 内置工具所需的脚本能力: 创建脚本(create_script)、更新脚本信息(update_script),以及脚本 io_schema.json 的默认模板与清洗逻辑。
container_runtime/provision
Package provision 统一管理容器运行时的「安装 / 启动」生命周期。
Package provision 统一管理容器运行时的「安装 / 启动」生命周期。
container_runtime/provision/types
Package types 是 provision 各实现共享的最小类型集合。
Package types 是 provision 各实现共享的最小类型集合。
dag
dag/dag_orchestrator_v2_
Package orchestratorv2 implements the dynamic (Nextflow-like) DAG scheduler used by gobrave analyses.
Package orchestratorv2 implements the dynamic (Nextflow-like) DAG scheduler used by gobrave analyses.
dag/trace
Package trace provides the append-only, table-shaped run trace shared by the DAG schedulers.
Package trace provides the append-only, table-shaped run trace shared by the DAG schedulers.
exportcodec
Package exportcodec 定义「导出文件格式版本」的策略(Codec)与注册表(Registry)。
Package exportcodec 定义「导出文件格式版本」的策略(Codec)与注册表(Registry)。
exportcodec/v1
Package v1 实现导出文件格式 v1(exportcodec.VersionV1)的 Codec 策略。
Package v1 实现导出文件格式 v1(exportcodec.VersionV1)的 Codec 策略。
fsm
htmlreport
Package htmlreport renders a project report into a standalone HTML document.
Package htmlreport renders a project report into a standalone HTML document.
runtime
Package runtime 提供应用程序运行时的依赖注入容器 该包使用 uber 的 dig 库来管理依赖项注入
Package runtime 提供应用程序运行时的依赖注入容器 该包使用 uber 的 dig 库来管理依赖项注入
test
client command
server command
tmp_repro command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL