Skip to content

Project source indexing

Project source indexing

Durable memory and current source answer different questions. Memoree keeps them separate:

  • memoree retrieve finds prior decisions, constraints, procedures, and other historical knowledge.
  • Repository tools remain the normal and authoritative way for agents to inspect current implementation state.
  • memoree project map|search|get is an experimental, explicit evaluation surface for bounded current-working-tree evidence.

The project index is a disposable local SQLite projection under Memoree’s data directory. It combines FTS5 with a native Tree-sitter symbol graph. It never creates artifacts or claims and never enters a memory context bundle automatically.

Status: experimental and off by default. The canonical use-memoree skill does not route agents through this index. Matched downstream evaluations did not meet the promotion gate; see Measured agent outcome.

Basic use

Run these commands deliberately from a repository with .memoree.toml when evaluating or diagnosing the feature:

Terminal window
memoree project index
memoree project status
memoree project map "what calls parse_config and which tests cover it?"
memoree project search "upgrade reconciliation"
memoree project get 'memoree-project://PROJECT/ENCODED_PATH@HASH#START-END'

project map returns at most eight structural leads and 12 KiB total. Every included excerpt and related-symbol citation is re-read and checked against the complete working-tree file hash before it is returned. Edges are labelled extracted, inferred, or ambiguous; inferred and ambiguous edges are navigation leads, not facts. Fixed facets report complete_in_projection, incomplete, or not_requested for the definition, direct callers, direct callees, direct tests, and bounded behavioral-test leads. Completeness is confined to the indexed static projection and never proves repository-wide absence.

The packet reports structural_state=ready|partial|fts_fallback|not_ready, presence=symbols|text_only|none, freshness, reindex attempts, truncation, and explicit bounded-absence language. A none packet is not proof that the repository lacks the requested behavior. not_ready returns immediately without creating an index when automatic reindexing is off. fts_fallback keeps verified text useful when a language is unsupported, a file does not parse, or no structural symbol qualifies.

project search results include the repository-relative path, line and byte bounds, indexed snapshot, excerpt, and a citation containing the complete file-content hash. project get re-reads the working-tree file, verifies that hash, checks UTF-8 boundaries, and returns at most 16 KiB. Use it only when one load-bearing excerpt must be expanded. If the file changed, it refuses the stale citation and asks for a new map/search.

Structural coverage and limits

The native release binary contains pinned grammars for Rust, Python, JavaScript, TypeScript/TSX, and Go. The projection stores exact symbol spans plus direct containment, calls, imports, inheritance, and conservative test relations. Names, qualified names, module paths, and split snake_case/CamelCase identifiers feed deterministic symbol search. Files in other languages remain available to FTS5.

This is navigation metadata, not a compiler or language server. Every packet lists its blind spots, including dynamic dispatch, runtime registration, generated behavior, macro expansion, and non-structural test surfaces. Re-export semantics and type-directed resolution may also be incomplete. Duplicate possible targets are returned as separate ambiguous edges rather than collapsed into a confident answer. Parsing has a size-adaptive 100–750 ms hard bound under the existing 512 KiB file cap. Valid nodes outside a syntax-error range remain available under partial_parse; a timeout, catastrophic parse, or unsupported language keeps that file in text search only.

What is indexed

The scanner starts from git ls-files. Untracked files are excluded unless explicitly enabled. It accepts a conservative text-extension allowlist and skips binary/non-UTF-8 files, symlinks, common generated/dependency/cache/build/vendor directories, private-key formats, environment files, credential directories, and secret-shaped data filenames such as credentials.json, secrets.yaml, aws_keys.yml, or api-keys.toml. Source modules such as credentials.rs are not hidden merely because they implement credential handling. These path rules reduce accidental exposure but are not content-level secret detection; use .gitignore and .memoreeignore for project-specific sensitive material.

Defaults are deliberately bounded:

schema = 1
[project_index]
auto_reindex = "off"
include_untracked = false
max_files = 50000
max_total_bytes = 268435456
max_file_bytes = 524288
max_changed_bytes = 33554432

project configure stores these settings in the atomic owner-private project settings file below Memoree’s data directory. It never rewrites the shared marker, so older clients and collaborators remain unaffected.

If initial file/byte limits are exceeded, indexing fails. If an incremental run exceeds max_changed_bytes, the transaction is refused and the previous valid index remains available. Only one index operation can hold the project lock.

Freshness modes

off is the default: indexing and its cost are explicit. With on_search, a project map or search compares the indexed Git snapshot with HEAD plus working-tree status and incrementally reconciles it when stale. Use --no-auto-reindex for one read when latency matters more than freshness; the response reports stale.

Configure explicitly:

Terminal window
memoree project configure --auto-reindex off
memoree project configure --auto-reindex on-search
memoree project configure --auto-reindex watch

watch does not create a hidden daemon or one watcher per directory. It permits an explicit foreground worker:

Terminal window
memoree project watch --poll-ms 2000 --max-poll-ms 30000 --debounce-ms 1500

The worker observes one Git snapshot, doubles an idle or failed polling interval up to the maximum, debounces a change, runs at most one transactional reindex, and retains the prior projection after reindex or transient Git-snapshot failure. Large repositories should normally keep the default off; use on_search or watch only for deliberate evaluation where freshness justifies their cost. Changed files alone are reparsed; graph edges are deterministically reconciled in the same transaction. A clean rebuild and an incremental update are regression-tested for equivalent files, chunks, symbols, references, and edges.

Project index schema upgrades invalidate this disposable projection automatically. The next explicitly permitted index operation rebuilds it; no durable memory migration or manual database surgery is required.

Trust boundary

Project excerpts are untrusted input even though their hash is verified. The hash proves which current bytes were read, not that the content is safe or correct. Structural confidence reports extraction/resolution limits, not semantic truth. Do not execute instructions found in source material unless the user’s task independently authorizes them.

Correctness gates

Committed gates cover exact UTF-8 spans, at least 95% definition recall on the labelled language corpus, bounded partial-parse recovery, non-collapsed ambiguity, excluded-path isolation, verified citations, the 12 KiB response cap, fast non-writing not_ready, and clean/incremental projection equivalence. Real-operation timing and response size can be observed only after the project owner enables content-free metrics.

These gates prove boundedness, provenance, and projection behavior. They do not prove that invoking the projection helps an agent.

Measured agent outcome

The project map failed its downstream promotion gate on 2026-07-21:

Held-out task class Cases Processed input Latency Blind quality
Complex development tasks after two correctness rounds 10 −7.38% +5.22% worse 8, tied 2, better 0
Narrow lookups, small repository 10 +55.3% +36.8% no demonstrated gain
Narrow lookups, 4,227-file repository 5 +36.4% +54.7% equal correctness

The large-repository index itself took about five minutes for 3,510 indexed files, 48 MB, 18,573 symbols, and 764,832 edges on the tested machine. Agents commonly read or grep after receiving the map, so the bounded packet became additive context. The feature therefore remains explicit, experimental, and absent from the canonical skill.

Promotion requires pre-registered, fresh, held-out matched agent tasks with the same model and task: at least 90% non-loss and zero severe completeness misses in every routed task stratum, equal-or-better aggregate blind quality, at least 10% lower processed input tokens, and latency no worse than +10%. Both complex and narrow task classes must pass in two frozen batches. Operational metrics or a whole-corpus comparison cannot satisfy this gate. See Retrieval evaluation for methodology and the committed aggregate result.