Skip to content

Conversation

@LynAlinka
Copy link

No description provided.

…olved problems: bypassed Gemini API 429 rate limits, updated environment to Python 3.12 for library compatibility, and maintained Google Search grounding via hybrid LLM approach.
…tecture: Implemented a stateless filesystem crawler using os.walk. This approach was chosen to ensure 100% data privacy, eliminate external API latency, and bypass 429 rate limit issues entirely, providing a robust solution for local data analysis.
@google-cla
Copy link

google-cla bot commented Jan 2, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link

Summary of Changes

Hello @LynAlinka, 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 introduces a significant architectural shift in the research agent's data acquisition strategy, moving from external web searches to internal file system exploration. Concurrently, it updates the underlying Large Language Model (LLM) infrastructure, replacing Google's Gemini with Groq's Llama 3.3 70B, which impacts how queries are generated, reflections are made, and final answers are formulated. These changes enhance the agent's capability to process local information and offer more flexibility in LLM choice, alongside a new command-line option for directory specification.

Highlights

  • LLM Provider Transition: The research agent has transitioned from using Google's Gemini models (via ChatGoogleGenerativeAI) to Groq's Llama 3.3 70B model (via ChatGroq) for query generation, reflection, and final answer synthesis. This change requires a GROQ_API_KEY environment variable.
  • Local Directory Search: The web_research node has been completely refactored to perform local directory searches instead of web searches using the Google Search API. It now recursively crawls a specified directory, searching for the generated query within text-based files.
  • New CLI Argument: A new command-line argument --dir has been added to cli_research.py, allowing users to specify the local directory where the agent should perform its research.
  • Simplified Source Handling: The complex logic for resolving URLs, generating citations, and inserting citation markers, which was necessary for web search grounding metadata, has been removed as it is no longer applicable to local file system searches.
  • Default Model Update: The default reasoning model used in the CLI example has been updated from gemini-2.5-pro-preview-05-06 to llama-3.3-70b-versatile to align with the new Groq integration.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

Copy link

@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 refactors the agent to use Groq with Llama models instead of Google Gemini, and switches from web-based research to searching within a local directory. While the core functionality change is clear, the implementation has introduced a significant regression where the configurable reasoning model is ignored in favor of a hardcoded one. Additionally, the new file search logic uses overly broad exception handling which could mask errors. I've also included some suggestions to improve code style and documentation in the command-line interface script.

Comment on lines 129 to 130
except Exception:
continue

Choose a reason for hiding this comment

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

high

Catching a broad Exception and silently continuing with continue can hide critical bugs and make debugging very difficult. It's much safer to catch only the specific exceptions you expect from file operations, such as IOError or OSError. This prevents masking unexpected issues.

Suggested change
except Exception:
continue
except (IOError, OSError):
continue

)
result = llm.with_structured_output(Reflection).invoke(formatted_prompt)
# init Reasoning Model via Groq
result = groq_llm.with_structured_output(Reflection).invoke(formatted_prompt)

Choose a reason for hiding this comment

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

high

The reasoning_model passed in the state is being ignored here. The node now unconditionally uses the global groq_llm instance, which has a hardcoded model. This makes the --reasoning-model CLI argument ineffective for the reflection step. To honor the user's configuration, you should dynamically initialize a ChatGroq instance using the model from the state.

    reasoning_model = state.get("reasoning_model") or "llama-3.3-70b-versatile"
    llm = ChatGroq(
        model=reasoning_model,
        temperature=1.0,
        api_key=os.getenv("GROQ_API_KEY"),
    )
    result = llm.with_structured_output(Reflection).invoke(formatted_prompt)

)
unique_sources.append(source)
# init Reasoning Model via Groq
result = groq_llm.invoke(formatted_prompt)

Choose a reason for hiding this comment

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

high

Similar to the reflection node, the reasoning_model from the state is being ignored. This node unconditionally uses the global groq_llm instance with its hardcoded model, rendering the --reasoning-model CLI argument useless for this final step. Please initialize a ChatGroq instance dynamically with the model from the state.

    reasoning_model = state.get("reasoning_model") or "llama-3.3-70b-versatile"
    llm = ChatGroq(
        model=reasoning_model,
        temperature=0,
        api_key=os.getenv("GROQ_API_KEY"),
    )
    result = llm.invoke(formatted_prompt)


def main() -> None:
"""Run the research agent from the command line."""
parser = argparse.ArgumentParser(description="Run the LangGraph research agent")

Choose a reason for hiding this comment

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

medium

The docstring for the main function was removed. Per PEP 257, it's good practice to include docstrings for all public functions to improve readability and maintainability. Please consider adding it back.

Suggested change
parser = argparse.ArgumentParser(description="Run the LangGraph research agent")
"""Run the research agent from the command line."""
parser = argparse.ArgumentParser(description="Run the LangGraph research agent")

Comment on lines 25 to 30
parser.add_argument(
"--dir",
type=str,
help="Directory to search in",
default=None
)

Choose a reason for hiding this comment

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

medium

The formatting for this add_argument call is inconsistent with the others in this file and not well-aligned. For improved readability and consistency, please format it as a single line, similar to the other arguments.

    parser.add_argument("--dir", type=str, help="Directory to search in", default=None)

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.

1 participant