Crates.io | deepwiki-rs |
lib.rs | deepwiki-rs |
version | 0.9.5 |
created_at | 2025-09-06 12:58:48.903674+00 |
updated_at | 2025-09-25 11:34:31.257067+00 |
description | deepwiki-rs(also known as Litho) is a high-performance automatic generation engine for C4 architecture documentation, developed using Rust. It can intelligently analyze project structures, identify core components, parse dependency relationships, and leverage large language models (LLMs) to automatically generate professional architecture documentation. |
homepage | |
repository | https://github.com/sopaco/deepwiki-rs |
max_upload_size | |
id | 1827041 |
size | 881,410 |
πͺπ» High-performance AI-driven intelligent documentation generation engine (DeepWiki-like) built with Rust
π Automatically generates professional C4-style project architecture documentation for any software project
[!WARNING] β οΈ As we plan to ship a torrent of features in the following months, future updates will contain breaking changes. With the architecture evolving, we'll annotate changes and highlight migration paths as we encounter them.
π Help me develop this software better by sponsoring on GitHub
Litho (also known as deepwiki-rs) is a high-performance AI documentation generation engine built with Rust, capable of automatically creating comprehensive technical documentation for software projects. Through advanced AI analysis capabilities, Litho intelligently explores project structures, identifies core modules, analyzes dependency relationships, and generates professional architecture documentation.
Litho employs a multi-engine workflow based on static code analysis and AI Multi-Agents, combining static code analysis with large language model (LLM) intelligence. The system uses specialized AI agents to conduct deep research on system context, architecture patterns, business workflows, and core module insights, ultimately generating comprehensive documentation including overview, architecture, and detailed technical topic documentation.
β€οΈ Like Litho? Star it π or Sponsor Me! β€οΈ
Litho's documentation generation process is divided into four distinct phases: preprocessing, research, composition, and output. Each phase is executed by specialized agents, forming a pipeline-style workflow.
This stage is responsible for extracting basic metadata from the project to provide input for subsequent AI analysis.
flowchart TD
A[Preprocessing Agent] --> B[Structure Extractor]
A --> C[Original Document Extractor]
A --> D[Code Analysis Agent]
A --> E[Relationship Analysis Agent]
B --> F[Project Structure]
C --> G[Original Document Materials]
D --> H[Core Code Insights]
E --> I[Code Dependencies]
F --> J[Store to Memory]
G --> J
H --> J
I --> J
This stage conducts multi-level deep research on the project through multiple agents running in parallel.
flowchart TD
A[Research Orchestrator] --> B[SystemContext Researcher]
A --> C[Domain Module Detector]
A --> D[Architecture Researcher]
A --> E[Workflow Researcher]
A --> F[Key Module Insights]
B --> G[System Context Report]
C --> H[Domain Module Report]
D --> I[Architecture Analysis Report]
E --> J[Workflow Analysis Report]
F --> K[Module Deep Insights]
G --> Memory
H --> Memory
I --> Memory
J --> Memory
K --> Memory
The final stage integrates research results into final documentation and persists it to disk.
flowchart TD
A[Document Composer] --> B[Overview Editor]
A --> C[Architecture Editor]
A --> D[Module Insight Editor]
B --> E[Overview Document]
C --> F[Architecture Document]
D --> G[Module Documents]
E --> H[Document Tree]
F --> H
G --> H
H --> I[Disk Outlet]
I --> J[Output Directory]
Litho features a sophisticated modular architecture designed for high performance, extensibility, and intelligent analysis. The system implements a multi-stage workflow with specialized AI agents and comprehensive caching mechanisms.
flowchart TB
subgraph "Core Engine"
Workflow[Workflow Controller]
Context[Generator Context]
Memory[Shared Memory]
end
subgraph "Preprocessing Stage"
StructureExtractor[Structure Extractor]
LanguageProcessors[Language Processors]
CodeAnalyzer[Code Analyzer]
end
subgraph "Research Stage"
ResearchOrchestrator[Research Orchestrator]
SystemContextAgent[System Context Agent]
ArchitectureAgent[Architecture Agent]
WorkflowAgent[Workflow Agent]
DomainModuleAgent[Domain Module Agent]
end
subgraph "Compose Stage"
OverviewEditor[Overview Editor]
ArchitectureEditor[Architecture Editor]
CoreModulesEditor[Core Modules Editor]
end
subgraph "Output Stage"
SummaryGenerator[Summary Generator]
DiskOutlet[Disk Outlet]
end
subgraph "Infrastructure"
LLMClient[LLM Client]
CacheManager[Cache Manager]
FileTools[File Tools]
end
Workflow --> Context
Context --> Memory
Workflow --> StructureExtractor
StructureExtractor --> LanguageProcessors
LanguageProcessors --> CodeAnalyzer
Workflow --> ResearchOrchestrator
ResearchOrchestrator --> SystemContextAgent
ResearchOrchestrator --> ArchitectureAgent
ResearchOrchestrator --> WorkflowAgent
ResearchOrchestrator --> DomainModuleAgent
Workflow --> OverviewEditor
Workflow --> ArchitectureEditor
Workflow --> CoreModulesEditor
Workflow --> SummaryGenerator
SummaryGenerator --> DiskOutlet
Context --> LLMClient
Context --> CacheManager
LLMClient --> FileTools
Litho's execution process follows a clear pipeline pattern: Preprocessing
β Deep Research
β Document Composition
β Output Storage
. The entire process is driven by the launch
function and injects all dependencies through GeneratorContext
.
sequenceDiagram
participant Main as main.rs
participant Workflow as workflow.rs
participant Context as GeneratorContext
participant Preprocess as PreProcessAgent
participant Research as ResearchOrchestrator
participant Doc as DocumentationOrchestrator
participant Outlet as DiskOutlet
Main->>Workflow : launch(config)
Workflow->>Context : Create context (LLM, Cache, Memory)
Workflow->>Preprocess : execute(context)
Preprocess->>Context : Store project structure and metadata
Context-->>Workflow : Preprocessing complete
Workflow->>Research : execute_research_pipeline(context)
Research->>Research : Execute multiple research agents in parallel
loop Each Research Agent
Research->>StepForwardAgent : execute(context)
StepForwardAgent->>Context : Validate data sources
StepForwardAgent->>AgentExecutor : Call prompt or extract
AgentExecutor->>LLMClient : Initiate LLM request
LLMClient->>CacheManager : Check cache
alt Cache hit
CacheManager-->>LLMClient : Return cached result
else Cache miss
LLMClient->>LLM : Call LLM API
LLM-->>LLMClient : Return raw response
LLMClient->>CacheManager : Store result to cache
end
LLMClient-->>AgentExecutor : Return processed result
AgentExecutor-->>StepForwardAgent : Return result
StepForwardAgent->>Context : Store result to Memory
end
Research-->>Workflow : Research complete
Workflow->>Doc : execute(context, doc_tree)
Doc->>Doc : Call multiple composition agents to generate docs
Doc-->>Workflow : Documentation generation complete
Workflow->>Outlet : save(context)
Outlet-->>Workflow : Storage complete
Workflow-->>Main : Process finished
The easiest way to install Litho is directly from crates.io:
cargo install deepwiki-rs
After installation, you can use deepwiki-rs
command directly:
deepwiki-rs --help
git clone https://github.com/sopaco/deepwiki-rs.git
cd deepwiki-rs
cargo build --release
target/release
directory.Litho provides a command-line interface for generating architecture documentation. Here are some basic usage examples:
# Generate project knowledge & technical documentation for current directory
litho
# Analyze specific project directory
litho -p /path/to/your/project
# Specify output directory
litho -o ./architecture-docs
# Specify project name
litho --name "My Project"
Litho generates professional project knowledge & technical documentation with the following structure:
1. Project Overview
: Project overview, core functionality, and technology stack analysis2. Architecture Overview
: Comprehensive architecture design, core processes, and module breakdown3. Workflow Overview
: Comprehensive architecture design, core processes, and module breakdown4. Deep Dive/
: Detailed technical topic implementation documentation for each identified core modules topic__Litho_Summary_Brief__.md
: Generation process summary brief__Litho_Summary_Detail__.md
: Generation process execution details# Generate complete project knowledge & technical documentation
litho -p ./my-project
# Generate with custom project name
litho --name "My Awesome Project" -o ./my-docs
Enable verbose logging:
litho -v
Configure LLM settings:
litho --llm-api-base-url <api-url> --llm-api-key <api-key> --model-efficient <model-name>
Skip specific stages:
litho --skip-preprocessing # Skip preprocessing stage
litho --skip-research # Skip research stage
litho --skip-documentation # Skip documentation stage
Advanced configuration:
litho --config <config-file> --max-tokens 4000 --temperature 0.7 --max-parallels 4
For more detailed usage information, run:
litho --help
Litho generates comprehensive project knowledge & technical documentation structure:
project-docs/
βββ 1. Project Overview # Project overview, core functionality, technology stack
βββ 2. Architecture Overview # Overall architecture, core processes, module breakdown
βββ 3. Workflow Overview # Overall architecture, core processes, module breakdown
βββ 4. Deep Dive/ # Detailed technical topic implementation documentation
β βββ Topic1.md
β βββ Topic2.md
β βββ ...
Help improve Litho by reporting bugs or submitting feature requests through GitHub Issues.
LanguageProcessor
traitMIT. A copy of the license is provided in the LICENSE file.
π Help me develop this software better by sponsoring on GitHub
An experienced internet veteran, having navigated through the waves of PC internet, mobile internet, and AI applications. Starting from an individual mobile application developer to a professional in the corporate world, I possess rich experience in product design and research and development. Currently, I am employed at Kuaishou, focusing on the R&D of universal front-end systems and AI exploration.
WeChat: dokhell
Email: dokhell@hotmail.com