Path Weights
Boost or suppress specific files and folders in search results without rebuilding your index.
What are path weights?
Path weights are multipliers applied to search scores at query time. A weight of 1.5 boosts a folder's chunks by 50%. A weight of 0.0 effectively excludes it. The default weight is 1.0 (no change).
- Applied at search time — no rebuild required
- Hierarchical — a folder weight applies to all files inside it
- Most-specific wins — a file weight overrides its parent folder weight
- Range:
0.0to2.0
How it works
src/auth/login.py, SourcePrep checks: src/auth/login.py → src/auth/ → src/ → default (1.0).final_score = base_score × role_weight × path_weightUsing the dashboard
In the project's Knowledge Scope panel, each file and folder shows its current weight as a small ×N.N control on the right side of the row. Click any weight to edit it inline.
Visual cues on the ×N.N control:
- ×1.5 — green tint means a boost (> 1.0).
- ×0.5 — amber tint means a suppression (< 1.0).
- ×1.0 — faded means default (no override on this path).
- italic — the weight is inherited from a parent folder, not explicitly set on this row.
The colored dots/circles you may see elsewhere on the row are indexing status indicators (indexed, pending, ignored), not weight indicators — different concept.
Changes take effect immediately on the next search — no rebuild needed.
API usage
Set weights
Get weights
Common patterns
API reference
Set path weights. Body: { "path_weights": { "path": weight } }. Weights are clamped to 0.0–2.0 and persisted to repo_policy.json.
Returns the current path weights for the project.
Project Scope & Patterns
While path weights control ranking, the Project Settings panel controls what gets indexed in the first place. This is the coarse-grained filter before weights are applied.
Include Patterns
Glob patterns that define the allowed set of files. Think of this as an allowlist.
**/*.py- All Python filessrc/**/*- Everything in srcdocs/*.md- Root docs only
Exclude Patterns
Glob patterns for files to strictly ignore, even if they match an include pattern.
**/node_modules/**- Dependencies**/dist/**- Build artifacts**/*.test.ts- Tests (optional)
.gitignore automatically.