Skip to content

Deprecate semantic guided retriever#239

Merged
oussamahansal merged 8 commits intomainfrom
deprecate-semantic-guided-retriever
May 7, 2026
Merged

Deprecate semantic guided retriever#239
oussamahansal merged 8 commits intomainfrom
deprecate-semantic-guided-retriever

Conversation

@oussamahansal
Copy link
Copy Markdown
Collaborator

@oussamahansal oussamahansal commented May 5, 2026

Summary

Moves semantic-guided retriever classes into a deprecated/ sub-package with deprecation warnings. Existing imports continue to work but emit DeprecationWarning.

Rationale

The semantic-guided search approach requires maintaining a dedicated statement vector index, which adds storage cost and indexing overhead. The traversal-based search achieves equivalent or better results using only the chunk index.

Migration Guide

Before (deprecated) After (recommended)
from graphrag_toolkit.lexical_graph.retrieval.retrievers import SemanticGuidedRetriever Use CompositeTraversalBasedRetriever
from graphrag_toolkit.lexical_graph.retrieval.retrievers import SemanticGuidedChunkRetriever Use CompositeTraversalBasedRetriever
LexicalGraphQueryEngine.for_semantic_guided_search() LexicalGraphQueryEngine.for_traversal_based_search()

What still works (backward compat)

  • All existing imports resolve without error (via __getattr__ lazy loading)
  • A DeprecationWarning is emitted on first use
  • No code changes required for existing users until removal

Removal timeline

Targeted for removal in the next major version. Users should migrate before then.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Lexical Graph Coverage Report: The coverage is at unknown% (target: unknown%). Download the HTML report here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Lexical Graph Coverage Report: The coverage is at 46.56% (target: 80%). Download the HTML report here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Lexical Graph Coverage Report: The coverage is at 46.56% (target: 80%). Download the HTML report here.

Comment thread lexical-graph/src/graphrag_toolkit/lexical_graph/lexical_graph_query_engine.py Outdated
Comment thread lexical-graph/src/graphrag_toolkit/lexical_graph/storage/vector_store_factory.py Outdated
Comment thread docs-site/src/content/docs/lexical-graph/storage-model.mdx Outdated
Oussama Hansal and others added 2 commits May 6, 2026 12:59
Removed an unnecessary blank line for cleaner code.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Lexical Graph Coverage Report: The coverage is at unknown% (target: unknown%). Download the HTML report here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Lexical Graph Coverage Report: The coverage is at unknown% (target: unknown%). Download the HTML report here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Lexical Graph Coverage Report: The coverage is at 46.03% (target: 80%). Download the HTML report here.

@mykola-pereyma
Copy link
Copy Markdown
Contributor

mykola-pereyma commented May 6, 2026

can you add a tests to check deprecation logic?
like tests/unit/retrieval/test_deprecated_imports.py

import pytest
import warnings

def test_deprecated_import_emits_warning():
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter('always')
        from graphrag_toolkit.lexical_graph.retrieval.retrievers import SemanticGuidedRetriever
        assert len(w) == 1
        assert issubclass(w[0].category, DeprecationWarning)
        assert 'deprecated' in str(w[0].message).lower()

def test_unknown_attribute_raises():
    with pytest.raises(AttributeError):
        from graphrag_toolkit.lexical_graph.retrieval.retrievers import NonExistentClass

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Lexical Graph Coverage Report: The coverage is at 46.03% (target: 80%). Download the HTML report here.

@oussamahansal oussamahansal merged commit 4a36ca8 into main May 7, 2026
9 checks passed
@oussamahansal oussamahansal deleted the deprecate-semantic-guided-retriever branch May 7, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants