Lower search.max_context_chars default to 5000

This commit is contained in:
Yiorgis Gozadinos 2026-07-14 11:58:42 +03:00
parent b9434045b9
commit c1ec13f081
No known key found for this signature in database
6 changed files with 7 additions and 6 deletions

View file

@ -4,6 +4,7 @@
### Changed
- Unknown `reranking.model.provider` raises `ValueError` instead of silently disabling reranking.
- `search.max_context_chars` default lowered from 10000 to 5000.
### Removed

View file

@ -110,7 +110,7 @@ qa:
search:
limit: 10 # Default number of results to return
max_context_chars: 10000 # Maximum characters in expanded context
max_context_chars: 5000 # Maximum characters in expanded context
vector_index_metric: cosine # cosine, l2, or dot
vector_refine_factor: 30

View file

@ -7,11 +7,11 @@ Configure search behavior and context expansion:
```yaml
search:
limit: 10 # Default number of results to return
max_context_chars: 10000 # Maximum characters in expanded context
max_context_chars: 5000 # Maximum characters in expanded context
```
- **limit**: Default number of search results to return when no limit is specified. Used by CLI, MCP server, and QA. Default: 10
- **max_context_chars**: Hard limit on total characters in expanded content. Default: 10000.
- **max_context_chars**: Hard limit on total characters in expanded content. Default: 5000.
Context expansion is automatic and section-aware. For structured documents (with section headers), expansion includes the entire section containing the match. For sections that exceed the budget or are too small (e.g., a title+authors area), expansion grows outward item-by-item from the match center, skipping noise labels (footnotes, page headers). This naturally crosses into adjacent sections until the budget is filled. Picture and table matches are exempt: they return their enclosing section as-is and never cross section boundaries. For unstructured documents, expansion grows outward item-by-item. Results without `doc_item_refs` (e.g., custom chunks passed to `import_document`) pass through unexpanded.

View file

@ -302,7 +302,7 @@ Context expansion is automatic and section-aware. For structured documents (with
Configuration:
- **search.max_context_chars**: Maximum characters in expanded context. Default: 10000.
- **search.max_context_chars**: Maximum characters in expanded context. Default: 5000.
**Smart Merging**: When expanded results overlap within the same document, they are automatically merged into a single result with continuous content and the highest relevance score.

View file

@ -165,7 +165,7 @@ qa:
search:
limit: 5
max_context_chars: 10000
max_context_chars: 5000
```
See [Search and question answering](../configuration/qa.md) for every knob.

View file

@ -229,7 +229,7 @@ class ProcessingConfig(BaseModel):
class SearchConfig(BaseModel):
limit: int = 5
max_context_chars: int = 10000
max_context_chars: int = 5000
vector_index_metric: Literal["cosine", "l2", "dot"] = "cosine"
vector_refine_factor: int = 30