Skip to content

Comments

feat(sdk): add cgr shim package for short Python imports#353

Merged
vitali87 merged 1 commit intomainfrom
feat/cgr-sdk-shim
Feb 21, 2026
Merged

feat(sdk): add cgr shim package for short Python imports#353
vitali87 merged 1 commit intomainfrom
feat/cgr-sdk-shim

Conversation

@vitali87
Copy link
Owner

Summary

  • Add cgr/ shim package that re-exports SDK components from codebase_rag
  • Register cgr in [tool.setuptools] packages

Users who pip install code-graph-rag can now use short imports:

from cgr import load_graph, GraphLoader, MemgraphIngestor, CypherGenerator, embed_code, settings

Instead of the longer form:

from codebase_rag.graph_loader import load_graph
from codebase_rag.services.graph_service import MemgraphIngestor
from codebase_rag.services.llm import CypherGenerator

Both import styles continue to work. The cgr CLI command is unaffected.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vitali87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the developer experience for the code-graph-rag SDK by simplifying import statements. It achieves this by creating a new cgr shim package that re-exports key functionalities, making the SDK more convenient and concise to use without affecting existing import styles or the cgr CLI command.

Highlights

  • Shorter Python Imports: Introduced a new cgr shim package that re-exports core SDK components from codebase_rag, enabling users to import functionalities like load_graph, GraphLoader, and MemgraphIngestor directly from cgr.
  • Package Registration: Registered the newly created cgr package within the pyproject.toml file under [tool.setuptools] packages to ensure it is properly included during installation.
Changelog
  • cgr/init.py
    • Added a new shim package to re-export core SDK components.
  • pyproject.toml
    • Registered the new cgr package with setuptools.
  • uv.lock
    • Updated the code-graph-rag package version.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 21, 2026

Greptile Summary

Adds a convenience shim package cgr/ that provides shorter import paths for the SDK's main components. Users can now use from cgr import load_graph, GraphLoader instead of from codebase_rag.graph_loader import load_graph, GraphLoader. Both import styles remain supported.

The implementation:

  • Creates a new cgr/__init__.py with re-exports from codebase_rag
  • Registers the cgr package in pyproject.toml for setuptools discovery
  • Updates version to 0.0.78 in the lock file

The change is backwards compatible and follows the same pattern as the existing codec package. All re-exported symbols (settings, embed_code, GraphLoader, load_graph, MemgraphIngestor, CypherGenerator) exist in the codebase and are properly imported.

Confidence Score: 5/5

  • Safe to merge with no issues
  • This is a straightforward, low-risk convenience feature that adds a shim package for shorter imports. All re-exported components exist and are correctly imported. The change is purely additive (no modifications to existing code), backwards compatible, and follows established patterns in the codebase (similar to the codec package). The package is properly registered in pyproject.toml for setuptools discovery.
  • No files require special attention

Important Files Changed

Filename Overview
cgr/init.py New shim package that re-exports key SDK components for shorter imports
pyproject.toml Added cgr to setuptools packages list for package discovery
uv.lock Version bump from 0.0.76 to 0.0.78 in lock file

Last reviewed commit: b68370d

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a cgr shim package to allow for shorter, more convenient imports of the SDK's main components. The changes include adding the cgr/__init__.py file to re-export the components and updating pyproject.toml to include this new package. The implementation is straightforward and effective. I've added one minor suggestion to improve code style by sorting the __all__ list alphabetically.

@vitali87 vitali87 merged commit 7a17792 into main Feb 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant