AI-native code intelligence engine for semantic codebase analysis
Project description
codebase-digest-ai
๐ 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-ai
# Analyze current directory
codebase-digest-ai build
# Analyze specific directory
codebase-digest-ai build /path/to/project
# Generate with interactive call graph
codebase-digest-ai build --graph
# Quick stats
codebase-digest-ai stats
# Search for patterns
codebase-digest-ai 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-ai build [PATH]
# Specific formats
codebase-digest-ai build --format html # HTML dashboard only
codebase-digest-ai build --format markdown # Markdown reports only
codebase-digest-ai build --format json # JSON data only
# Interactive call graph with depth filtering
codebase-digest-ai build --graph --graph-depth 3
# Quick metrics and search
codebase-digest-ai stats [PATH] # Project statistics
codebase-digest-ai 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codebase_digest_ai-0.1.2.tar.gz.
File metadata
- Download URL: codebase_digest_ai-0.1.2.tar.gz
- Upload date:
- Size: 39.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d69ee36d4252ae5a1cd6d121e248ab36ddd158b17adacc27c9ff468a8387050
|
|
| MD5 |
068a7a62e746cc6e1cf9c148d94c8022
|
|
| BLAKE2b-256 |
91506c623633c0682525c1b4d99602c31c141810b553e395247f26132da1da9d
|
File details
Details for the file codebase_digest_ai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: codebase_digest_ai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 44.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ca003c1a306e538a51e14609555fbb52ff8355ebd99d6d7644c8047082c078e
|
|
| MD5 |
ad50549a404a3a31115a7465040cfd24
|
|
| BLAKE2b-256 |
6b746e5ec4144f454f1087f6d3cfb47818ae1d422cb3d2ab117eabe8ca31bd16
|