deepwiki-rs 1.2.9

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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# Litho (deepwiki-rs) Configuration File - Example

# Copy this file to 'litho.toml' and customize the values for your project



# ============================================================================

# Project Configuration

# ============================================================================



# Project name (optional - will auto-detect from Cargo.toml, package.json, etc.)

project_name = "Example Project"



# Path to the project to analyze (default: current directory)

project_path = "."



# Where to output the generated documentation

output_path = "./litho.docs"



# Target language for documentation output

# Supported: "zh" (Chinese), "en" (English), "ja" (Japanese), "ko" (Korean),

#            "de" (German), "fr" (French), "ru" (Russian), "vi" (Vietnamese)

target_language = "en"



# ============================================================================

# Analysis Configuration

# ============================================================================



# Analyze code dependencies between modules

analyze_dependencies = true



# Identify and analyze core components

identify_components = true



# Maximum directory depth to scan

max_depth = 10



# Percentage threshold for identifying core components (0-100)

core_component_percentage = 40.0



# Maximum file size to analyze (in bytes)

# Default: 65536 (64KB)

max_file_size = 65536



# Include test files in analysis

include_tests = false



# Include hidden files (starting with .)

include_hidden = false



# Directories to exclude from analysis

excluded_dirs = [

    ".litho",

    "litho.docs",

    "target",

    "node_modules",

    ".git",

    "build",

    "dist",

    "venv",

    ".vs",

    "bin",

    "obj",

    "Debug",

    "Release",

    "*Tests",

    ".svelte-kit",

    "__pycache__",

    "__tests__",

    "__mocks__",

    "__fixtures__"

]



# Specific files to exclude

excluded_files = [

    "litho.toml",

    "*.litho",

    "*.log",

    "*.tmp",

    "*.cache",

    "bun.lock",

    "package-lock.json",

    "yarn.lock",

    "pnpm-lock.yaml",

    "Cargo.lock",

    ".gitignore",

    "*.tpl",

    "*.md",

    "*.txt",

    ".env"

]



# File extensions to exclude

excluded_extensions = [

    "jpg",

    "jpeg",

    "png",

    "gif",

    "bmp",

    "ico",

    "mp3",

    "mp4",

    "avi",

    "pdf",

    "zip",

    "tar",

    "exe",

    "dll",

    "so",

    "archive"

]



# Only include these extensions (empty = include all supported languages)

included_extensions = []



# Path to architecture metadata file (optional)

# architecture_meta_path = "./architecture.yaml"



# ============================================================================

# LLM Configuration

# ============================================================================



[llm]

# LLM Provider to use

# Supported: "openai", "moonshot", "deepseek", "mistral", "openrouter",

#            "anthropic", "gemini", "ollama"

provider = "openai"



# API Key for the LLM provider

# SECURITY: Never commit your real API key! Use environment variables instead.

# Set via: $env:LITHO_LLM_API_KEY = "your-key-here" (PowerShell)

#      or: export LITHO_LLM_API_KEY="your-key-here" (Bash)

api_key = "${LITHO_LLM_API_KEY}"



# Base URL for the LLM API

# OpenAI: "https://api.openai.com/v1"

# Anthropic: "https://api.anthropic.com"

# DeepSeek: "https://api.deepseek.com"

# Ollama: "http://localhost:11434/v1"

api_base_url = "https://api.openai.com/v1"



# Internal working directory

internal_path = ".litho"



# High-efficiency model for regular inference tasks

# OpenAI examples: "gpt-4o-mini", "gpt-3.5-turbo"

# Anthropic examples: "claude-3-5-haiku-20241022"

# DeepSeek examples: "deepseek-chat"

# Ollama examples: "llama3.2", "qwen2.5-coder"

model_efficient = "gpt-4o-mini"



# High-quality model for complex reasoning tasks (and fallback for efficient model)

# OpenAI examples: "gpt-4o", "gpt-4-turbo"

# Anthropic examples: "claude-3-5-sonnet-20241022", "claude-3-opus-20240229"

# DeepSeek examples: "deepseek-reasoner"

# Ollama examples: "llama3.2:70b", "qwen2.5-coder:32b"

model_powerful = "gpt-4o"



# Maximum tokens per request

max_tokens = 4096



# Temperature for LLM responses (0.0 = deterministic, 1.0 = creative)

temperature = 0.1



# Number of retry attempts for failed requests

retry_attempts = 5



# Delay between retries in milliseconds

retry_delay_ms = 5000



# Request timeout in seconds

timeout_seconds = 300



# Disable preset tools (advanced option)

disable_preset_tools = false



# Maximum number of parallel LLM requests

max_parallels = 3



# ============================================================================

# Cache Configuration

# ============================================================================



[cache]

# Enable caching of LLM responses

enabled = true



# Directory to store cache files

cache_dir = ".litho/cache"



# Cache expiration time in hours

# Default: 8760 (365 days)

expire_hours = 8760



# ============================================================================

# Knowledge Configuration (External Documentation Sources)

# ============================================================================

# Integrates existing documentation from local files into the

# documentation generation process. External knowledge enhances generated

# documentation with business context and architectural decisions.

#

# NEW: Categorized Documentation Support

# Documents can now be organized into categories (architecture, database, api, etc.)

# Each category is automatically routed to the most relevant agents for analysis.

#

# NEW: Document Chunking Support

# Large documents are automatically split into manageable chunks for better LLM processing.

# Chunking strategies: "semantic" (by sections), "paragraph", "fixed" (fixed size)

#

# Integration Points:

# - Research Phase: Agents receive category-specific knowledge

#   - SystemContextResearcher: architecture, adr

#   - ArchitectureResearcher: architecture, deployment, database, adr

#   - DomainModulesDetector: architecture, database

#   - BoundaryAnalyzer: api, deployment

#   - WorkflowResearcher: workflow, architecture

#   - KeyModulesInsight: architecture, database

#

# - Compose Phase: Documentation agents use targeted knowledge

#   - OverviewEditor: architecture, adr

#   - ArchitectureEditor: architecture, deployment, database, adr

#   - BoundaryEditor: api, deployment

#   - WorkflowEditor: workflow, architecture

#   - KeyModulesInsightEditor: architecture, database

#

# Benefits:

# - More focused analysis with category-specific documentation

# - Reduced token usage by only including relevant documents

# - Better validation with targeted knowledge per agent

# - Maintains consistency with organizational knowledge

# - Large documents are automatically chunked to fit context windows

# ============================================================================



[knowledge.local_docs]

# Enable local documentation integration

# When enabled, Litho will read and cache local documentation files

enabled = true



# Local directory to cache processed content (optional)

# If not specified, defaults to: .litho/cache/knowledge/local_docs/

cache_dir = ".litho/cache/knowledge/local_docs"



# Whether to re-process files if they change (default: true)

watch_for_changes = true



# ============================================================================

# Default Chunking Configuration (applies to all categories unless overridden)

# ============================================================================

[knowledge.local_docs.default_chunking]

# Enable chunking for large documents (default: true)

enabled = true



# Maximum chunk size in characters (~2000 tokens)

# Default: 8000 characters

max_chunk_size = 8000



# Overlap between chunks to maintain context

# Default: 200 characters

chunk_overlap = 200



# Chunking strategy:

# - "semantic": Split by document structure (headers for Markdown, statements for SQL)

# - "paragraph": Split by paragraphs (double newlines)

# - "fixed": Fixed-size chunks with overlap

# Default: "semantic"

strategy = "semantic"



# Minimum document size (chars) to trigger chunking

# Documents smaller than this will not be chunked

# Default: 10000 characters

min_size_for_chunking = 10000



# ============================================================================

# Document Categories

# ============================================================================

# Define categorized document sources for targeted knowledge delivery.

# Each category has:

# - name: Category identifier (architecture, database, api, deployment, adr, workflow, general)

# - description: Human-readable description

# - paths: File paths or glob patterns

# - target_agents: Which agents receive these docs (optional - if empty, available to all)

# - chunking: Optional per-category chunking config (overrides default_chunking)



# Architecture Documentation

[[knowledge.local_docs.categories]]

name = "architecture"

description = "High-level system architecture and C4 model documentation"

paths = [

    "docs/architecture/**/*.md",

    "docs/c4/**/*.md",

    "docs/design/**/*.md",

    "docs/system/**/*.md",

    # PDF architecture diagrams

    "docs/architecture/**/*.pdf"

]

target_agents = [

    "SystemContextResearcher",

    "ArchitectureResearcher",

    "DomainModulesDetector",

    "OverviewEditor",

    "ArchitectureEditor"

]



# Database Documentation

[[knowledge.local_docs.categories]]

name = "database"

description = "Database schema, ERD, and data model documentation"

paths = [

    "docs/database/**/*.md",

    "docs/schema/**/*.md",

    "docs/data-model/**/*.md",

    "docs/erd/**/*.md",

    # SQL files for reference

    "docs/database/**/*.sql"

]

target_agents = [

    "ArchitectureResearcher",

    "DomainModulesDetector",

    "KeyModulesInsight",

    "ArchitectureEditor",

    "KeyModulesInsightEditor"

]

# Override chunking for database docs - use smaller chunks for SQL files

[knowledge.local_docs.categories.chunking]

enabled = true

max_chunk_size = 6000

chunk_overlap = 150

strategy = "semantic"  # Will use SQL-aware chunking for .sql files

min_size_for_chunking = 8000



# Deployment & Infrastructure Documentation

[[knowledge.local_docs.categories]]

name = "deployment"

description = "Deployment, infrastructure, and DevOps documentation"

paths = [

    "docs/deployment/**/*.md",

    "docs/infrastructure/**/*.md",

    "docs/devops/**/*.md",

    "docs/k8s/**/*.md",

    "docs/docker/**/*.md"

]

target_agents = [

    "ArchitectureResearcher",

    "BoundaryAnalyzer",

    "ArchitectureEditor",

    "BoundaryEditor"

]



# API Documentation

[[knowledge.local_docs.categories]]

name = "api"

description = "API specifications, endpoints, and integration documentation"

paths = [

    "docs/api/**/*.md",

    "docs/openapi/**/*.yaml",

    "docs/openapi/**/*.json",

    "docs/swagger/**/*.yaml",

    "docs/swagger/**/*.json",

    "docs/endpoints/**/*.md"

]

target_agents = [

    "BoundaryAnalyzer",

    "BoundaryEditor"

]



# Architecture Decision Records (ADRs)

[[knowledge.local_docs.categories]]

name = "adr"

description = "Architecture Decision Records and technical decisions"

paths = [

    "docs/adr/**/*.md",

    "docs/decisions/**/*.md",

    "docs/ADR/**/*.md"

]

target_agents = [

    "SystemContextResearcher",

    "ArchitectureResearcher",

    "OverviewEditor",

    "ArchitectureEditor"

]



# Workflow & Business Process Documentation

[[knowledge.local_docs.categories]]

name = "workflow"

description = "Business processes, workflows, and user journeys"

paths = [

    "docs/workflows/**/*.md",

    "docs/processes/**/*.md",

    "docs/flows/**/*.md",

    "docs/user-journeys/**/*.md"

]

target_agents = [

    "WorkflowResearcher",

    "WorkflowEditor"

]



# General Documentation

# Use this for uncategorized or general-purpose documentation

[[knowledge.local_docs.categories]]

name = "general"

description = "General documentation available to all agents"

paths = [

    "docs/general/**/*.md",

    "docs/readme/**/*.md"

]

# Empty target_agents means available to all agents

target_agents = []



# ============================================================================

# Local Docs Integration Usage

# ============================================================================

#

# Manual sync (useful for testing or forcing cache refresh):

#   cargo run -- sync-knowledge

#   cargo run -- sync-knowledge --force  # Bypass cache TTL

#

# Automatic sync (during documentation generation):

#   cargo run --  # Syncs if cache expired or missing

#

# Category-Specific Knowledge Loading:

# Each agent automatically receives only the document categories relevant

# to its analysis task. For example:

# - BoundaryAnalyzer receives: api, deployment

# - ArchitectureResearcher receives: architecture, deployment, database, adr

#

# Use Cases:

# 1. Architecture Validation: Compare code structure with architecture docs

# 2. ADR Integration: Reference architectural decisions in generated docs

# 3. Database Documentation: Include ERD and schema docs for data analysis

# 4. API Documentation: Cross-reference endpoints with API specifications

# 5. Workflow Documentation: Validate workflows against business requirements

# 6. Deployment Docs: Include infrastructure context for boundary analysis

# ============================================================================



# ============================================================================

# Usage Examples

# ============================================================================

#

# Basic usage:

#   cargo run --

#

# Override settings via CLI:

#   cargo run -- --target-language en --llm-api-key ${LITHO_LLM_API_KEY}

#

# Force regeneration (ignore cache):

#   cargo run -- --force-regenerate

#

# Verbose output:

#   cargo run -- --verbose

#

# Skip specific phases:

#   cargo run -- --skip-preprocessing

#   cargo run -- --skip-research

#   cargo run -- --skip-documentation

#

# Sync external knowledge sources:

#   cargo run -- sync-knowledge

#   cargo run -- sync-knowledge --force

#

# ============================================================================