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 FolderTree panel, each file and folder shows a weight badge. Click the badge to edit the weight:
Screenshot: Path Weight Badges
Show the FolderTree panel with various colored badges (green boost, red suppress, blue manual) on files/folders.
- Grey badge — inherited from parent (no override)
- Blue badge — explicitly set weight
- Green badge — boosted (> 1.0)
- Red badge — suppressed (< 1.0)
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.