Skip to content

Commit 8c1c1fd

Browse files
authored
Merge pull request #22 from nuhatech/dev
Release v0.1.21
2 parents 917673a + 2bf04c2 commit 8c1c1fd

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.21] - 2026-02-11
11+
12+
### Fixed
13+
- **Deep research filter safety net**: Added fallback in `_filter_results` so that when the LLM filter returns 0 sources but search results exist, all results are kept instead of being silently discarded. This prevents deep research from returning empty answers when the filter stage produces unparseable output.
14+
1015
## [0.1.20] - 2025-11-15
1116

1217
### Added
@@ -259,7 +264,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
259264
- Example scripts for common use cases
260265
- API reference documentation
261266

262-
[Unreleased]: https://github.com/nuhatech/maktaba/compare/v0.1.20...HEAD
267+
[Unreleased]: https://github.com/nuhatech/maktaba/compare/v0.1.21...HEAD
268+
[0.1.21]: https://github.com/nuhatech/maktaba/compare/v0.1.20...v0.1.21
263269
[0.1.20]: https://github.com/nuhatech/maktaba/compare/v0.1.19...v0.1.20
264270
[0.1.19]: https://github.com/nuhatech/maktaba/compare/v0.1.18...v0.1.19
265271
[0.1.18]: https://github.com/nuhatech/maktaba/compare/v0.1.17...v0.1.18

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "maktaba"
3-
version = "0.1.20"
3+
version = "0.1.21"
44
description = "Production-ready RAG infrastructure for multilingual applications"
55
authors = [
66
{name = "NuhaTech", email = "contact@nuhatech.com"}

src/maktaba/pipeline/deep_research/pipeline.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,16 @@ async def _filter_results(
267267
if 1 <= index <= len(results.results):
268268
filtered_views.append(results.results[index - 1])
269269

270+
# Safety net: if filter returned 0 but results exist, keep all results
271+
if not filtered_views and results.results:
272+
LOGGER.warning(
273+
"deep_research.filter kept=0 but %d results available — "
274+
"returning all results as fallback",
275+
len(results.results),
276+
)
277+
filtered_views = list(results.results)
278+
sources = list(range(1, len(filtered_views) + 1))
279+
270280
LOGGER.info("deep_research.filter kept=%d", len(filtered_views))
271281
return FilteredResultsData(
272282
filtered_results=SearchResultsCollection.from_sequence(filtered_views),

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)