servicegraph
Local-first cross-service code intelligence engine for AI agents, connecting frontend, gateways, backend services, and databases to enable impact analysis and change planning.
README
<div align="center">
ServiceGraph
Local-first cross-repository change intelligence for AI agents
中文 · Web Workbench · Development plan · Impact analysis plan · Integrations
</div>
ServiceGraph is building a local-first, cross-repository change intelligence engine for AI agents. It connects frontend code, gateways, backend services, contracts, configuration, registries, databases, and eventually runtime traces so a requirement or code change can become an evidence-backed impact, development, integration, and verification plan.
ServiceGraph is in early development. The CLI, versioned SQLite graph, Codebase Memory Route/HTTP import, bounded cross-repository traversal, and MCP/CLI/Web Mermaid sequence output work today. Broader framework coverage, impact propagation, boundary view, and Change Lens remain in development.
Why ServiceGraph?
A repository code graph knows what the source says can happen. A service registry knows which service instances currently exist. A runtime trace knows what happened for one sampled request. Cross-service development needs all three views, tied to stable service, endpoint, revision, and source identities.
ServiceGraph aims to answer questions such as:
- How does a click in
mall-webreach the inventory database? - Which repository and handler implement
POST /ordersin the test environment? - If this DTO, route, or service name changes, which repositories and tests are affected?
- Is this edge inferred from source, declared in a contract, or observed at runtime?
- Which services are the minimum set needed to develop this flow locally?
Architecture
flowchart LR
CLI["CLI"] --> D["servicegraphd"]
MCP["MCP server"] --> D
WEB["Sequence Workbench<br/>(MVP available)"] --> D
CBM["Codebase Memory"] --> D
CG["CodeGraph<br/>(optional enrichment)"] --> D
NACOS["Nacos<br/>(planned)"] --> D
OTEL["OpenTelemetry<br/>(planned)"] --> D
D --> GRAPH["Federated evidence graph"]
GRAPH --> SEQ["Sequence query engine"]
SEQ --> WEB
GRAPH --> IMPACT["Impact engine<br/>(planned)"]
IMPACT --> REPORT["Change, integration,<br/>and verification plan"]
ServiceGraph integrates with Codebase Memory as its planned default repository indexer and CodeGraph as optional in-repository enrichment. Both are independent projects and are detected as external tools; ServiceGraph does not install, bundle, or modify them.
Project status
| Capability | Status |
|---|---|
| Strict TypeScript identity and evidence model | Available |
servicegraph init, doctor, and status |
Available |
| Codebase Memory and CodeGraph installation probes | Available |
| MCP tool schemas and honest not-initialized/not-built errors | Available |
| Impact types, request validation, Git snapshot/diff capture | Available |
| SQLite graph store, repository inventory sync, public fixture | Available |
| Existing Codebase Memory Route/HTTP fact import | Available |
| Static frontend → gateway → Spring service federation | In development |
| Git diff → cross-repository impact report | Planned |
| Requirement → confirmed change anchors | Planned |
| OpenAPI, configuration evaluation, and Nacos identity | Planned |
| Evidence-backed Mermaid sequence output through MCP | Available |
| Local Daemon and bilingual Web Sequence Workbench MVP | Available |
| OpenTelemetry observed/possible diff | Planned |
Try the foundation
Requirements: Node.js 22+ and pnpm 11.
git clone https://github.com/LM20230311/servicegraph.git
cd servicegraph
corepack enable
pnpm install --frozen-lockfile
pnpm build
pnpm servicegraph doctor
pnpm servicegraph init /path/to/a/multi-repository-workspace
pnpm servicegraph sync /path/to/a/multi-repository-workspace
pnpm servicegraph status /path/to/a/multi-repository-workspace
pnpm servicegraph sequence /path/to/a/multi-repository-workspace \
--entrypoint submitOrder --target "POST /orders"
pnpm servicegraph serve /path/to/a/multi-repository-workspace
sync always records a versioned workspace snapshot and Repository nodes in
.servicegraph/graph.db. When Codebase Memory is installed and every configured
repository already has an index, it also imports Route, HTTP_CALLS,
CROSS_HTTP_CALLS, and HANDLES facts through the public CLI and advances the
graph to federated. It never invokes index_repository automatically.
Missing indexes and incomplete/truncated upstream results keep the graph at
repository_inventory and are reported as diagnostics.
Try the reproducible five-repository fixture:
node fixtures/mall-workspace/materialize.mjs /tmp/servicegraph-mall
node fixtures/mall-workspace/seed-recorded-graph.mjs /tmp/servicegraph-mall
pnpm servicegraph serve /tmp/servicegraph-mall
Open http://127.0.0.1:7464. The seed command imports a deterministic recorded
graph contract for demonstration and tests; it does not claim to analyze the
fixture source or replace a real Codebase Memory sync. The Web UI defaults to
Simplified Chinese, supports English from the header switcher, and remembers the
selection in the current browser.
Run the stdio MCP server:
pnpm mcp
The server registers servicegraph_explore, servicegraph_sequence, and
servicegraph_impact. When a complete federation snapshot exists,
servicegraph_sequence and the servicegraph sequence CLI perform a bounded
local SQLite traversal, collapse repository-internal steps, and return a
normalized SequenceModel and/or deterministic Mermaid.
Query/entrypoint/target lookup is available now; persisted chain IDs,
declared-only filtering, boundary view, and Change Lens are not. Explore and
impact propagation still return CAPABILITY_NOT_IMPLEMENTED. Every unavailable
or unreachable operation returns a structured error instead of inventing a
flow.
Broader target output example
The current renderer can produce the evidence-backed HTTP portion of this flow. The database call, return messages, and actor event below remain an illustrative target until their corresponding graph facts are imported:
sequenceDiagram
actor User
participant Web as mall-web
participant Gateway as api-gateway
participant Order as order-service
participant Inventory as inventory-service
participant DB as inventory-db
User->>Web: Submit order
Web->>Gateway: POST /api/orders
Gateway->>Order: POST /orders
Order->>Inventory: POST /reservations
Inventory->>DB: INSERT reservation
DB-->>Inventory: reservationId
Inventory-->>Order: reserved
Order-->>Web: orderId
Every future arrow must carry provenance, confidence, environment, revision, and a source anchor. Static possibilities and runtime observations will never be presented as the same kind of fact.
Roadmap
- Complete the evidence-backed static vertical slice for Vue/React, Spring Cloud Gateway, controllers, OpenFeign, and JPA/MyBatis.
- Extend the local Sequence Workbench MVP with boundary grouping, persisted sequences, source navigation, and export.
- Add Git diff impact overlays across repositories, APIs, contracts, data, and tests.
- Add two-stage requirement anchoring, Nacos/Kubernetes identity, and OpenTelemetry possible/observed comparison.
- Generate development slices and later add permission-aware team workflows.
See the development plan for the overall roadmap and the impact analysis plan for the public model, interfaces, propagation rules, milestones, and acceptance criteria.
Contributing and security
Read CONTRIBUTING.md before proposing large API changes. Report vulnerabilities according to SECURITY.md, not in a public issue.
Independence and license
ServiceGraph is not an official extension of Codebase Memory or CodeGraph, and neither upstream project endorses or is responsible for it. See Integrations and NOTICE.
ServiceGraph is licensed under Apache-2.0.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。