diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e7445ac..d282aec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog ## [Unreleased] +### Fixed + +- **Search tool regression**: Removed LLM-facing `filter` parameter from search and list_documents tools. The SQL WHERE clause description confused LLMs, degrading QA accuracy. Document filtering is now handled programmatically via `base_filter` and `state.document_filter` + ## [0.32.2] - 2026-02-28 ### Fixed diff --git a/haiku_rag_slim/haiku/rag/skills/rag.py b/haiku_rag_slim/haiku/rag/skills/rag.py index 776db28a..856b6b30 100644 --- a/haiku_rag_slim/haiku/rag/skills/rag.py +++ b/haiku_rag_slim/haiku/rag/skills/rag.py @@ -140,19 +140,17 @@ def create_skill( ctx: RunContext[SkillRunDeps], limit: int | None = None, offset: int | None = None, - filter: str | None = None, ) -> list[dict[str, Any]]: - """List documents in the knowledge base with optional pagination and filtering. + """List documents in the knowledge base with optional pagination. Args: limit: Maximum number of documents to return. offset: Number of documents to skip. - filter: Optional SQL WHERE clause to filter documents. """ from haiku.rag.client import HaikuRAG async with HaikuRAG(db_path, config=config, read_only=True) as rag: - documents = await rag.list_documents(limit, offset, filter) + documents = await rag.list_documents(limit, offset) result = [ { "id": doc.id, diff --git a/tests/tools/test_search.py b/tests/tools/test_search.py index 69ee447f..33adc1d6 100644 --- a/tests/tools/test_search.py +++ b/tests/tools/test_search.py @@ -67,19 +67,6 @@ class TestSearchToolExecution: assert result == "No results found." - @pytest.mark.asyncio - async def test_search_with_filter(self, search_client, search_config): - """Search tool respects filter parameter.""" - accumulated: list[SearchResult] = [] - toolset = create_search_toolset(search_config, on_results=accumulated.extend) - - search_tool = toolset.tools["search"] - ctx = make_ctx(search_client) - await search_tool.function(ctx, "programming", filter="title LIKE '%Python%'") - - for r in accumulated: - assert "JavaScript" not in (r.document_title or "") - @pytest.mark.asyncio async def test_search_with_base_filter(self, search_client, search_config): """Search toolset respects base_filter parameter."""