gitlabhq/orbit-knowledge-graph

GitHub: gitlabhq/orbit-knowledge-graph

GitLab Orbit 将 GitLab 软件开发周期数据与源代码索引为统一知识图谱,为 AI 代理和开发者提供可查询的结构化上下文。

Stars: 30 | Forks: 9

GitLab Orbit logo # GitLab Orbit **面向 AI 代理的软件生命周期上下文图谱** [![流水线状态](https://gitlab.com/gitlab-org/orbit/knowledge-graph/badges/main/pipeline.svg)](https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/pipelines) [![最新发布](https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/badges/release.svg)](https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/releases) [![Helm chart](https://img.shields.io/badge/helm-gkg--helm--charts-blue)](https://gitlab.com/gitlab-org/orbit/gkg-helm-charts) [![许可证](https://img.shields.io/badge/license-GitLab%20EE-blue)](LICENSE.md) [![社区分叉](https://img.shields.io/badge/Contribute-community%20fork-blue)](https://gitlab.com/gitlab-community/gitlab-org/orbit/knowledge-graph) [文档](https://docs.gitlab.com/orbit/) · [快速入门](#quickstart) · [Orbit Local](https://docs.gitlab.com/orbit/local/getting-started/) · [Orbit Remote](https://docs.gitlab.com/orbit/remote/getting-started/) · [AI 编程代理](https://docs.gitlab.com/orbit/ai_coding_agents/)
将你的 GitLab SDLC 和源代码索引为一个属性图,然后通过 GitLab UI、CLI、MCP 或 REST 进行查询。Orbit 提供两种形式:**Orbit Local**,这是一个单二进制 CLI,可以从你机器上的任何仓库构建仅包含代码的图谱;以及 **Orbit Remote**,这是一个托管图谱,涵盖顶级的 GitLab.com 组。 ## 两种运行 Orbit 的方式 ### Orbit 本地 Orbit Local 在你的本地机器上运行。`orbit` CLI 会解析本地仓库,提取定义和跨文件引用,并将仅包含代码的调用图谱写入单个 DuckDB 文件中。在查询时不需要 GitLab 账户。安装步骤会通过 HTTPS 下载发布产物。 它索引的内容包括:目录、文件、函数和类定义,以及跨文件导入引用。它与 Orbit Remote 一样支持 11+ 种语言。多个仓库共享位于 `~/.orbit/graph.duckdb` 的同一个数据库,每个仓库和分支独立划分作用域。 | 访问方式 | 用途 | |---|---| | [`orbit` CLI](docs/source/local/access/cli.md) | 用于今天索引、查询和检查本地图谱 | | [`glab orbit local`](docs/source/local/access/glab.md) (计划中) | 通过 `glab` 驱动 Orbit Local | | [MCP](docs/source/local/access/mcp.md) (计划中) | 将本地图谱暴露给 AI 编程代理 | 从 [Orbit Local 入门指南](docs/source/local/getting-started.md)开始。 ### Orbit 远程 在顶级的 GitLab.com 组上启用 Orbit。Orbit 会将你的 SDLC 和源代码索引到一个受管的属性图谱中。 它索引的内容包括:SDLC 对象(包括组、项目、用户、注释、合并请求、流水线、作业、工作项、里程碑、标签、漏洞、发现结果)以及默认分支上 11+ 种语言的源代码,包括 Ruby、Java、Kotlin、Python、TypeScript、JavaScript、Rust、Go、C#、C、C++、PHP、Bash/Shell 和 Elixir。 | 访问方式 | 用途 | |---|---| | [GitLab Duo Agent Platform](docs/source/remote/access/duo.md) | 在 GitLab UI 中进行自然语言提问 | | [MCP](docs/source/remote/access/mcp.md) | Claude Code、Codex、Cursor、opencode、Gemini CLI | | [`glab orbit remote`](docs/source/remote/access/glab.md) | 用于脚本和发现的强类型 CLI 子命令 | | [REST API](docs/source/remote/access/api.md) | 流水线、自定义工具、脚本 | 从 [Orbit Remote 入门指南](docs/source/remote/getting-started.md)开始。 ``` flowchart LR subgraph GitLab["GitLab instance"] SDLC[SDLC data] Code[Source code] end SDLC -- CDC --> DIP[Data Insights Platform] DIP --> CH[(ClickHouse)] Code -- Rails API --> Orbit[Orbit service] CH <--> Orbit Orbit --> REST[REST API] Orbit --> MCP[MCP tools] Orbit --> DAP[GitLab Duo Agent Platform] ``` ## 快速入门 ### 快速入门:Orbit Local ``` # 安装(macOS、Linux glibc、Linux musl;--libc musl 强制使用静态构建) curl -fsSL "https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/raw/main/install.sh" | bash # 索引当前 repository,然后查询它 orbit index . orbit sql 'SELECT count(*) FROM gl_definition' ``` ### 快速入门:Orbit Remote ``` # 需要 glab 1.94+,已通过身份验证(glab auth login),并且你的 group 已启用 Orbit。 # 请参阅 docs/source/remote/getting-started.md。将 your-group/ 替换为你的顶层 group 路径。 glab orbit remote schema ``` 将请求体放在 `/tmp/orbit-query.json` 中: ``` { "query": { "query_type": "traversal", "node": { "id": "p", "entity": "Project", "filters": { "full_path": {"op": "starts_with", "value": "your-group/"} } }, "limit": 5 } } ``` ``` glab orbit remote query /tmp/orbit-query.json ``` [手册](docs/source/remote/cookbook.md) 中包含了爆炸半径、依赖关系、流水线健康度和漏洞的实战方案。 ## 功能 | 能力 | Orbit Local | Orbit Remote | |---|---|---| | 范围 | 仅代码 | SDLC 和代码 | | 查询接口 | 原生 DuckDB SQL | 编译为 ClickHouse SQL 的查询 DSL | | GitLab 授权 | 仅文件系统权限 | 每次查询强制执行 | | 离线运行 | 是(安装后) | 否 | Orbit Local 暴露的是原生 SQL,因此遍历被表示为表关联。Orbit Remote 支持在数十亿条边的规模下进行聚合、遍历、邻居查找和路径寻路。 ## 架构 Orbit 是一个单一的 Rust 二进制文件,由 ClickHouse (Remote) 或 DuckDB (Local) 提供支持,并由一个 YAML 本体驱动。服务器通过 HTTP 和 gRPC 提供结果,并在其上层构建了 MCP 和 REST 接口。请查看[设计文档](docs/design-documents/)和[数据模型](docs/design-documents/data_model.md)以了解全貌。 ## 文档 | 用户文档 | 开发者文档 | |---|---| | [Orbit 概述](docs/source/_index.md) | [本地开发](docs/dev/local-development.md) | | [AI 编程代理](docs/source/ai_coding_agents.md) | [领域词汇表 (CONTEXT.md)](CONTEXT.md) | | [Remote:工作原理](docs/source/remote/how-it-works.md) · [索引](docs/source/remote/indexing.md) · [schema](docs/source/remote/schema.md) · [手册](docs/source/remote/cookbook.md) · [查询 DSL](docs/source/remote/queries/query-language.md) | [设计文档](docs/design-documents/) | | [Local:工作原理](docs/source/local/how-it-works.md) · [索引](docs/source/local/indexing.md) · [schema](docs/source/local/schema.md) · [`orbit` CLI](docs/source/local/access/cli.md) | [添加新语言](docs/dev/adding-a-language.md) | | [MCP 工具参考](docs/source/queries/mcp_tools.md) | [E2E 测试](docs/dev/e2e-testing.md) | | [配置](docs/source/configure.md) | [Indexer crate 指南](crates/indexer/AGENTS.md) | | [故障排除](docs/source/orbit_troubleshooting.md) | [运维手册](docs/dev/runbooks/) | 已发布的网站是 [`docs.gitlab.com/orbit`](https://docs.gitlab.com/orbit/)。 ## 开发
从源码构建、测试和运行 所有任务都通过 [mise](https://mise.jdx.dev/) 运行。 ``` mise build # Build the workspace mise test:fast # Unit + fast integration tests mise test:integration # Full integration suite (requires Docker) mise lint:code # Clippy with warnings as errors mise lint:code:fix # Apply clippy fixes mise server:start # Run gkg-server locally ``` 产品名称是 Orbit。二进制文件和配置仍然使用工程名称 GKG(二进制文件 `gkg-server`,配置前缀 `GKG_*`,指标)。 - [本地开发指南](docs/dev/local-development.md) - [E2E 测试套件](docs/dev/e2e-testing.md) - [添加新语言](docs/dev/adding-a-language.md) - [Indexer crate 指南](crates/indexer/AGENTS.md) - [运维手册](docs/dev/runbooks/) - [服务器配置手册](docs/dev/runbooks/server_configuration.md) - [贡献指南](CONTRIBUTING.md) — 快速入门、测试、代码检查和 MR 规范。
## 项目与运维
Epic、相关仓库、基础设施、联系方式和 SOX 边界 ### Epic 全景 - [主要 GA epic (#19744)](https://gitlab.com/groups/gitlab-org/-/work_items/19744) - [L4:引入 GitLab Orbit (#773)](https://gitlab.com/groups/gitlab-operating-model/-/work_items/773) - [GKG 在 Dedicated 上 (#915,机密)](https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated) - [首次迭代,前身 (#17514,已关闭)](https://gitlab.com/groups/gitlab-org/-/work_items/17514) - 工作流 Epic:[产品 (#20884)](https://gitlab.com/groups/gitlab-org/-/work_items/20884) · [核心开发 (#20357)](https://gitlab.com/groups/gitlab-org/-/work_items/20357) · [安全 (#20248)](https://gitlab.com/groups/gitlab-org/-/work_items/20248) · [基础设施/交付 (#36)](https://gitlab.com/groups/gitlab-org/rust/-/work_items/36) · [架构与发现 (#20885)](https://gitlab.com/groups/gitlab-org/-/work_items/20885) - 跨职能:[基础设施支持 (#1804)](https://gitlab.com/groups/gitlab-com/gl-infra/-/work_items/1804) · [数据安全支持 (#407)](https://gitlab.com/groups/gitlab-com/gl-security/-/work_items/407) · [DE&M 数据产品 (#86)](https://gitlab.com/groups/gitlab-operating-model/-/work_items/86) · [商业化 (#79)](https://gitlab.com/groups/gitlab-operating-model/-/work_items/79) - [PREP 就绪评估 !64](https://gitlab.com/gitlab-org/architecture/readiness/-/merge_requests/64) - [标记为 `knowledge graph` 的议题](https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/issues/?label_name%5B%5D=knowledge+graph) ### 相关仓库 | 仓库 | 角色 | |---|---| | [`orbit/knowledge-graph`](https://gitlab.com/gitlab-org/orbit/knowledge-graph) | 本仓库。服务器、indexer、CLI。 | | [`orbit/gkg-helm-charts`](https://gitlab.com/gitlab-org/orbit/gkg-helm-charts) | 官方 Helm chart。 | | [`orbit/gkg-e2e-harness`](https://gitlab.com/gitlab-org/orbit/gkg-e2e-harness) | 用于端到端测试的 GKE 引导程序。 | | [`orbit/documentation/orbit-artifacts`](https://gitlab.com/gitlab-org/orbit/documentation/orbit-artifacts) | 场外记录和会话笔记。 | | [`analytics-section/siphon`](https://gitlab.com/gitlab-org/analytics-section/siphon) | 为数据湖提供数据的外部 CDC 流水线。 | | [`analytics-section/platform-insights/siphon-helm-charts`](https://gitlab.com/gitlab-org/analytics-section/platform-insights/siphon-helm-charts) | 生产环境 Siphon Helm chart。 | | [`gitlab-org/gitlab`](https://gitlab.com/gitlab-org/gitlab) | Rails 单体应用。负责授权并通过内部 API 提供源代码。 | | [`gitlab-org/rust/build-images`](https://gitlab.com/gitlab-org/rust/build-images) | CI 构建器镜像。 | ### 基础设施 - Helmfiles:[Siphon](https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-helmfiles/-/tree/master/releases/siphon) · [NATS](https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-helmfiles/-/tree/master/releases/nats) · [Data Insights Platform](https://gitlab.com/gitlab-com/gl-infra/k8s-workloads/gitlab-helmfiles/-/tree/master/releases/data-insights-platform) - ClickHouse Cloud Terraform:位于 [`config-mgmt`](https://ops.gitlab.net/gitlab-com/gl-infra/config-mgmt)(`environments/gstg/` 和 `environments/gprd/`)下的 gstg 和 gprd 的 `clickhouse-cloud.tf` 文件 - [架构就绪情况](https://gitlab.com/gitlab-org/architecture/readiness) - [Data Insights Platform 基础设施模块](https://gitlab.com/gitlab-org/analytics-section/platform-insights/data-insights-platform-infra) ### 流水线运维 - [SDLC 索引手册](docs/dev/runbooks/sdlc_indexing.md) - [代码索引手册](docs/dev/runbooks/code_indexing.md) - [服务器配置手册](docs/dev/runbooks/server_configuration.md) - [所有运维手册](docs/dev/runbooks/) ### 计费与 SOX 计费发送属于 SOX 审计边界。在修改计费代码之前,请阅读 [SOX 计费边界](docs/dev/sox-billing-boundary.md)。 - [`crates/gkg-billing/`](crates/gkg-billing/):Snowplow 计费事件发送和 CDot 配额执行。 - [`crates/gkg-server/src/billing_adapter.rs`](crates/gkg-server/src/billing_adapter.rs):将 `Claims` 转换为 `BillingInputs` 的单一转换点。 ### 人员 | 角色 | DRI | |---|---| | 工程负责人 | [@michaelangeloio](https://gitlab.com/michaelangeloio) | | 产品经理 | [@mcorren](https://gitlab.com/mcorren) | | TPM | [@lyle](https://gitlab.com/lyle) | | Siphon 和 DIP 架构 | [@ahegyi](https://gitlab.com/ahegyi) | ### 跨职能合作伙伴 | 姓名 | 领域 | |---|---| | Nitin Singhal ([@nitinsinghal74](https://gitlab.com/nitinsinghal74)) | ELT 负责人 | | Stephanie Jackson | 基础设施、SRE、PREP | | Ankit Bhatnagar ([@ankitbhatnagar](https://gitlab.com/ankitbhatnagar)) | NATS、DIP | | Gus Gray ([`@ggray-gitlab`](https://gitlab.com/ggray-gitlab)) | 安全、AuthZ 设计 | | Jason Plum ([@WarheadsSE](https://gitlab.com/WarheadsSE)) | 交付、Self-Managed、Dedicated | | Brian Greene ([@bgreene1](https://gitlab.com/bgreene1)) | 本体标准 | | Dennis Tang ([@dennis](https://gitlab.com/dennis)) | 分析阶段、ClickHouse 运维 | | Nick Leonard ([@nickleonard](https://gitlab.com/nickleonard)) | 设计 | | Jerome Ng ([@jeromezng](https://gitlab.com/jeromezng)) | 使用量计费系统架构师 | GitLab 阶段:Analytics。组:Knowledge Graph。
## 许可证 GitLab 企业版 (EE) 许可证。详见 [LICENSE.md](LICENSE.md)。
标签:IPv6支持, Python工具, 上下文管理, 人工智能, 代码分析, 凭证管理, 可视化界面, 子域名突变, 用户模式Hook绕过, 软件开发