Skip to content

Move components out of experimental package#556

Open
stellasia wants to merge 6 commits into
neo4j:mainfrom
stellasia:estelle/components-out-of-experimental
Open

Move components out of experimental package#556
stellasia wants to merge 6 commits into
neo4j:mainfrom
stellasia:estelle/components-out-of-experimental

Conversation

@stellasia

@stellasia stellasia commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Move all components out of the experimental namespace. In order not to import from experimental to the regular namespace, also had to move a couple of other classes:

  • Component base class that was in experimental.pipeline.component
  • RunContext and TaskProgressNotifierProtocol which are part of the Component definition
  • Change type of exception raised when the component subclass is not valid: from PipeineDefinitionError to ComponentDefinitionError

All the rest is moving files around without changes and renaming imports.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Note

Please provide an estimated complexity of this PR of either Low, Medium or High

Complexity:

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@stellasia stellasia requested a review from a team as a code owner July 7, 2026 13:34
@stellasia stellasia marked this pull request as draft July 7, 2026 13:36
@stellasia stellasia force-pushed the estelle/components-out-of-experimental branch from 080bf34 to c80c8ed Compare July 7, 2026 13:46


@runtime_checkable
class TaskProgressNotifierProtocol(Protocol):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to move these two classes here to avoid importing from experimental (+ avoid circular import issue)

pass


class ComponentDefinitionError(Exception):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces a PipelineDefinitionError to avoid importing from experimental (+ PipelineDefinitionError will probably be deprecated as we replace the pipeline)

@stellasia stellasia marked this pull request as ready for review July 8, 2026 07:22
def __getattr__(name: str) -> Any:
warnings.warn(
f"Importing component {name} from the experimental namespace is deprecated and will be removed in version `2.0`. Use `from neo4j_graphrag.components... import ...` instead.",
DeprecationWarning,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and it seems that the deprecation warnings are not working as expected/documented.
For example, from neo4j_graphrag.experimental.components.entity_relation_extractor import LLMEntityRelationExtractor raises ModuleNotFoundError with no deprecation warning. This seems to needs a different mechanism to intercept submodule imports across the whole subtree? eg a sys.meta_path finder that redirects the whole subtree?
Worth adding a small unit test that imports moved path and asserts both that it resolves to the same object and that a DeprecationWarning is raised correctly.

"Store",
"InMemoryStore",
"Component",
"DataModel",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also here re-export old imports + warn?

Comment thread CHANGELOG.md
- Import from the experimental namespace will be removed in 2.0
- Update to use `from neo4j_graphrag.components... ` instead
- Improperly defined components now raise a `ComponentDefinitionError` instead of `PipelineDefinitionError`
- `TaskProgressNotifier` and `RunContext` have been moved to `neo4j_graphrag.components.base`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: TaskProgressNotifierProtocol instead of TaskProgressNotifier

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.

2 participants