Skip to main content

Knowledge Graph for multi-language repository dependency analysis — Java, TypeScript, Python, Groovy, SQL/Oracle

Project description

Knowledge Graph Dependency Analyzer

Analyze dependencies across all your repositories — Java, TypeScript, Python, Groovy, SQL/Oracle — and visualize cross-repo connections in an interactive graph.

PyPI Python


What it does

  • Indexes source code from multiple repositories (Java, TypeScript/JavaScript, Python, Groovy, SQL/Oracle)
  • Extracts classes, methods, endpoints, imports, DB tables, procedures, pipeline stages
  • Connects cross-repo dependencies: frontend → backend HTTP calls, procedures → tables, shared libraries
  • Visualizes everything in an interactive graph with drill-down per repository
  • Answers business questions: "what is impacted if I change this endpoint?" via /graph-impact

Requirements

Before installing, make sure you have:

Dependency Install
Python 3.11+ python.org
Docker Desktop docs.docker.com/get-docker
Ollama (optional) brew install ollama or ollama.com/download

Note: Docker is required to run Neo4j and Qdrant locally. Ollama is recommended for local embeddings (no API key, no rate limits).


Installation

pip install graph-dependency-analyzer

Or install from source:

git clone https://github.com/ciandt/new-arch-explorer-service.git
cd new-arch-explorer-service
pip install -e .

Quick Start

Run these commands in order the first time:

# 1. Create docker-compose.yml (Neo4j + Qdrant + Redis)
graph-explorer docker-init

# 2. Create .env.graph configuration file
graph-explorer env-init
#    → Edit .env.graph: set REPOSITORIES_PATH and EMBEDDING_PROVIDER

# 3. Install Ollama + embedding model (local, free)
graph-explorer ollama-setup

# 4. Install Claude Code skills (/graph-index, /graph-link, /graph-impact)
graph-explorer skills

# 5. Run the full setup wizard
graph-explorer init

# 6. Start the API server
graph-explorer start
#    → API running at http://localhost:8000

# 7. Index your repositories
graph-explorer index repo1 repo2 repo3

# 8. Connect cross-repo dependencies
graph-explorer link

# 9. Open the graph in browser
graph-explorer open

CLI Reference

graph-explorer env-init

Creates a .env.graph configuration file in the current directory.

graph-explorer env-init                    # creates .env.graph in current dir
graph-explorer env-init --path ~/myproject # creates in specific path
graph-explorer env-init --force            # overwrite existing

Required settings to edit after creation:

REPOSITORIES_PATH=/absolute/path/to/your/repos   # ← required
EMBEDDING_PROVIDER=ollama                          # or: flow / openai

graph-explorer docker-init

Creates docker-compose.yml with Neo4j, Qdrant and Redis.

graph-explorer docker-init                    # creates in current dir
graph-explorer docker-init --path ~/myproject # creates in specific path
graph-explorer docker-init --force            # overwrite existing

After creating, start the containers:

docker compose up -d

Services:

  • Neo4j → http://localhost:7474 (user: neo4j / pass: medline2024)
  • Qdrant → http://localhost:6333/dashboard
  • Redis → localhost:6379

graph-explorer ollama-setup

Installs Ollama and downloads the nomic-embed-text embedding model (274MB, 768-dim).

graph-explorer ollama-setup               # install Ollama + pull model
graph-explorer ollama-setup --skip-install  # only pull model (Ollama already installed)

Detects your OS and installs automatically:

  • Mac: via Homebrew or direct download
  • Linux: via official install script
  • Windows: opens download page

graph-explorer ollama-start

Starts the Ollama server in the background.

graph-explorer ollama-start               # start in background (default)
graph-explorer ollama-start --background  # explicit background

graph-explorer skills

Installs /graph-index, /graph-link and /graph-impact commands into Claude Code.

graph-explorer skills                      # install globally (~/.claude/skills/)
graph-explorer skills --target ./myproject # install in specific project only
graph-explorer skills --list               # show installation status
graph-explorer skills --uninstall          # remove graph skills

After installing, use in Claude Code:

/graph-index wdc-packing-list wdc-ui       # index repos
/graph-link                                 # connect dependencies
/graph-impact quero criar tela de usuario  # business impact analysis

graph-explorer init

Guided setup wizard — checks all dependencies and configures the project.

graph-explorer init                  # full wizard
graph-explorer init --skip-docker    # skip Docker setup
graph-explorer init --skip-ollama    # skip Ollama setup

Runs checks for: .env.graph, Docker containers, Ollama, Claude skills.


graph-explorer start

Starts the API server (FastAPI + Uvicorn).

graph-explorer start                   # default: port 8000, auto-reload
graph-explorer start --port 9000       # custom port
graph-explorer start --no-reload       # disable auto-reload

Once running:

  • API docs: http://localhost:8000/docs
  • Graph UI: http://localhost:8000/api/analysis/repository-relationships/graph.html

graph-explorer index

Indexes one or more repositories into the Knowledge Graph.

graph-explorer index wdc-packing-list wdc-ui wdc-ui-external
graph-explorer index wms-oracle --parallel 1   # use parallel=1 for large repos
graph-explorer index wmsportal --parallel 1    # wmsportal = 3k+ files

Auto-detects parallel limit:

  • Large repos (wmsportal, wms-oracle, wms-oracle-fork) → parallel: 1
  • All others → parallel: 3

Supported languages: Java, TypeScript, JavaScript, Python, Groovy, SQL/Oracle


graph-explorer link

Connects cross-repository dependencies after indexing.

graph-explorer link            # run both linkers
graph-explorer link --http-only  # only connect HTTP calls (frontend→backend)
graph-explorer link --db-only    # only resolve DB refs (procedures→tables)

Runs two operations:

  1. cross-language-link — matches axios.get('/api/users')@GetMapping("/api/users")
  2. resolve-db-refs — connects Oracle procedures/packages to their tables

graph-explorer status

Shows the current state of all services and graph statistics.

graph-explorer status

Output example:

📊 Knowledge Graph Status

  ✅ API running
     ✅ qdrant: Vector database operational
     ✅ neo4j: Graph database operational
  ✅ Docker
  ✅ Ollama running
     ✅ nomic-embed-text installed

  📈 Graph: 131 repos | 89 relationships

graph-explorer open

Opens the dependency graph in your browser.

graph-explorer open                          # open full repository map
graph-explorer open --repo wdc-packing-list  # open specific repo graph

Embedding Provider Options

Edit .env.graph to choose your embedding provider:

Option A — Ollama (recommended)

No API key, no rate limits, runs locally.

EMBEDDING_PROVIDER=ollama
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
QDRANT_VECTOR_SIZE=768

Setup: graph-explorer ollama-setup

Option B — CI&T Flow

Uses the CI&T Flow proxy.

EMBEDDING_PROVIDER=flow
OPENAI_API_KEY=your-flow-token
OPENAI_BASE_URL=https://flow.ciandt.com/ai-orchestration-api
QDRANT_VECTOR_SIZE=1536

Option C — OpenAI

Direct OpenAI API.

EMBEDDING_PROVIDER=openai
OPENAI_API_KEY=sk-your-key
QDRANT_VECTOR_SIZE=1536

⚠️ Changing provider requires clearing Qdrant and re-indexing everything because vector dimensions differ between providers.


Re-indexing

Re-indexing is safe — Neo4j uses MERGE so no duplicates are created. Use it when you add new repos or update existing code:

graph-explorer index repo1 repo2
graph-explorer link

Architecture

src/
├── domain/          entities, value objects, interfaces
├── application/     use cases, DTOs, services
├── infrastructure/  Neo4j, Qdrant, OpenAI/Ollama, parsers
│   └── parsing/     Java, TypeScript, Python, Groovy, SQL
├── presentation/    FastAPI routers
└── cli.py           graph-explorer CLI

Stack: Python 3.11 · FastAPI · Neo4j · Qdrant · Tree-sitter · Ollama · Click


API Reference

Full API docs at: http://localhost:8000/docs

Key endpoints:

Method Endpoint Description
POST /api/indexing/index/batch Index repositories
POST /api/analysis/impact/cross-language-link Link HTTP calls
POST /api/analysis/impact/resolve-db-refs Resolve DB references
POST /api/analysis/impact/search Semantic search
GET /api/analysis/repository-relationships Cross-repo relationships
GET /api/analysis/repository-relationships/graph.html Interactive graph
GET /api/export/graph.html?repository=X Repo internal graph

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graph_dependency_analyzer-2.0.1.tar.gz (172.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graph_dependency_analyzer-2.0.1-py3-none-any.whl (175.0 kB view details)

Uploaded Python 3

File details

Details for the file graph_dependency_analyzer-2.0.1.tar.gz.

File metadata

File hashes

Hashes for graph_dependency_analyzer-2.0.1.tar.gz
Algorithm Hash digest
SHA256 a3375a792c615db5a020395e0e225b3800b7cf1892fa78ce0f23fa44474bc7a9
MD5 8e712df1c93fb699a3c903d12a5cd757
BLAKE2b-256 735b21bf2ba5f87969e38d5f49505d4eb1ce014fe87aac9369036c269b92a2c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for graph_dependency_analyzer-2.0.1.tar.gz:

Publisher: publish.yml on ciandt-jeanp/new-arch-explorer-service

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file graph_dependency_analyzer-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for graph_dependency_analyzer-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3a0d32f2b721ecdb192f06b4f7d056b34a592b2d003e13dad4e5c7d24d9aa61
MD5 71e4ceb28d74a120d0953d79e5092f82
BLAKE2b-256 49e8ee138ee87a8a95be07a91b593702e28671a5de2297b795c032e6e7957aa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for graph_dependency_analyzer-2.0.1-py3-none-any.whl:

Publisher: publish.yml on ciandt-jeanp/new-arch-explorer-service

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page