LLMs Technical Reviews

How is a repository ingested and chunked?

Clone or local path; file filters; chunking strategy; supported hosts; large-repo limits.

Verdict

For indexing every file up front, deepwiki-open is the only real choice. For large repos where you want a bounded, predictable read, OpenDeepWiki and RepoWiki cap what they look at most carefully.

Embed everything. deepwiki-open does a --depth=1 clone from GitHub, GitLab or Bitbucket, or reads a local path in place. It keeps files on an extension allow-list and splits each one into 350-word chunks with 100 words of overlap, tagged with line ranges. It skips files above about 82K tokens. There is no file-count cap, so cost grows with the repo.

Scan with fixed limits. RepoWiki takes a local path or a shallow clone of a GitHub, GitLab or Bitbucket URL. It drops files over 200 KB and keeps at most 1,000 files, configs and entry points first. A cached clone is reused forever, so URL scans miss new commits. deepwiki-rs reads a local path only, by default only git ls-files output. Its directory batches allow 256 KB of raw files, but the prompt gets only the first 500 characters of each file plus regex-extracted signatures. readmeX also reads a local path only. It sends each whole file to the LLM, one call per file, with no truncation. *.md is on its default ignore list, so existing Markdown docs are never read.

Let an agent choose. OpenDeepWiki imports Git, ZIP uploads or allow-listed local folders and does not chunk. The catalog agent sees a tree capped at 500 files (350 above 20,000 files) and can open any file later. openDeepWiki (Go) shallow-clones any Git URL with no filters or caps. Its TOC task is queued while the clone is still running, so a slow clone can give a partial plan.

Parse code objects. RepoAgent works only on a local Python git repo. It extracts every function and class with ast and swaps unstaged edits aside, so docs follow the staged code.

Pick: deepwiki-open to index every file for search. Pick: OpenDeepWiki or RepoWiki for big monorepos with a bounded read. Pick: RepoAgent for Python API docs that track commits.

Per-project answers

AsyncFuncAI/deepwiki-open

answered

A repository is ingested via the Repo class in api/repository.py (line 140). It supports GitHub, GitLab, Bitbucket, and local paths — each with its own _clone_from_* function that handles access tokens via URL injection (oauth2:token@ for GitLab, token@ for GitHub, x-bitbucket-api-token-auth for Bitbucket). Clones use git.Repo.clone_from with --depth=1 --single-branch for shallow clones. Local paths skip cloning entirely and are used in-place. The cloned repo path is ~/.deepwiki/repo/.

File filtering is centralized in api/config.py's iterate_files() (line 467). It walks the repo directory and applies: (1) extension whitelisting from code_extensions and doc_extensions config arrays, (2) exclusion mode using default file_filters.excluded_dirs (like node_modules, .venv, .git, dist) merged with request-level exclusions, or (3) inclusion mode when included_dirs/included_files are specified. Default excluded dirs are extensive (line 3-40 of repo.json).

Chunking happens in the RAG pipeline, not at ingestion. api/rag/pipeline.py's LineTrackingTextSplitter (line 174) uses adalflow's TextSplitter with split_by: word, chunk_size: 350, chunk_overlap: 100 (from embedder.json line 36-41). Each chunk gets annotated with its 1-based start_line/end_line within the original file. Files exceeding MAX_EMBEDDING_TOKENS * 10 (82K tokens) are skipped (line 126). The pipeline then embeds each chunk and saves to a local LocalDB pickle file at `/.adalflow/databases/(line 247-274). Large-repo limits are configurable viaMAX_CONCURRENT_WIKI_TASKS(defaults to half CPU cores) andWIKI_PAGE_CONCURRENCY(default 1) inapi/services/wiki/tasks.py` (lines 62-68).

AIDotNet/OpenDeepWiki

answered

Repository sources and hosts. Repositories are imported via RepositorySource.Parse() in RepositoryAnalyzer (src/OpenDeepWiki/Services/Repositories/RepositoryAnalyzer.cs:82) which supports three RepositorySourceType values: Git (remote Git URL), Archive (uploaded ZIP), and LocalDirectory (approved local paths). Git repos use LibGit2Sharp for clone/pull, with retries (default 3 attempts, 1 s delay). Local directories are either symlinked or copied under REPOSITORIES_DIRECTORY. ZIP archives are extracted via ZipFile.ExtractToDirectory. The config object RepositoryAnalyzerOptions (line 15) specifies the base clone directory (/data by default) and an allowlist AllowedLocalPathRoots for local imports.

File filters and scan plans. The RepositoryFileFilter class (src/OpenDeepWiki/Agents/Tools/RepositoryFileFilter.cs:6) parses .gitignore files recursively and applies their patterns via GitIgnorePatternToRegex (line 181). Hidden paths (.-prefixed directories) are automatically skipped, and binary files are filtered by extension. The scan plan resolver RepositoryScanPlanResolver (src/OpenDeepWiki/Services/Repositories/RepositoryScanPlanResolver.cs:12) profiles the working directory — counting files/directories by depth, extension distributions, key files (READMEs, Makefiles, etc.) — and then applies rule-based heuristics (line 87–125). For repos with >20000 total files, tree depth is clamped to 2, max total files to 350; for 5000–20000, depth goes to 3; under 5000, depth 4. Max tree nodes budget is 1500, max files per directory 30, max total files 800.

Large-repo limits. The hardcoded budgets act as safety valves: MaxTreeNodeBudget = 1500, MaxFilesPerDirectoryBudget = 30, MaxTotalFileBudget = 800 (line 15–19). These are used in Clamp() calculations in DecideByRules() (line 87). The plan can also be set to Manual mode where overrides from the repository entity are used, or Auto where it is computed and persisted.

Chunking strategy. This project does NOT chunk source code into fixed-size blocks for embedding. Instead the entire workspace (or a bounded directory/file listing) is provided to an AI agent via tool calls. The file listing depth, max nodes, and max files per directory are the chunking controls — they limit how much of the tree is presented to the LLM in a single catalog/content generation call.

Editor's note. Correction: the effective file-tree cap is min(MaxTotalTreeFiles, 500), dropping to 350 above 20,000 files. The 800 and 1,500 values are only outer clamps. During generation the tool budget caps each read at 240 lines, each listing at 20 entries and each grep at 12 results.

sopaco/deepwiki-rs

answered

Repository ingestion is a multi-step process orchestrated by PreProcessAgent.execute() in src/generator/preprocess/mod.rs. First, StructureExtractor.extract_structure() (src/generator/preprocess/extractors/structure_extractor.rs) scans the project directory recursively using tokio::fs::read_dir, respecting configurable filters: excluded_dirs, excluded_files, excluded_extensions, included_extensions, max_file_size (default 512KB), max_depth (default 10), include_hidden, and include_tests. When git_tracked_only is true, it runs git ls-files and skips untracked files. Binary files are detected by extension. Each file gets a heuristic importance score based on path, extension, and size. Directories also receive an LLM-boosted score via DirectoryScorer. The structure is cached under key structure_<path>.

Second, original_document_extractor.extract() (src/generator/preprocess/extractors/original_document_extractor.rs) reads README.md from the project root, stripping markdown headers and code fences, keeping the first 500 lines as a plain-text description.

Third, generate_directory_dossiers() reads each directory's files from disk (respecting all the same exclusions), batches them at 256KB total content per LLM call, and sends them to DirectorySummarizer which produces a DirectoryDossier (purpose, importance score, summary, key files). If a single batch call fails, a fallback dossier with empty summary is used. Larger directories are split into multiple lexicographically-sorted batches and merged via summarize_batch().

Finally, RelationshipsAnalyze analyzes inter-directory relationships from the dossiers. All results are stored in Memory under MemoryScope::PREPROCESS. There is no cloning step — the tool operates on a local path. Supported hosts are all filesystem directories. Large repos are handled via the 256KB batch limit, importance-based file filtering, and max_file_size truncation.

Editor's note. Correction: the 256 KB batch limit is measured on raw file size, but the dossier prompt contains only the first 500 characters of each file plus regex-extracted interfaces, imports and line/function counts (directory_summary.rs build_summary_prompt), so the LLM never sees whole files at this stage.

OpenBMB/RepoAgent

answered

RepoAgent ingests a local filesystem path to a Python repository — there is no remote cloning. The path is specified via --target-repo-path / -tp, defaulting to path/to/your/target/repository (repo_agent/main.py:129).

File filtering works through two layers:

  • A GitignoreChecker reads .gitignore patterns, splitting them into folder and file patterns; on os.walk it prunes ignored directories entirely and skips non-.py files (repo_agent/utils/gitignore_checker.py:99-124).
  • An additional --ignore-list / -i CLI flag supplies extra file-path prefixes to skip (repo_agent/main.py:109); this is checked inside need_to_generate() in doc_meta_info.py:96-106.
  • Unstaged new/modified files are handled via a "fake file" mechanism: Git's index content for modified-but-unstaged files is written into a temp _latest_version.py while the working-copy is renamed, so the scanner sees the committed version plus the uncommitted diff separately (repo_agent/utils/meta_info_utils.py:13-79). Untracked .py files are added to a jump_files list and skipped entirely.

Chunking strategy is per-function/per-class, not fixed-token windows. FileHandler.generate_overall_structure() walks every non-ignored .py file, parses it with ast.parse(), and extracts every FunctionDef, ClassDef, and AsyncFunctionDef plus their source lines and parameter lists (file_handler.py:176-215, 258-305). The result is a flat dict of file paths to object lists, later assembled into a tree by MetaInfo.from_project_hierarchy_json() based on line-number containment (doc_meta_info.py:932-998).

Supported hosts: the target repo must be a local directory with a git history (for diff detection). There is no GitHub/GitLab/remote-host abstraction. Only Python is supported — AST-based parsing means no other language can be ingested.

Large-repo limits: the --max-thread-count / -mtc flag (default 4) controls how many doc-generation tasks run concurrently (main.py:120-123). The reference-parsing step (using Jedi) walks every file and every object, which could be slow for very large repos, but there is no explicit file-size or object-count cap. The topology-based task scheduler avoids circular-reference deadlocks with a best-effort fallback (doc_meta_info.py:637-676).

Editor's note. Correction: --target-repo-path defaults to an empty string, not a placeholder path. For modified-but-unstaged files the working copy is renamed to <name>_latest_version.py and the index version is written under the original name, so documentation is generated from the staged code.

aibox22/readmeX

answered

The project does not clone repositories — it works exclusively on a local filesystem path provided via CLI arg or interactive input (cli.py:30-34, core.py:267-301). File discovery uses find_files() with glob patterns: SCRIPT_PATTERNS = ['*.py', '*.sh', '*.ipynb'] and DOCUMENT_PATTERNS = ['*.md', '*.txt'] (config.py:235-236). Gitignore patterns are loaded from the project’s .gitignore and merged with a built-in ignore list (DEFAULT_IGNORE_PATTERNS in config.py:211-232) that excludes .git, __pycache__, node_modules, *.md (so markdown files themselves are not re-processed), build/, dist/, virtual envs, IDE dirs, and __init__.py files. A much larger ignore-patterns config lives in config/ignore_patterns.json for the LanguageAnalyzer — hundreds of patterns covering Python, JS, Rust, and more. There is no chunking in the traditional RAG sense: for README generation, each matched file is read in full and its content sent in a prompt to the LLM for a description, using ThreadPoolExecutor (configurable max_workers, default 10) via _get_script_descriptions() (core.py:690-832). For the website path, the CodeRAG.extract_code_blocks() method (code_rag.py:188-217) does AST-level parsing of .py files only — it walks each file’s AST with ast.walk() and extracts FunctionDef, ClassDef, methods, and import statements into individual CodeBlock dataclass instances with type, signature, docstring, complexity score, and dependency lists. No large-repo limits are enforced beyond available memory and thread count.

Editor's note. Correction: README-mode file selection uses the extensions of the primary language detected by LanguageAnalyzer plus *.md/*.txt; SCRIPT_PATTERNS (*.py, *.sh, *.ipynb) is only the fallback. Because *.md is also in the default ignore list, Markdown files are never actually read.

he-yufeng/RepoWiki

answered

Ingestion starts with ingest_local() or ingest_github() (src/repowiki/ingest/local.py:41-62, src/repowiki/ingest/github.py:70-127). For local repos, ingest_local() calls scan_directory() (src/repowiki/core/scanner.py:253-406), which walks the directory tree, filtering out:

  • Well-known skip dirs (.git, node_modules, __pycache__, dist, etc.) (scanner.py:14-20)
  • Binary/media/archive file extensions (.png, .zip, .exe, .pyc, .lock, etc.) (scanner.py:22-35)
  • Sensitive files (.env, .npmrc, SSH keys) (scanner.py:37-48)
  • Minified source files (heuristic: long lines, few non-empty) (scanner.py:195-205)
  • Files larger than 200 KB, symlinks, and binary blobs (null byte check) (scanner.py:316-343)

It also reads .gitignore and .repowikiignore via IgnoreRules (scanner.py:145-173). A hard cap of 1000 files applies; when exceeded, files are priority-sorted (configs first, then code, then docs/assets) and the lowest-priority excess is dropped (scanner.py:374-392).

For GitHub repos, ingest_github() parses github.com, gitlab.com, and bitbucket.org URLs (github.py:21-38). It runs git clone --depth 1 --single-branch with an optional GITHUB_TOKEN for private repos (github.py:98-105), checks the repo is under 500 MB (github.py:120-125), caches the clone in ~/.repowiki/repos/, and then delegates to ingest_local() (github.py:88).

Chunking for RAG (not analysis) happens in _split_into_chunks() (src/repowiki/core/rag.py:358-387): it splits file content into chunks of at most 30 lines, preferring blank-line boundaries when the chunk has at least 5 lines. Each chunk carries its file path and line range for citation.

weibaohui/openDeepWiki

answered

Repository ingestion starts when a user submits a Git URL via POST /api/repositories. The RepositoryService.Create() method normalizes the URL (supporting HTTPS and SSH formats via git.NormalizeRepoURL), checks for duplicates, and persists the repo with pending status. An async event (RepositoryEventAdded) triggers cloneRepository() in repository_clone.go, which uses git clone --depth 1 (shallow clone) to clone into {Data.RepoDir}/{repoName}-{timestamp}. After cloning, it records the branch, commit hash, and directory size, then transitions the repo to ready status. There is no chunking or file-level filtering — the entire repository is available at the filesystem level. Analysis is performed by AI agents that read files directly using tools (read_file, list_dir, search_files in tools_providers.go). Supported hosts: any Git host reachable via HTTP/HTTPS or SSH — the URL normalizer validates the format but does not restrict hosts. Large-repo limits are limited only by the shallow clone strategy (--depth 1); there is no explicit file-count or size cap in the code.

How is retrieval (RAG) implemented? →