Configuration
An RCE Code index is configured with one object: CodeConfig, a frozen dataclass. It names the repository to index, where the SQLite database lives, the ingest limits, and whether embeddings are enabled. Pass an instance to CodeEngine.open_or_create(repo_path, config=...), or omit it and let the facade build a default one from the repo path.
Import it from the package root:
Frozen and validated on construction
CodeConfig is @dataclass(frozen=True) — fields cannot be reassigned after construction. Its __post_init__ derives db_path and normalizes repo_path to a Path at construction time (described below).Fields
| Field | Type | Default | Description |
|---|---|---|---|
repo_path | Path | required | The tree to index. The only required field. Accepts a str or Path; it is coerced to a Path in __post_init__. |
db_path | Path | None | None → <repo>/.rce/code/index.db | SQLite database location. When left as None, it is derived in __post_init__ as repo_path / ".rce" / "code" / "index.db". |
max_file_size | int | 1_000_000 (bytes) | Ingest limit: files larger than this are skipped. |
max_chunk_lines | int | 60 | Ingest limit on chunk size, in lines. |
enable_embeddings | bool | False | Whether semantic embedding is on. |
vector_backend | str | "numpy" | Vector backend: "numpy" (the portable default) or "sqlite-vec". See Vector Backends. |
extra_ignore | tuple[str, ...] | () (empty tuple) | Additional ignore globs, layered on top of the built-in ignore set. |
enable_embeddings vs. embedding behavior
enable_embeddings is a configuration flag and defaults to False. Whether embeddings are actually computed is driven by calling engine.embed() and by which embedder you pass to open_or_create; see Embedders.Construction and __post_init__
Because the dataclass is frozen, __post_init__ uses object.__setattr__ to perform two normalizations the moment a config is built:
- db_path derivation. If
db_pathisNone, it is set torepo_path / ".rce" / "code" / "index.db". After construction,db_pathis therefore neverNone—open_or_createrelies on this and asserts it. - repo_path coercion.
repo_pathis wrapped inPath(...), so passing a plain string is fine; it is stored as aPath.
Examples
Default configuration
The simplest path is to skip the config entirely and let CodeEngine.open_or_create build a default CodeConfig from the repo path:
Equivalently, construct the config explicitly and pass it in:
Custom db_path
Override db_path to keep the index outside the repository — useful for read-only checkouts or shared cache directories:
sqlite-vec vector backend
Switch the vector backend from the default "numpy" to "sqlite-vec". See Vector Backends for the trade-offs and the extra dependency it requires:
Extra ignore globs and ingest limits
Layer additional ignore globs on top of the built-in set, and tighten the ingest limits:
Where config feeds in
repo_path, max_file_size, max_chunk_lines, and extra_ignore shape the indexing pipeline; db_path selects the SQLite store; and vector_backend selects how embeddings are stored and queried for semantic search.