Skip to main content

AI-native code intelligence engine for semantic codebase analysis

Project description

codebase-digest

๐Ÿš€ AI-Native Code Intelligence Engine

Transform any codebase into semantic architectural understanding, execution flows, and human-readable engineering reports.

๐Ÿงฑ What It Does

This is NOT a repo summarizer. This is a code intelligence engine that explains:

  • What this system does - Infers project purpose from domain entities
  • How data flows - Maps execution paths and call relationships
  • Where logic lives - Identifies core components and their responsibilities
  • What domains exist - Detects business entities (User, Payment, Wallet, etc.)
  • What files matter - Highlights entry points and key modules

โœจ Features

  • ๐Ÿ” Semantic Analysis: Extract functions, classes, methods, and imports with full context
  • ๐Ÿ“Š Interactive Call Graphs: Visualize function relationships and execution flows
  • ๐Ÿ—๏ธ Domain Entity Detection: Automatically identify core business objects
  • ๐Ÿ”„ Execution Flow Mapping: Trace request paths through the system
  • ๐Ÿ“‹ Project README Generation: Auto-generate documentation for new developers
  • ๐Ÿ“ˆ Multi-format Output: HTML dashboards + Markdown reports + JSON data + Interactive graphs

๐Ÿš€ Quick Start

# Install
pip install codebase-digest

# Analyze current directory
codebase-digest build

# Analyze specific directory  
codebase-digest build /path/to/project

# Generate with interactive call graph
codebase-digest build --graph

# Quick stats
codebase-digest stats

# Search for patterns
codebase-digest query "wallet"

๐Ÿ“ Output Structure

Generates .digest/ directory with comprehensive analysis:

.digest/
โ”œโ”€โ”€ README.md          # Project documentation for developers
โ”œโ”€โ”€ callgraph.html     # Interactive call graph visualization
โ”œโ”€โ”€ report.html        # Comprehensive HTML dashboard
โ”œโ”€โ”€ architecture.md    # Technical architecture breakdown
โ”œโ”€โ”€ flows.md           # Execution flow documentation
โ”œโ”€โ”€ ai-context.md      # AI-optimized context file
โ””โ”€โ”€ entities.json      # Structured analysis data

๐Ÿ“Š Example Output

For a Python financial services project:

๐Ÿ“Š Codebase Statistics
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Total Files      โ”ƒ 4      โ”ƒ
โ”ƒ Lines of Code    โ”ƒ 189    โ”ƒ
โ”ƒ Languages        โ”ƒ Python โ”ƒ
โ”ƒ Functions        โ”ƒ 24     โ”ƒ
โ”ƒ Classes          โ”ƒ 8      โ”ƒ
โ”ƒ Domain Entities  โ”ƒ 7      โ”ƒ
โ”ƒ Execution Flows  โ”ƒ 4      โ”ƒ
โ”ƒ Complexity Score โ”ƒ 1.8    โ”ƒ
โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”›

Graph Stats: 29 nodes, 27 edges, 7 components

Generated README.md excerpt:

# Project Overview

This is a financial services application that provides user management, 
payment processing, and digital wallet functionality. The system is built 
with a service-oriented architecture using Python dataclasses for domain 
modeling and separate service layers for business logic.

## Architecture

The application follows a layered architecture with clear separation of concerns:
- **Domain Layer**: Contains core business entities (User, Payment, Wallet)
- **Service Layer**: Implements business logic (UserService, PaymentService)  
- **Application Layer**: Handles bootstrapping and orchestration

๐Ÿ’ก Commands

# Full analysis with all outputs
codebase-digest build [PATH]

# Specific formats
codebase-digest build --format html       # HTML dashboard only
codebase-digest build --format markdown   # Markdown reports only  
codebase-digest build --format json       # JSON data only

# Interactive call graph with depth filtering
codebase-digest build --graph --graph-depth 3

# Quick metrics and search
codebase-digest stats [PATH]              # Project statistics
codebase-digest query "search term" [PATH] # Search patterns

๐ŸŽฏ Key Features

๐Ÿ•ธ๏ธ Interactive Call Graph

  • Probabilistic entrypoint detection - Finds real execution starting points
  • Noise filtering - Removes builtin calls and isolated nodes
  • Depth filtering - Focus on core execution spine
  • Professional UI - GitHub/Linear/Notion inspired design

๐Ÿ“ Smart README Generation

  • Project type inference - Detects financial, e-commerce, CMS patterns
  • Architecture analysis - Service-oriented vs modular detection
  • Run instructions - Inferred from entry points
  • Future improvements - Realistic enhancement suggestions

๐Ÿ” Semantic Understanding

  • Symbol-aware analysis - True function-level relationships
  • Domain entity detection - Business object identification
  • Execution flow mapping - Startup and runtime sequences
  • Cross-file analysis - Import and dependency tracking

๐Ÿ› ๏ธ Tech Stack

  • Python 3.10+ - Core language
  • AST parsing - Deep Python code analysis
  • NetworkX - Call graph analysis and visualization
  • vis.js - Interactive graph rendering
  • Typer - CLI interface
  • Rich - Beautiful terminal output

๐Ÿ“‹ Supported Languages

  • โœ… Python - Full AST analysis with call graphs
  • ๐Ÿšง JavaScript/TypeScript - Parser implemented, integration in progress
  • ๐Ÿšง Java - Planned
  • ๐Ÿšง Go - Planned

๐ŸŽฏ Use Cases

  • New Developer Onboarding - Understand unfamiliar codebases quickly
  • Code Reviews - Architectural overview and impact analysis
  • Documentation Generation - Auto-generate project documentation
  • Refactoring Planning - Identify core components and dependencies
  • AI-Assisted Development - Provide context for LLM code assistance

๐Ÿ”ง Development

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code  
black .
isort .

# Type checking
mypy codebase_digest/

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with modern Python tooling and best practices
  • Inspired by professional developer tools (JetBrains, Sourcegraph)
  • Designed for AI-native development workflows

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

codebase_digest_ai-0.1.1.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

codebase_digest_ai-0.1.1-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file codebase_digest_ai-0.1.1.tar.gz.

File metadata

  • Download URL: codebase_digest_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for codebase_digest_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0fcec38789053fb9d6aafb55ae3280583803a04ad3fe32b84e626d84b62c1bdb
MD5 1e9dab98aaabf538806f351ee27fc9f0
BLAKE2b-256 2d4f82aab9e479dbeeee050258ad7b3087501358031f6ad09a96128f9c4f8408

See more details on using hashes here.

File details

Details for the file codebase_digest_ai-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for codebase_digest_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2e0097e28f10dd4b96e675a05d217739ed184ec7f1a57a473e8c238862526a
MD5 271b8821da8285f2f99a4740073a5e36
BLAKE2b-256 84c6c62006084cb3a13ee0060e40cbc7fbc4bc07a45edbf2417523e13923ecf4

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