-
Notifications
You must be signed in to change notification settings - Fork 416
feat: Improve the developer journey for example notebooks #912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve the developer journey for example notebooks #912
Conversation
|
Warning Rate limit exceeded@willkill07 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 40 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughReplaces legacy example packages and notebooks with new NAT-focused notebooks and README updates; removes two example packages (first_search_agent, retail_sales_agent), related modules, configs, data, and a LangChain sample; updates project manifest, CI path-ignore rules, vocabulary, and a minor typo. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Repo as Repository
participant CI as CI
participant User as User (docs/notebooks)
rect rgba(60,120,216,0.06)
Dev->>Repo: add new NAT-focused notebooks & update READMEs
Dev->>Repo: remove legacy example packages, notebooks, configs, and data
end
rect rgba(40,160,100,0.06)
Repo->>CI: update pyproject manifests and CI path-ignore rules
CI-->>Repo: apply lint/path checks with expanded ignores
end
rect rgba(220,180,60,0.06)
Repo->>User: docs/notebooks reflect NAT onboarding and migration guidance
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested labelsbreaking, examples, docs, cleanup Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/retail_sales_data.csvis excluded by!**/*.csv
📒 Files selected for processing (33)
examples/notebooks/1_getting_started.ipynb(0 hunks)examples/notebooks/1_getting_started_with_nat.ipynb(1 hunks)examples/notebooks/2_add_tools_and_agents.ipynb(0 hunks)examples/notebooks/2_bringing_your_own_agent.ipynb(1 hunks)examples/notebooks/3_adding_tools_and_agents.ipynb(1 hunks)examples/notebooks/README.md(1 hunks)examples/notebooks/first_search_agent/configs(0 hunks)examples/notebooks/first_search_agent/pyproject.toml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/__init__.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py(0 hunks)examples/notebooks/langchain_sample/langchain_agent.py(0 hunks)examples/notebooks/retail_sales_agent/configs(0 hunks)examples/notebooks/retail_sales_agent/data(0 hunks)examples/notebooks/retail_sales_agent/pyproject.toml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/__init__.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py(0 hunks)
💤 Files with no reviewable changes (29)
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/init.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md
- examples/notebooks/2_add_tools_and_agents.ipynb
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/init.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py
- examples/notebooks/1_getting_started.ipynb
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml
- examples/notebooks/langchain_sample/langchain_agent.py
- examples/notebooks/first_search_agent/configs
- examples/notebooks/retail_sales_agent/pyproject.toml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py
- examples/notebooks/first_search_agent/pyproject.toml
- examples/notebooks/retail_sales_agent/configs
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py
- examples/notebooks/retail_sales_agent/data
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json
🧰 Additional context used
📓 Path-based instructions (4)
**/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Files:
examples/notebooks/README.md
examples/*/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Each example must include a README.md or README.ipynb
Files:
examples/notebooks/README.md
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/notebooks/README.mdexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/3_adding_tools_and_agents.ipynb
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/README.mdexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/3_adding_tools_and_agents.ipynb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
examples/notebooks/README.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Files:
examples/notebooks/README.md
examples/*/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Each example must include a README.md or README.ipynb
Files:
examples/notebooks/README.md
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/notebooks/README.md
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/README.md
🧠 Learnings (2)
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to **/README.@(md|ipynb) : Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Applied to files:
examples/notebooks/README.md
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to docs/source/**/*.md : Use the official naming throughout documentation: first use “NVIDIA NeMo Agent toolkit”, subsequent “NeMo Agent toolkit”; never use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq)
Applied to files:
examples/notebooks/README.md
65f87b3 to
2974ffb
Compare
2974ffb to
1af4f1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (2)
examples/notebooks/3_adding_tools_and_agents.ipynb (2)
676-680: Normalize product_name before filtering to fix query failures.The dataframe column is lowercased but the incoming
product_nameparameter is not, causing all queries with capitalized product names (e.g., "Laptop") to return zero results. Normalize the input before comparison.async def _get_total_product_sales_data(product_name: str) -> str: """ Retrieve total sales data for a specific product. Args: product_name: Name of the product Returns: String message containing total sales data """ - df['Product'] = df["Product"].apply(lambda x: x.lower()) - revenue = df[df['Product'] == product_name]['Revenue'].sum() - units_sold = df[df['Product'] == product_name]['UnitsSold'].sum() + df["Product"] = df["Product"].str.lower() + product_key = product_name.strip().lower() + revenue = df[df["Product"] == product_key]["Revenue"].sum() + units_sold = df[df["Product"] == product_key]["UnitsSold"].sum()
727-744: Normalize product parameter before filtering to fix query failures.The dataframe
Productcolumn is lowercased but theproductargument is not, causing lookups with capitalized names (e.g., "Laptop") to fail. Normalize the input at the start of the function.async def _get_sales_per_day(date: str, product: str) -> str: """ Calculate total sales data across all products for a specific date. Args: date: Date in YYYY-MM-DD format product: Product name Returns: String message with the total sales for the day """ if date == "None": return "Please provide a date in YYYY-MM-DD format." - total_revenue = df[(df['Date'] == date) & (df['Product'] == product)]['Revenue'].sum() - total_units_sold = df[(df['Date'] == date) & (df['Product'] == product)]['UnitsSold'].sum() + df["Product"] = df["Product"].str.lower() + product_key = product.strip().lower() + total_revenue = df[(df["Date"] == date) & (df["Product"] == product_key)]["Revenue"].sum() + total_units_sold = df[(df["Date"] == date) & (df["Product"] == product_key)]["UnitsSold"].sum()
🧹 Nitpick comments (7)
examples/notebooks/3_adding_tools_and_agents.ipynb (5)
676-676: Use vectorized string method instead of apply with lambda.Replace
.apply(lambda x: x.lower())with the more efficient.str.lower()for better performance on large datasets.- df['Product'] = df["Product"].apply(lambda x: x.lower()) + df["Product"] = df["Product"].str.lower()
727-727: Use vectorized string method instead of apply with lambda.Replace
.apply(lambda x: x.lower())with the more efficient.str.lower()for better performance on large datasets.- df['Product'] = df["Product"].apply(lambda x: x.lower()) + df["Product"] = df["Product"].str.lower()
803-806: Replace string literal comparison with proper None check.Comparing
metric == "None"is fragile. If the caller passesNone(the Python object), this check will fail. Useif metric is None or metric == "None":or refactor to acceptOptional[str]with a proper default.- if metric == "None": + if metric is None or metric == "None": column = "Revenue"
1679-1679: Simplify regex or remove unnecessary pattern.The response is already lowercased on line 1678, so the word boundary regex
r'\b(yes)\b'will work, but you could simplify to"yes" in response_strif exact word match is not critical, or keep the regex but document the intent.
1076-1076: Remove trailing comma before closing parenthesis.Minor style issue: trailing comma before
)is unnecessary.- query_engine = index.as_query_engine(similarity_top_k=3, ) + query_engine = index.as_query_engine(similarity_top_k=3)examples/notebooks/README.md (2)
35-35: Clarify Colab badge link behavior.The badge links to the repository root, not a specific notebook. Users will need to navigate to
examples/notebooks/and select a notebook. Consider adding a note explaining this, or provide individual badges per notebook.
24-27: Consider adding article "the" for better readability.The notebook titles would read more naturally with "the" before "NeMo Agent toolkit" (e.g., "Getting Started with the NeMo Agent Toolkit"). This is optional but improves flow.
-1. [Getting Started](1_getting_started_with_nat.ipynb) -2. [Bringing Your Own Agent](2_bringing_your_own_agent.ipynb) -3. [Adding Tools and Agents](3_adding_tools_and_agents.ipynb) -4. [Observability, Evaluation, and Profiling](4_observability_evaluation_and_profiling.ipynb) +1. [Getting Started with the NeMo Agent Toolkit](1_getting_started_with_nat.ipynb) +2. [Bringing Your Own Agent to the NeMo Agent Toolkit](2_bringing_your_own_agent.ipynb) +3. [Adding Tools and Agents to the NeMo Agent Toolkit](3_adding_tools_and_agents.ipynb) +4. [Observability, Evaluation, and Profiling in the NeMo Agent Toolkit](4_observability_evaluation_and_profiling.ipynb)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/retail_sales_data.csvis excluded by!**/*.csvuv.lockis excluded by!**/*.lock
📒 Files selected for processing (34)
examples/notebooks/1_getting_started.ipynb(0 hunks)examples/notebooks/1_getting_started_with_nat.ipynb(1 hunks)examples/notebooks/2_add_tools_and_agents.ipynb(0 hunks)examples/notebooks/2_bringing_your_own_agent.ipynb(1 hunks)examples/notebooks/3_adding_tools_and_agents.ipynb(1 hunks)examples/notebooks/README.md(1 hunks)examples/notebooks/first_search_agent/configs(0 hunks)examples/notebooks/first_search_agent/pyproject.toml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/__init__.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py(0 hunks)examples/notebooks/langchain_sample/langchain_agent.py(0 hunks)examples/notebooks/retail_sales_agent/configs(0 hunks)examples/notebooks/retail_sales_agent/data(0 hunks)examples/notebooks/retail_sales_agent/pyproject.toml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/__init__.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py(0 hunks)pyproject.toml(0 hunks)
💤 Files with no reviewable changes (30)
- examples/notebooks/langchain_sample/langchain_agent.py
- examples/notebooks/retail_sales_agent/configs
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/init.py
- examples/notebooks/first_search_agent/pyproject.toml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml
- examples/notebooks/retail_sales_agent/data
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/init.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml
- examples/notebooks/1_getting_started.ipynb
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml
- pyproject.toml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py
- examples/notebooks/first_search_agent/configs
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py
- examples/notebooks/retail_sales_agent/pyproject.toml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py
- examples/notebooks/2_add_tools_and_agents.ipynb
- examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json
🚧 Files skipped from review as they are similar to previous changes (2)
- examples/notebooks/1_getting_started_with_nat.ipynb
- examples/notebooks/2_bringing_your_own_agent.ipynb
🧰 Additional context used
📓 Path-based instructions (4)
**/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Files:
examples/notebooks/README.md
examples/*/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Each example must include a README.md or README.ipynb
Files:
examples/notebooks/README.md
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/notebooks/README.mdexamples/notebooks/3_adding_tools_and_agents.ipynb
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/README.mdexamples/notebooks/3_adding_tools_and_agents.ipynb
🧠 Learnings (2)
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to **/README.@(md|ipynb) : Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Applied to files:
examples/notebooks/README.md
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to docs/source/**/*.md : Use the official naming throughout documentation: first use “NVIDIA NeMo Agent toolkit”, subsequent “NeMo Agent toolkit”; never use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq)
Applied to files:
examples/notebooks/README.md
🔇 Additional comments (2)
examples/notebooks/README.md (1)
20-20: Verify branding: capital T in first mention per retrieved learnings.The retrieved learning states "use 'NeMo Agent Toolkit' (capital T) in headings", and this is the first textual mention in a documentation file. However, the coding guideline states lowercase "toolkit" for subsequent mentions. Please clarify whether the first mention in body text should use capital or lowercase T.
Current: "NVIDIA NeMo Agent toolkit"
Per retrieved learning: "NVIDIA NeMo Agent Toolkit"
Per coding guideline: "NVIDIA NeMo Agent toolkit"Based on learnings
examples/notebooks/3_adding_tools_and_agents.ipynb (1)
538-538: Use consistent branding: "NeMo Agent Toolkit" with capital T.The heading should read "Installing NeMo Agent Toolkit" to match the official product name.
Based on learnings
- "## Installing NeMo Agent Toolkit" + "## Installing the NeMo Agent Toolkit"⛔ Skipped due to learnings
Learnt from: CR PR: NVIDIA/NeMo-Agent-Toolkit#0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-09-23T18:39:15.023Z Learning: Applies to **/README.@(md|ipynb) : Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
1af4f1b to
2b2e53d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (3)
examples/notebooks/3_adding_tools_and_agents.ipynb (3)
704-721: Lowercase the per-day lookup input as well.Here too the dataset is normalized but the incoming
productargument isn’t, so mixed-case inputs fail. Normalize before filtering.- df['Product'] = df["Product"].apply(lambda x: x.lower()) + df["Product"] = df["Product"].str.lower() async def _get_sales_per_day(date: str, product: str) -> str: ... - total_revenue = df[(df['Date'] == date) & (df['Product'] == product)]['Revenue'].sum() - total_units_sold = df[(df['Date'] == date) & (df['Product'] == product)]['UnitsSold'].sum() + product_key = product.strip().lower() + total_revenue = df[(df["Date"] == date) & (df["Product"] == product_key)]["Revenue"].sum() + total_units_sold = df[(df["Date"] == date) & (df["Product"] == product_key)]["UnitsSold"].sum()
656-660: Normalize the lookup key before filtering.The dataframe column is lowercased, but
product_nameisn’t, so queries like “Laptop” miss. Strip and lowercase the user input before comparison.- df['Product'] = df["Product"].apply(lambda x: x.lower()) - revenue = df[df['Product'] == product_name]['Revenue'].sum() - units_sold = df[df['Product'] == product_name]['UnitsSold'].sum() + df["Product"] = df["Product"].str.lower() + product_key = product_name.strip().lower() + revenue = df[df["Product"] == product_key]["Revenue"].sum() + units_sold = df[df["Product"] == product_key]["UnitsSold"].sum()
1876-1883: Avoid hard-coded image fallback that can 404.If no image path is found, defaulting to
sales_trend.pngwill typically raiseFileNotFoundError. Instead, detect the absence and return a clear message (or skip summarization).- if not image_path: - image_path = "sales_trend.png" - - logger.info("Extracted image path for summarization: %s", image_path) - response = await graph_summarizer_fn.ainvoke(image_path) - return {"messages": [response]} + if not image_path: + logger.warning("No chart image detected in the conversation; skipping summarization.") + return {"messages": [AIMessage(content="No generated chart image found, so no summary was produced.")]} + + logger.info("Extracted image path for summarization: %s", image_path) + summary = await graph_summarizer_fn.ainvoke(image_path) + return {"messages": [AIMessage(content=summary)]}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/retail_sales_data.csvis excluded by!**/*.csvuv.lockis excluded by!**/*.lock
📒 Files selected for processing (37)
ci/scripts/path_checks.py(1 hunks)ci/vale/styles/config/vocabularies/nat/accept.txt(2 hunks)examples/notebooks/1_getting_started.ipynb(0 hunks)examples/notebooks/1_getting_started_with_nat.ipynb(1 hunks)examples/notebooks/2_add_tools_and_agents.ipynb(0 hunks)examples/notebooks/2_bringing_your_own_agent.ipynb(1 hunks)examples/notebooks/3_adding_tools_and_agents.ipynb(1 hunks)examples/notebooks/README.md(1 hunks)examples/notebooks/first_search_agent/configs(0 hunks)examples/notebooks/first_search_agent/pyproject.toml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/__init__.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py(0 hunks)examples/notebooks/langchain_sample/langchain_agent.py(0 hunks)examples/notebooks/retail_sales_agent/configs(0 hunks)examples/notebooks/retail_sales_agent/data(0 hunks)examples/notebooks/retail_sales_agent/pyproject.toml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/__init__.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py(0 hunks)pyproject.toml(0 hunks)src/nat/tool/memory_tools/get_memory_tool.py(1 hunks)
💤 Files with no reviewable changes (30)
- examples/notebooks/first_search_agent/pyproject.toml
- pyproject.toml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml
- examples/notebooks/1_getting_started.ipynb
- examples/notebooks/first_search_agent/src/nat_first_search_agent/init.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/init.py
- examples/notebooks/retail_sales_agent/configs
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml
- examples/notebooks/2_add_tools_and_agents.ipynb
- examples/notebooks/retail_sales_agent/pyproject.toml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md
- examples/notebooks/first_search_agent/configs
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml
- examples/notebooks/langchain_sample/langchain_agent.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml
- examples/notebooks/retail_sales_agent/data
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py
- examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{py,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)
**/*.{py,yaml,yml}: Configure response_seq as a list of strings; values cycle per call, and [] yields an empty string.
Configure delay_ms to inject per-call artificial latency in milliseconds for nat_test_llm.
Files:
src/nat/tool/memory_tools/get_memory_tool.pyci/scripts/path_checks.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)
**/*.py: Programmatic use: create TestLLMConfig(response_seq=[...], delay_ms=...), add with builder.add_llm("", cfg).
When retrieving the test LLM wrapper, use builder.get_llm(name, wrapper_type=LLMFrameworkEnum.) and call the framework’s method (e.g., ainvoke, achat, call).
**/*.py: In code comments/identifiers use NAT abbreviations as specified: nat for API namespace/CLI, nvidia-nat for package name, NAT for env var prefixes; do not use these abbreviations in documentation
Follow PEP 20 and PEP 8; run yapf with column_limit=120; use 4-space indentation; end files with a single trailing newline
Run ruff check --fix as linter (not formatter) using pyproject.toml config; fix warnings unless explicitly ignored
Respect naming: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
Treat pyright warnings as errors during development
Exception handling: use bare raise to re-raise; log with logger.error() when re-raising to avoid duplicate stack traces; use logger.exception() when catching without re-raising
Provide Google-style docstrings for every public module, class, function, and CLI command; first line concise and ending with a period; surround code entities with backticks
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work; profile CPU-heavy paths with cProfile or mprof before optimizing; cache expensive computations with functools.lru_cache or external cache; leverage NumPy vectorized operations when beneficial
Files:
src/nat/tool/memory_tools/get_memory_tool.pyci/scripts/path_checks.py
src/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
All importable Python code must live under src/ (or packages//src/)
Files:
src/nat/tool/memory_tools/get_memory_tool.py
src/nat/**/*
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Changes in src/nat should prioritize backward compatibility
Files:
src/nat/tool/memory_tools/get_memory_tool.py
⚙️ CodeRabbit configuration file
This directory contains the core functionality of the toolkit. Changes should prioritize backward compatibility.
Files:
src/nat/tool/memory_tools/get_memory_tool.py
{src/**/*.py,packages/*/src/**/*.py}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
All public APIs must have Python 3.11+ type hints on parameters and return values; prefer typing/collections.abc abstractions; use typing.Annotated when useful
Files:
src/nat/tool/memory_tools/get_memory_tool.py
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
src/nat/tool/memory_tools/get_memory_tool.pyci/scripts/path_checks.pyexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/2_bringing_your_own_agent.ipynbci/vale/styles/config/vocabularies/nat/accept.txtexamples/notebooks/README.mdexamples/notebooks/3_adding_tools_and_agents.ipynb
{scripts/**,ci/scripts/**}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Shell or utility scripts belong in scripts/ or ci/scripts/ and must not be mixed with library code
Files:
ci/scripts/path_checks.py
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/README.mdexamples/notebooks/3_adding_tools_and_agents.ipynb
**/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Files:
examples/notebooks/README.md
examples/*/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Each example must include a README.md or README.ipynb
Files:
examples/notebooks/README.md
🧠 Learnings (3)
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to docs/source/**/*.md : Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted terms in accept.txt are allowed
Applied to files:
ci/vale/styles/config/vocabularies/nat/accept.txt
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to **/README.@(md|ipynb) : Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Applied to files:
examples/notebooks/README.mdexamples/notebooks/3_adding_tools_and_agents.ipynb
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to docs/source/**/*.md : Use the official naming throughout documentation: first use “NVIDIA NeMo Agent toolkit”, subsequent “NeMo Agent toolkit”; never use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq)
Applied to files:
examples/notebooks/README.mdexamples/notebooks/3_adding_tools_and_agents.ipynb
🪛 Ruff (0.13.3)
src/nat/tool/memory_tools/get_memory_tool.py
70-70: Avoid specifying long messages outside the exception class
(TRY003)
🔇 Additional comments (2)
src/nat/tool/memory_tools/get_memory_tool.py (1)
70-70: LGTM! Typo corrected.The spelling correction from "retreiving" to "retrieving" improves the error message quality. The exception handling with
from ecorrectly preserves the stack trace chain.Note: Ruff suggests TRY003 (avoid long messages outside exception class), but this is a style preference rather than a defect. The message is contextual and specific to this location, so the current approach is acceptable.
examples/notebooks/3_adding_tools_and_agents.ipynb (1)
9-12: Bring notebook text in line with branding policy.Same requirements apply here: start with “NVIDIA NeMo Agent toolkit,” use “NeMo Agent toolkit” afterward, and avoid introducing the “NAT” acronym in documentation. As per coding guidelines
Also applies to: 537-573
⛔ Skipped due to learnings
Learnt from: CR PR: NVIDIA/NeMo-Agent-Toolkit#0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-09-23T18:39:15.023Z Learning: Applies to docs/source/**/*.md : Use the official naming throughout documentation: first use “NVIDIA NeMo Agent toolkit”, subsequent “NeMo Agent toolkit”; never use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq)Learnt from: CR PR: NVIDIA/NeMo-Agent-Toolkit#0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-09-23T18:39:15.023Z Learning: Applies to **/README.@(md|ipynb) : Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headingsLearnt from: CR PR: NVIDIA/NeMo-Agent-Toolkit#0 File: .cursor/rules/general.mdc:0-0 Timestamp: 2025-09-23T18:39:15.023Z Learning: Applies to **/*.py : In code comments/identifiers use NAT abbreviations as specified: nat for API namespace/CLI, nvidia-nat for package name, NAT for env var prefixes; do not use these abbreviations in documentation
Signed-off-by: Will Killian <[email protected]>
2b2e53d to
c892328
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (7)
examples/notebooks/2_bringing_your_own_agent.ipynb (2)
9-113: Follow the required branding rules.The notebook still uses “NeMo Agent toolkit (NAT)” in the introduction and later cells. Per the docs guidance, introduce it once as “NVIDIA NeMo Agent toolkit,” refer to it afterwards as “NeMo Agent toolkit,” and drop the “NAT” abbreviation throughout. Please bring all occurrences in these cells in line with that rule. Based on learnings
598-604: Fix theFieldkeyword typo or imports will break.
Field(defaultfactory=list, …)raises aTypeErrorat import time becausedefaultfactoryisn’t a valid keyword. Switch todefault_factoryso the default list is created safely.- tool_names: list[FunctionRef] = Field(defaultfactory=list, description="List of tool names to use") + tool_names: list[FunctionRef] = Field(default_factory=list, description="List of tool names to use")examples/notebooks/1_getting_started_with_nat.ipynb (1)
9-108: Update branding and drop the “NAT” abbreviation.The opening section still says “NeMo Agent toolkit (NAT)” and keeps using “NAT” later. Please follow the documentation rule: first textual mention “NVIDIA NeMo Agent toolkit,” subsequent mentions “NeMo Agent toolkit,” and no “NAT” shorthand. Apply this across the notebook intro. Based on learnings
examples/notebooks/3_adding_tools_and_agents.ipynb (4)
656-660: Normalize the user input before filtering.
df["Product"]is lowercased butproduct_nameisn’t, so queries like “Laptop” miss. Strip + lowercase the argument before the comparison:- df['Product'] = df["Product"].apply(lambda x: x.lower()) - revenue = df[df['Product'] == product_name]['Revenue'].sum() - units_sold = df[df['Product'] == product_name]['UnitsSold'].sum() + df["Product"] = df["Product"].str.lower() + product_key = product_name.strip().lower() + revenue = df[df["Product"] == product_key]["Revenue"].sum() + units_sold = df[df["Product"] == product_key]["UnitsSold"].sum()
704-723: Lowercase the lookup key here as well.Same issue: the dataframe is normalized but
productisn’t, sosales_per_daymisses mixed-case inputs. Normalize before filtering:- df['Product'] = df["Product"].apply(lambda x: x.lower()) + df["Product"] = df["Product"].str.lower() async def _get_sales_per_day(date: str, product: str) -> str: ... - total_revenue = df[(df['Date'] == date) & (df['Product'] == product)]['Revenue'].sum() - total_units_sold = df[(df['Date'] == date) & (df['Product'] == product)]['UnitsSold'].sum() + product_key = product.strip().lower() + total_revenue = df[(df["Date"] == date) & (df["Product"] == product_key)]["Revenue"].sum() + total_units_sold = df[(df["Date"] == date) & (df["Product"] == product_key)]["UnitsSold"].sum()
1702-1717: Switch to the supported OpenAI vision API.
client.responses.createwithinput_text/input_imageno longer exists; this throws at runtime. Usechat.completions.create(GPT-4o) withmessagesand return the first choice:- response = client.responses.create( - model=llm.model_name, - input=[{ - "role": - "user", - "content": [{ - "type": "input_text", - "text": "Please summarize the key insights from this graph in natural language." - }, { - "type": "input_image", "image_url": f"data:image/png;base64,{base64_image}" - }] - }], - temperature=0.3, - ) - - return response.output_text + response = client.chat.completions.create( + model=llm.model_name, + messages=[{ + "role": "user", + "content": [ + {"type": "text", "text": "Please summarize the key insights from this graph in natural language."}, + {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{base64_image}"}} + ], + }], + temperature=0.3, + ) + + return response.choices[0].message.content
1878-1883: Remove the hardcoded fallback image path.Defaulting to
"sales_trend.png"will raiseFileNotFoundErrorwhenever that file wasn’t produced. Instead, verify the extracted path exists and bail out cleanly if not—e.g., log a warning and return an informative message instead of guessing a filename. Based on learnings
🧹 Nitpick comments (1)
src/nat/tool/memory_tools/get_memory_tool.py (1)
70-70: LGTM! Typo fixed.The spelling correction from "retreiving" to "retrieving" improves the error message quality.
Optional style note: Ruff flags TRY003 here, suggesting that long exception messages be defined as class-level constants or attributes rather than inline strings. This keeps exception instantiation concise and messages reusable. You may consider refactoring if you adopt stricter style enforcement, but it's not required for this change.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/retail_sales_data.csvis excluded by!**/*.csvuv.lockis excluded by!**/*.lock
📒 Files selected for processing (38)
ci/scripts/path_checks.py(1 hunks)ci/vale/styles/config/vocabularies/nat/accept.txt(2 hunks)examples/README.md(1 hunks)examples/notebooks/1_getting_started.ipynb(0 hunks)examples/notebooks/1_getting_started_with_nat.ipynb(1 hunks)examples/notebooks/2_add_tools_and_agents.ipynb(0 hunks)examples/notebooks/2_bringing_your_own_agent.ipynb(1 hunks)examples/notebooks/3_adding_tools_and_agents.ipynb(1 hunks)examples/notebooks/README.md(1 hunks)examples/notebooks/first_search_agent/configs(0 hunks)examples/notebooks/first_search_agent/pyproject.toml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/__init__.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py(0 hunks)examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py(0 hunks)examples/notebooks/langchain_sample/langchain_agent.py(0 hunks)examples/notebooks/retail_sales_agent/configs(0 hunks)examples/notebooks/retail_sales_agent/data(0 hunks)examples/notebooks/retail_sales_agent/pyproject.toml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/__init__.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py(0 hunks)examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py(0 hunks)pyproject.toml(0 hunks)src/nat/tool/memory_tools/get_memory_tool.py(1 hunks)
💤 Files with no reviewable changes (30)
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/rag/product_catalog.md
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_modified.yml
- examples/notebooks/retail_sales_agent/configs
- examples/notebooks/first_search_agent/pyproject.toml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_with_rag.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/init.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent_hitl.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/llama_index_rag_tool.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_tools.py
- examples/notebooks/retail_sales_agent/pyproject.toml
- examples/notebooks/langchain_sample/langchain_agent.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/init.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_insight_tools.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_evaluation_and_profiling.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/register.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/register.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_multi_agent.yml
- examples/notebooks/2_add_tools_and_agents.ipynb
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config.yml
- examples/notebooks/first_search_agent/src/nat_first_search_agent/second_search_agent_function.py
- pyproject.toml
- examples/notebooks/1_getting_started.ipynb
- examples/notebooks/first_search_agent/src/nat_first_search_agent/first_search_agent_function.py
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/configs/config_tracing.yml
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data/eval_data.json
- examples/notebooks/first_search_agent/configs
- examples/notebooks/first_search_agent/src/nat_first_search_agent/configs/config_react_agent.yml
- examples/notebooks/retail_sales_agent/data
- examples/notebooks/retail_sales_agent/src/nat_retail_sales_agent/data_visualization_agent.py
🚧 Files skipped from review as they are similar to previous changes (1)
- ci/vale/styles/config/vocabularies/nat/accept.txt
🧰 Additional context used
📓 Path-based instructions (10)
**/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Files:
examples/README.mdexamples/notebooks/README.md
**/*
⚙️ CodeRabbit configuration file
**/*: # Code Review Instructions
- Ensure the code follows best practices and coding standards. - For Python code, follow
PEP 20 and
PEP 8 for style guidelines.- Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
Example:def my_function(param1: int, param2: str) -> bool: pass- For Python exception handling, ensure proper stack trace preservation:
- When re-raising exceptions: use bare
raisestatements to maintain the original stack trace,
and uselogger.error()(notlogger.exception()) to avoid duplicate stack trace output.- When catching and logging exceptions without re-raising: always use
logger.exception()
to capture the full stack trace information.Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any
words listed in the
ci/vale/styles/config/vocabularies/nat/reject.txtfile, words that might appear to be
spelling mistakes but are listed in theci/vale/styles/config/vocabularies/nat/accept.txtfile are OK.Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,
and should contain an Apache License 2.0 header comment at the top of each file.
- Confirm that copyright years are up-to date whenever a file is changed.
Files:
examples/README.mdexamples/notebooks/2_bringing_your_own_agent.ipynbci/scripts/path_checks.pyexamples/notebooks/README.mdexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/3_adding_tools_and_agents.ipynbsrc/nat/tool/memory_tools/get_memory_tool.py
examples/**/*
⚙️ CodeRabbit configuration file
examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.
- If an example contains Python code, it should be placed in a subdirectory named
src/and should
contain apyproject.tomlfile. Optionally, it might also contain scripts in ascripts/directory.- If an example contains YAML files, they should be placed in a subdirectory named
configs/. - If an example contains sample data files, they should be placed in a subdirectory nameddata/, and should
be checked into git-lfs.
Files:
examples/README.mdexamples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/README.mdexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/3_adding_tools_and_agents.ipynb
**/*.{py,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)
**/*.{py,yaml,yml}: Configure response_seq as a list of strings; values cycle per call, and [] yields an empty string.
Configure delay_ms to inject per-call artificial latency in milliseconds for nat_test_llm.
Files:
ci/scripts/path_checks.pysrc/nat/tool/memory_tools/get_memory_tool.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)
**/*.py: Programmatic use: create TestLLMConfig(response_seq=[...], delay_ms=...), add with builder.add_llm("", cfg).
When retrieving the test LLM wrapper, use builder.get_llm(name, wrapper_type=LLMFrameworkEnum.) and call the framework’s method (e.g., ainvoke, achat, call).
**/*.py: In code comments/identifiers use NAT abbreviations as specified: nat for API namespace/CLI, nvidia-nat for package name, NAT for env var prefixes; do not use these abbreviations in documentation
Follow PEP 20 and PEP 8; run yapf with column_limit=120; use 4-space indentation; end files with a single trailing newline
Run ruff check --fix as linter (not formatter) using pyproject.toml config; fix warnings unless explicitly ignored
Respect naming: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
Treat pyright warnings as errors during development
Exception handling: use bare raise to re-raise; log with logger.error() when re-raising to avoid duplicate stack traces; use logger.exception() when catching without re-raising
Provide Google-style docstrings for every public module, class, function, and CLI command; first line concise and ending with a period; surround code entities with backticks
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work; profile CPU-heavy paths with cProfile or mprof before optimizing; cache expensive computations with functools.lru_cache or external cache; leverage NumPy vectorized operations when beneficial
Files:
ci/scripts/path_checks.pysrc/nat/tool/memory_tools/get_memory_tool.py
{scripts/**,ci/scripts/**}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Shell or utility scripts belong in scripts/ or ci/scripts/ and must not be mixed with library code
Files:
ci/scripts/path_checks.py
examples/*/README.@(md|ipynb)
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Each example must include a README.md or README.ipynb
Files:
examples/notebooks/README.md
src/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
All importable Python code must live under src/ (or packages//src/)
Files:
src/nat/tool/memory_tools/get_memory_tool.py
src/nat/**/*
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Changes in src/nat should prioritize backward compatibility
Files:
src/nat/tool/memory_tools/get_memory_tool.py
⚙️ CodeRabbit configuration file
This directory contains the core functionality of the toolkit. Changes should prioritize backward compatibility.
Files:
src/nat/tool/memory_tools/get_memory_tool.py
{src/**/*.py,packages/*/src/**/*.py}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
All public APIs must have Python 3.11+ type hints on parameters and return values; prefer typing/collections.abc abstractions; use typing.Annotated when useful
Files:
src/nat/tool/memory_tools/get_memory_tool.py
🧠 Learnings (3)
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to docs/source/**/*.md : Use the official naming throughout documentation: first use “NVIDIA NeMo Agent toolkit”, subsequent “NeMo Agent toolkit”; never use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq)
Applied to files:
examples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/README.mdexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/3_adding_tools_and_agents.ipynb
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to **/README.@(md|ipynb) : Ensure READMEs follow the naming convention; avoid deprecated names; use “NeMo Agent Toolkit” (capital T) in headings
Applied to files:
examples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/README.mdexamples/notebooks/1_getting_started_with_nat.ipynbexamples/notebooks/3_adding_tools_and_agents.ipynb
📚 Learning: 2025-09-23T18:39:15.023Z
Learnt from: CR
PR: NVIDIA/NeMo-Agent-Toolkit#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-09-23T18:39:15.023Z
Learning: Applies to **/*.py : In code comments/identifiers use NAT abbreviations as specified: nat for API namespace/CLI, nvidia-nat for package name, NAT for env var prefixes; do not use these abbreviations in documentation
Applied to files:
examples/notebooks/2_bringing_your_own_agent.ipynbexamples/notebooks/1_getting_started_with_nat.ipynb
🪛 Ruff (0.13.3)
src/nat/tool/memory_tools/get_memory_tool.py
70-70: Avoid specifying long messages outside the exception class
(TRY003)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: CI Pipeline / Check
Signed-off-by: Will Killian <[email protected]>
|
/merge |
|
/merge |
Description
This PR rewrites most of the example notebooks and enhances the documentation. We also suggest running within Jupyter or Google Colab.
Closes
By Submitting this PR I confirm:
Summary by CodeRabbit
New Features
Documentation
Chores
Bug Fixes