Difference Between Full Indexing and Fast Indexing Modes in Codebase-Memory-MCP

Full indexing performs a complete repository crawl with deep AST parsing and symbol extraction, while fast indexing uses lightweight tokenization to index only relevant source files, trading depth for speed.

Codebase-Memory-MCP provides two distinct strategies for analyzing repository contents. Understanding the difference between full indexing and fast indexing modes in Codebase-Memory-MCP helps developers optimize for either deep semantic analysis or rapid traversal depending on their workflow requirements.

Indexing Mode Overview

Codebase-Memory-MCP implements both strategies in pkg/pypi/src/codebase_memory_mcp/__init__.py through the Indexer class. The mode parameter accepts either "full" or "fast", determining how the system traverses and analyzes your codebase.

Key Differences Between Full and Fast Indexing

Scope and File Coverage

Full indexing walks the entire directory tree and reads every file, creating a complete memory representation regardless of file type. Fast indexing selectively traverses only files with recognized source extensions, automatically skipping large binary assets and generated files.

Analysis Depth

In pkg/pypi/src/codebase_memory_mcp/__init__.py, full mode performs a complete parse of each file to extract symbols, comments, docstrings, and builds rich vectorized representations including AST and symbol tables. Fast mode performs lightweight tokenization and keyword extraction without constructing deep syntax trees.

Performance Characteristics

Full indexing consumes higher CPU and I/O resources, with indexing time growing linearly with repository size. Fast indexing operates roughly an order of magnitude faster by avoiding costly parsing operations on every file.

Memory and Storage

Full indexing stores detailed indices including AST structures and full-text vectors, resulting in higher RAM consumption. Fast indexing maintains a compact index of shallow token vectors, significantly reducing memory footprint while using the same underlying storage backend.

How to Configure Indexing Modes

You can specify the indexing mode via CLI or Python API. The CLI implementation in pkg/pypi/src/codebase_memory_mcp/_cli.py accepts a --mode argument:


# Fast indexing for quick feedback

codebase-memory-mcp index --mode fast /path/to/repo

# Full indexing for comprehensive analysis

codebase-memory-mcp index --mode full /path/to/repo

Alternatively, use the Python API directly:

from codebase_memory_mcp import Indexer

# Fast mode for rapid overview

fast_indexer = Indexer(mode="fast")
fast_indexer.build("/path/to/repo")

# Full mode for deep analysis

full_indexer = Indexer(mode="full")
full_indexer.build("/path/to/repo")

Summary

  • Full indexing provides comprehensive analysis by parsing every file and extracting detailed AST and symbol information, ideal for refactoring and deep code search.
  • Fast indexing offers rapid repository overview through lightweight tokenization of source files only, perfect for CI checks and quick lookups.
  • Both modes share the same storage backend, allowing seamless switching without data loss.
  • Configure via --mode CLI flag or mode parameter in the Indexer class constructor.

Frequently Asked Questions

Which indexing mode is the default in Codebase-Memory-MCP?

When no mode is specified, the system defaults to full indexing according to the configuration documentation in docs/CONFIGURATION.md. You must explicitly pass --mode fast or mode="fast" to enable the fast indexing behavior.

Can I switch from fast indexing to full indexing without reindexing everything?

Yes. Both indexing modes utilize the same underlying storage backend. You can start with fast indexing for immediate feedback and later switch to full indexing for deeper analysis. The system will augment existing data rather than requiring a complete reindex.

Does fast indexing skip important code files?

Fast indexing intelligently filters files based on recognized source extensions rather than randomly skipping content. While it excludes large binary files and generated assets, it captures all relevant source code files needed for keyword-based searches, though without the deep semantic analysis provided by full indexing.

How much faster is fast indexing compared to full indexing?

Fast indexing typically performs an order of magnitude faster than full indexing. Exact performance gains depend on repository size and composition, but the lightweight tokenization approach avoids the linear CPU and I/O costs associated with parsing every file into AST structures.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →