Skip to main content

REPL-style architecture analysis CLI for Git repositories.

Project description

ArchMind

ArchMind is a tool for exploring and analyzing the architecture of a software project from its GitHub repository. It scans a Python or Java codebase, builds architecture graphs, looks for structural problems like tight coupling or weak boundaries, and produces a report you can read in the terminal or export as Markdown. Current support is limited to Python and Java repositories.

Under the hood, ArchMind turns the codebase into several graph views, such as dependency graphs, architecture boundary graphs, data-flow graphs, and function relationship graphs. It then analyzes those graphs to detect patterns that often signal architecture problems, and uses an LLM to turn the raw graph findings into a more readable explanation and report.

Demo

v0 product shape

  • Interface: CLI-only REPL
  • Language: Python 3.11+
  • Input: GitHub repository URL for a Python or Java repository
  • Branch selection: optional, default main
  • Core output: architecture graph plus analysis findings
  • Report output: print to terminal and export a result folder named result by default
  • LLM access: user selects provider and supplies their own API key
  • Terminal UX: ASCII-art opening intro with version, modern prompts, progress bars, and tasteful emoji or ASCII icons

Core analysis direction

The first useful analysis set should stay concrete and explainable:

  • DSM generation from the dependency graph
  • coupling analysis such as fan-in, fan-out, and shared-dependency pressure
  • cycle and strongly connected component detection
  • centrality and bridge-node analysis to identify architectural choke points
  • LLM-based interpretation that turns graph evidence into architecture findings and recommendations

Graphs generated in v0

ArchMind now builds several graph views from the same repository scan:

  • dependency_graph: module and external dependency relationships
  • architecture_graph: repository, package, and module boundary structure
  • data_flow_graph: inferred reads, writes, emits, and external data interactions
  • interface_graph: public interfaces, entrypoints, and their consumers
  • function_graph: function-level call relationships across modules and classes
  • operational_risk_graph: inferred observability and security capability coverage

The issue-inspection rules in knowledge/graph_catalog.json map each architecture issue to the graph views most relevant to that inspection.

PDF graph exports use graph-aware layouts through networkx and matplotlib. Very large graphs are sampled down to the most structurally important nodes so the exported PDF remains readable.

Language support

  • Supported repository languages: Python and Java
  • Other repository languages are not supported yet and may produce sparse or empty graph artifacts

Default technical direction

  • Python 3.11+ for the REPL, ingestion, graph processing, evaluation, and report generation
  • PyTorch plus PyTorch Geometric (PyG) for graph encoding, transforms, and GNNs
  • LiteLLM for provider abstraction across OpenAI, Anthropic, and Gemini
  • torch_geometric.data.HeteroData as the default graph container
  • Typed schemas for durable contracts
  • JSON, JSONL, Markdown, and trusted tensor artifacts as the primary interchange formats

Intended CLI shape

archmind [<github_url>] [--branch main] [--output result] [--llm-provider openai]

If a repository URL, branch, output folder, LLM provider, or API key is not provided at startup, the REPL should ask for it interactively.

How to run

Use Python 3.11+.

Setup with uv

Create a virtual environment:

uv venv

Activate it:

source .venv/bin/activate

Install runtime dependencies and the package:

uv pip install -r requirements.txt
uv pip install -e .

Setup with pip

Create a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install runtime dependencies and the package:

python3 -m pip install -r requirements.txt
python3 -m pip install -e .

Start the program

Launch the REPL:

archmind

Launch with startup parameters:

archmind https://github.com/example/project --branch main --output result --llm-provider openai

Run it without installing the console script:

PYTHONPATH=src python3 -m archmind

Run tests

Install test tooling if needed:

python3 -m pip install pytest

Then run:

python3 -m pytest

Result output structure

The user-facing export target is a folder, not a single file.

Default exported folder:

result/
  result.md
  dependency_graph.pdf
  architecture_graph.pdf
  data_flow_graph.pdf
  interface_graph.pdf
  function_graph.pdf
  operational_risk_graph.pdf
  dependency_graph_metrics.json
  architecture_graph_metrics.json
  data_flow_graph_metrics.json
  interface_graph_metrics.json
  function_graph_metrics.json
  operational_risk_graph_metrics.json
  dependency_graph_dsm.csv
  issue_summary.json
  issue_assessments.json

Workspace artifacts remain under workspaces/<run_id>/ and include:

  • graph JSON files under graph/
  • PyG payloads per graph
  • PDFs per graph under graph/
  • per-graph metrics and findings under analysis/
  • per-issue inspection outputs under analysis/issues/
  • evaluation files and provenance metadata

Reading order

  1. AGENTS.md for repo-local coding instructions
  2. SPEC.md for system scope, domain contracts, and artifacts
  3. WORKFLOW.md for runtime policy and execution defaults
  4. architecture.md for module boundaries and graph flow
  5. agent_roles.md for role definitions and artifact ownership
  6. data.md, eval.md, and security.md for operational constraints

Repository rules

  • Treat docs as the system of record. If behavior changes, update docs before or with implementation.
  • Keep every stage artifact-backed: repo fetch, graph construction, analysis, explanation, report generation, evaluation, provenance.
  • Prefer explicit schemas over prompt-only conventions.
  • Record seeds, versions, hashes, and feature-schema changes whenever results should be reproducible.

Documents

  • AGENTS.md - repo instructions for coding agents
  • SPEC.md - system specification and domain contracts
  • agent_roles.md - execution roles and artifact ownership
  • WORKFLOW.md - workflow contract and runtime defaults
  • architecture.md - module boundaries and graph-aware execution flow
  • api.md - CLI contract and internal interfaces
  • data.md - source ingestion, graph artifacts, and dataset handling
  • eval.md - evaluation harness and metrics
  • security.md - threat model and guardrails
  • roadmap.md - milestones
  • decisions.md - architecture decisions
  • CONTRIBUTING.md - contribution expectations

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

archmind-0.1.0.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

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

archmind-0.1.0-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file archmind-0.1.0.tar.gz.

File metadata

  • Download URL: archmind-0.1.0.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for archmind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd1becb24eb020f8440939a324915fa15de998a0c8887a9d200ee83eccc9bcdb
MD5 8a7e46007fc30d606c6061d2a3569fe3
BLAKE2b-256 3aa558f4b4eb692b5e406ff5beef6a5758da0545b8f7fbe18bdbf9c69faf59c5

See more details on using hashes here.

File details

Details for the file archmind-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: archmind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for archmind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3fa2370f67bbb3ae38aed1769855b6eb0c2fdcc86aad100f30a88ceb12f21c0
MD5 73a441b8773987cec507a6a07943f9d9
BLAKE2b-256 1dfdf667b9756b15272341e8b6b647655385117eed32ee033d7459a097c39a13

See more details on using hashes here.

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