Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • The Influencers Normalizing Not Having Sex
    • Sources say NSA is using Mythos Preview, and a source says it is also being used widely within the DoD, despite Anthropic’s designation as a supply chain risk (Axios)
    • Today’s NYT Wordle Hints, Answer and Help for April 20 #1766
    • Scandi-style tiny house combines smart storage and simple layout
    • Our Favorite Apple Watch Has Never Been Less Expensive
    • Vercel says it detected unauthorized access to its internal systems after a hacker using the ShinyHunters handle claimed a breach on BreachForums (Lawrence Abrams/BleepingComputer)
    • Today’s NYT Strands Hints, Answer and Help for April 20 #778
    • KV Cache Is Eating Your VRAM. Here’s How Google Fixed It With TurboQuant.
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Monday, April 20
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»Artificial Intelligence»Production-Ready LLMs Made Simple with the NeMo Agent Toolkit
    Artificial Intelligence

    Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

    Editor Times FeaturedBy Editor Times FeaturedDecember 31, 2025No Comments27 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    had launched its personal LLM agent framework, the NeMo Agent Toolkit (or NAT), I received actually excited. We normally consider Nvidia as the corporate powering the whole LLM hype with its GPUs, so it’s fascinating to see them transcend {hardware} and step into the software program area as nicely.

    There are already loads of LLM agent frameworks on the market: LangGraph, smolagents, CrewAI and DSPy, simply to call a couple of. The NeMo Agent Toolkit, nonetheless, feels a bit completely different. I might describe it as a type of glue that helps sew all of the items collectively and switch them right into a production-ready answer. 

    Nvidia positions this framework as a strategy to deal with “day 2” issues: exposing brokers as APIs, including observability to observe your system and examine edge instances, constructing evaluations, and reusing brokers created in different frameworks.

    On this article, I’ll discover the core capabilities of the NeMo Agent Toolkit in follow, beginning with a easy chat-completion app and steadily transferring towards a hierarchical agentic setup, the place one LLM agent can recursively use different brokers as instruments. Because it’s the festive season, I’ll be utilizing publicly obtainable information from the World Happiness Report to maintain issues cheerful.

    Organising

    As typical, we’ll begin by organising the atmosphere and putting in the package deal.

    The core package deal itself is pretty light-weight. Nevertheless, as I discussed earlier, NAT is designed to behave as glue permitting to combine with completely different LLM frameworks in your workflow. Due to that, there are a number of non-obligatory plugins obtainable for well-liked libraries equivalent to LangChain, CrewAI, and LlamaIndex. You’ll be able to at all times discover probably the most up-to-date listing of supported plugins in the official documentation. 
    On this article, we will likely be utilizing LangChain, so we’ll want to put in the corresponding extension as nicely.

    Tip: NAT works MUCH higher and sooner with uv. I initially tried putting in every thing with pip, and it failed after about 20 minutes of ready. I’d strongly suggest not repeating my errors.

    First, create and activate a digital atmosphere utilizing uv.

    uv venv .venv_nat_uv --python 3.12
    supply .venv_nat_uv/bin/activate

    Then set up NAT with the LangChain plugin.

    uv pip set up "nvidia-nat[langchain]"

    For those who’re planning to run NAT from the CLI, you’ll additionally must export the related atmosphere variables. Since I’ll be utilizing Anthropic fashions, I must set the API key.

    export ANTHROPIC_API_KEY=

    Loading information

    Subsequent, let’s obtain the World Happiness Report information and take a better take a look at it. I’ve put collectively a small helper operate to load the dataset and barely clear up the information. 

    import pandas as pd
    def load_data():
        df = pd.read_excel('whr2025_data.xlsx')
        df = df[df.Year >= 2019]
        df = df.drop(['Lower whisker', 'Upper whisker'], axis=1)
        df.columns = ['year', 'rank', 'country', 'happiness_score', 
                    'impact_gdp', 'impact_social_support', 
                    'impact_life_expectancy', 'impact_freedom', 
                    'impact_generosity', 'impact_corruption', 'impact_residual']
        return df
    
    df = load_data()

    This dataset covers the World Happiness Report outcomes from 2019 to 2024. For every nation and 12 months, it contains the general happiness rating in addition to the estimated contribution of a number of underlying elements:

    • logarithm of GDP per capita,
    • social help,
    • wholesome life expectancy,
    • freedom to make life selections,
    • generosity,
    • notion of corruption.

    With this dataset, we will examine happiness patterns throughout geographies and over time and hopefully spot some attention-grabbing patterns alongside the way in which.

    Chat completion instance

    Let’s begin with a quite simple chat-completion instance. The structure right here is deliberately minimal: a single LLM with no extra instruments or brokers concerned.

    Picture by creator

    The NeMo Agent Toolkit is configured by way of YAML information that outline each the workflow and the underlying LLMs. Nvidia selected this strategy as a result of it makes experimenting with completely different configurations a lot simpler. For this primary instance, we’ll create a chat_config.yml file.

    At a excessive stage, our config file will include two most important sections:

    • llms the place we outline the language fashions we wish to use,
    • workflow the place we describe how these fashions are wired collectively and the way the agent behaves.

    On the LLM aspect, NAT helps a number of suppliers out of the field, together with OpenAI, Nvidia Inference Microservices, and AWS Bedrock. Since I wish to use an Anthropic mannequin, the best possibility right here is LiteLLM, which acts as a common wrapper and lets us connect with just about any supplier.

    Within the workflow part, we’ll specify:

    • the workflow sort (we will likely be utilizing the best chat_completion for now, however will discover extra complicated agentic setups later),
    • the LLM outlined above, and
    • the system immediate that units the agent’s behaviour.

    This offers us a stable MVP and a dependable baseline to construct on earlier than transferring into extra complicated agentic purposes.

    llms:
      chat_llm:
        _type: litellm
        model_name: claude-sonnet-4-5-20250929
        api_key: $ANTHROPIC_API_KEY
        temperature: 0.7
    
    workflow:
      _type: chat_completion
      llm_name: chat_llm
      system_prompt: |
        You're a educated scientist within the area of happiness research. 
        You've gotten entry to a dataset containing the World Happiness Report information from 2019 to 2025. 
        Your job is to investigate the information and supply insights based mostly on person queries. 
        Use the dataset to reply questions on nation rankings, developments over time, and elements influencing happiness scores.

    Now it’s time to run our software. We are able to do that with a single CLI command by specifying the trail to the config file and offering an enter query.

    nat run 
      --config_file chat_config.yml 
      --input "How is happinness outlined?"

    As soon as the command runs, we’ll see the next output within the console.

    2025-12-24 18:07:34 - INFO - nat.cli.instructions.begin:192 - Beginning NAT 
    from config file: 'chat_config.yml'
    
    Configuration Abstract:
    --------------------
    Workflow Sort: chat_completion
    Variety of Capabilities: 0
    Variety of Perform Teams: 0
    Variety of LLMs: 1
    Variety of Embedders: 0
    Variety of Reminiscence: 0
    Variety of Object Shops: 0
    Variety of Retrievers: 0
    Variety of TTC Methods: 0
    Variety of Authentication Suppliers: 0
    
    2025-12-24 18:07:35 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-24 18:07:44 - INFO     - nat.front_ends.console.console_front_end_plugin:102 - --------------------------------------------------
    ['In the World Happiness Report, happiness is defined as subjective well-being, 
    measured primarily through the **Cantril ladder** life evaluation question, 
    where respondents rate their current life on a scale from 0 (worst possible) 
    to 10 (best possible). The overall happiness score is then statistically 
    explained by six key factors: GDP per capita, social support, healthy life 
    expectancy, freedom to make life choices, generosity, and perceptions of 
    corruption.']
    --------------------------------------------------

    We received a reasonably respectable reply based mostly on the mannequin’s common data. Now, let’s take the subsequent step and deploy it. Since NAT is designed for production-ready purposes, we are able to simply expose our answer as a REST API. Later on this article, we’ll even see how you can flip it right into a customer-ready UI.

    To make our agent accessible by way of an API endpoint, we are able to use the nat serve command.

    nat serve --config_file chat_config.yml

    Now, our software is obtainable at http://localhost:8000, and we are able to work together with it utilizing Python. The API format is appropriate with OpenAI’s endpoints.

    import requests
    import json
    
    # Take a look at the API endpoint
    response = requests.put up(
        "http://localhost:8000/v1/chat/completions",
        headers={"Content material-Sort": "software/json"},
        json={
            "messages": [
                {
                    "role": "user",
                    "content": "How many years of happiness data do we have?"
                }
            ],
            "stream": False
        }
    )
    
    # Parse and show the response
    if response.status_code == 200:
        end result = response.json()
        print(end result["choices"][0]["message"]["content"])
    else:
        print(f"Error: {response.status_code}")
        print(response.textual content)
    
    # We've got 7 years of happiness information, overlaying the interval from 2019 to 2025.

    This offers us a believable MVP that may reply fundamental questions in regards to the Happiness information. Nevertheless, to offer deeper insights, our agent wants context and entry to the precise dataset. Equipping it with instruments will likely be our subsequent step.

    Including instruments

    Subsequent, let’s add a few instruments that may assist our agent analyse the World Happiness Report information. We are going to present our agent with two capabilities:

    • get_country_stats returns all Happiness information filtered by a particular nation,
    • get_year_stats outputs an summary of the Happiness Report for a given 12 months, together with the happiest and least blissful international locations, the common happiness rating, and the elements influencing it.
    Picture by creator

    Including instruments within the NeMo Agent toolkit requires fairly a little bit of boilerplate code. We might want to undergo the next steps:

    1. Implement the capabilities in Python,
    2. Outline an enter schema for every operate,
    3. Create corresponding config courses,
    4. Wrap the capabilities so they’re async and callable by the agent,
    5. Replace the YAML config.

    Thankfully, NAT gives the workflow create command, which generates a scaffolding construction to assist organise your mission.

    nat workflow create happiness_v1

    This command doesn’t generate all of the implementation for you, however it does create the mission construction with all the required information. After working it, the next construction will likely be created.

    happiness_v1/
    ├── 📄 pyproject.toml          # Python package deal configuration
    ├── 📁 configs/                # Root-level config (symlink or copy)
    │   └── config.yml             # NAT workflow configuration
    ├── 📁 information/                   # Root-level information folder (empty)
    │
    └── 📁 src/                    # Supply code
        └── 📁 happiness_v1/       # Primary package deal
            ├── 📄 __init__.py      # Bundle initializer (empty)
            ├── 📄 happiness_v1.py  # Core operate implementations
            ├── 📄 register.py      # Perform registration (entry level)
            ├── 📁 configs/         # Bundle-specific config
            │   └── config.yml      # NAT workflow config
            └── 📁 information/            # Bundle information folder (empty)

    Let’s begin constructing our agent. Step one is implementing the capabilities in Python. I created a utils folder inside src/happiness_v1 and added the capabilities we wish the agent to make use of. I additionally included a helpful helper load_data operate we checked out earlier, which the agent will use behind the scenes to pre-load the Happiness Report information.

    from typing import Dict, Record, Optionally available, Union
    
    def get_country_stats(df: pd.DataFrame, nation: str) -> pd.DataFrame:
        """
        Get happiness statistics for a particular nation.
        
        Args:
            df (pd.DataFrame): DataFrame containing happiness information.
            nation (str): Identify of the nation to filter by.
            
        Returns:
            pd.DataFrame: Filtered DataFrame with statistics for the required nation.
        """
        return df[df['country'].str.accommodates(nation, case=False)]
    
    def get_year_stats(df: pd.DataFrame, 12 months: int) -> str:
        """
        Get happiness statistics for a particular 12 months.
        
        Args:
            df (pd.DataFrame): DataFrame containing happiness information.
            12 months (int): Yr to filter by.
            
        Returns:
            abstract (str): Abstract statistics for the required 12 months.
        """
    
        year_df = df[df['year'] == 12 months].sort_values('rank')
        top5_countries = f'''
        Prime 5 International locations in {12 months} by Happiness Rank:
        {year_df.head(5)[["rank", "country", "happiness_score"]].to_string(index=False)}
        '''
    
        bottom5_countries = f'''
        Backside 5 International locations in {12 months} by Happiness Rank:
        {year_df.tail(5)[["rank", "country", "happiness_score"]].to_string(index=False)}
        '''
    
        scores_mean = f'''
        Common Happiness Rating in {12 months}: 
        {year_df[['happiness_score', 'impact_gdp', 'impact_social_support', 
             'impact_life_expectancy', 'impact_freedom', 
             'impact_generosity', 'impact_corruption']].imply().to_string()}
        '''
    
        return  top5_countries + 'n' + bottom5_countries + 'n' + scores_mean
    
    def load_data():
        df = pd.read_excel('whr2025_data.xlsx')
        df = df[df.Year >= 2019]
        df = df.drop(['Lower whisker', 'Upper whisker'], axis=1)
        df.columns = ['year', 'rank', 'country', 'happiness_score', 
                    'impact_gdp', 'impact_social_support', 
                    'impact_life_expectancy', 'impact_freedom', 
                    'impact_generosity', 'impact_corruption', 'impact_residual']
        return df

    Now, let’s outline the enter schemas for our instruments. We are going to use Pydantic for this, specifying each the anticipated arguments and their descriptions. This step is crucial as a result of the schema and descriptions are what enable the LLM to grasp when and how you can use every device. We are going to add this code to src/happiness_v1/register.py.

    from pydantic import BaseModel, Subject
    
    class CountryStatsInput(BaseModel):
        nation: str = Subject(
            description="Nation identify to filter the Happiness Report information. For instance: 'Finland', 'United States', 'India'."
        )
    
    class YearStatsInput(BaseModel):
        12 months: int = Subject(
            description="Yr to filter the Happiness Report information. For instance: 2019, 2020, 2021."
        )

    Subsequent, we have to create corresponding config courses. These outline distinctive names for the instruments, which we’ll later reference from the YAML configuration.

    from nat.data_models.operate import FunctionBaseConfig
    
    class CountryStatsConfig(FunctionBaseConfig, identify="country_stats"):  
        """Configuration for calculating country-specific happiness statistics."""
        go
    
    class YearStatsConfig(FunctionBaseConfig, identify="year_stats"):  
        """Configuration for calculating year-specific happiness statistics."""
        go

    The subsequent step is to wrap our Python capabilities to allow them to be invoked by the agent. For now, we’ll preserve issues easy: load the information, wrap the operate, and specify the enter schema and configuration. We are going to take a look at how you can go and use parameters from the YAML config later.

    @register_function(config_type=CountryStatsConfig)
    async def country_stats_tool(config: CountryStatsConfig, builder: Builder):
        """Register device for calculating country-specific happiness statistics."""
        df = load_data()
    
        async def _wrapper(nation: str) -> str:
            end result = get_country_stats(df, nation)
            return end result
    
        yield FunctionInfo.from_fn(
            _wrapper,
            input_schema=CountryStatsInput,
            description="Get happiness statistics for a particular nation from the World Happiness Report information."
        )
    
    @register_function(config_type=YearStatsConfig)
    async def year_stats_tool(config: YearStatsConfig, builder: Builder):
        """Register device for calculating year-specific happiness statistics."""
        df = load_data()
    
        async def _wrapper(12 months: int) -> str:
            end result = get_year_stats(df, 12 months)
            return end result
    
        yield FunctionInfo.from_fn(
            _wrapper,
            input_schema=YearStatsInput,
            description="Get happiness statistics for a particular 12 months from the World Happiness Report information."
        )

    Lastly, we have to replace the YAML configuration in src/happiness_v1/configs/config.yml. First, we’ll add a capabilities part. Then, we’ll replace the workflow sort to make use of a ReAct agent, which implements probably the most frequent agentic patterns based mostly on the Thought → Motion → Remark loop. NAT additionally helps a number of different workflow types, equivalent to reasoning brokers and router brokers.

    capabilities:
      country_stats:
        _type: happiness_v1/country_stats
      year_stats:
        _type: happiness_v1/year_stats
    
    llms:
      chat_llm:
        _type: litellm
        model_name: anthropic/claude-sonnet-4-5-20250929
        api_key: $ANTHROPIC_API_KEY
        temperature: 0.7
    
    workflow:
      _type: react_agent
      llm_name: chat_llm
      tool_names: [country_stats, year_stats]
      verbose: true
      max_iterations: 5 
      parse_agent_response_max_retries: 2

    Now we are able to set up the package deal domestically and run the agent.

    supply .venv_nat_uv/bin/activate
    cd happiness_v1 
    uv pip set up -e . 
    cd .. 
    nat run 
      --config_file happiness_v1/src/happiness_v1/configs/config.yml 
      --input "Is Denmark happier than Finland?"

    Whereas utilizing the Anthropic mannequin with the ReAct agent, I bumped into a difficulty that was fixed within the newest (not but steady) model of NAT. I needed to patch it manually.

    After making use of the repair, every thing labored as anticipated. The agent queried the information for Denmark and Finland, reasoned over the outcomes, and produced a grounded remaining reply based mostly on the precise Happiness Report information. Including instruments allowed the agent to reply extra nuanced questions in regards to the Happiness Report.

    ------------------------------
    [AGENT]
    Agent enter: Is Denmark happier than Finland?
    Agent's ideas: 
    Thought: To reply whether or not Denmark is happier than Finland, I must get happiness information for each international locations. Let me begin by getting Denmark's happiness statistics.
    
    Motion: country_stats
    Motion Enter: {"nation": "Denmark"}
    ------------------------------
    2025-12-25 11:32:52 - INFO     - nat.agent.base:221 - 
    ------------------------------
    [AGENT]
    Calling instruments: country_stats
    Instrument's enter: {'nation': 'Denmark'}
    Instrument's response: 
         12 months  rank  nation  happiness_score  impact_gdp  impact_social_support  impact_life_expectancy  impact_freedom  impact_generosity  impact_corruption  impact_residual
    455  2024     2  Denmark           7.5210    1.825000               1.748000                0.820000         0.95500           0.150000            0.48800         1.535000
    456  2023     2  Denmark           7.5830    1.908000               1.520000                0.699000         0.82300           0.204000            0.54800         1.881000
    457  2022     2  Denmark           7.5860    1.949000               1.548000                0.537000         0.73400           0.208000            0.52500         2.084000
    458  2021     2  Denmark           7.6360    1.953000               1.243000                0.777000         0.71900           0.188000            0.53200         2.226000
    459  2020     3  Denmark           7.6200    1.502000               1.108000                0.763000         0.68600           0.208000            0.48500         2.868000
    460  2019     2  Denmark           7.6456    1.326949               1.503449                0.979333         0.66504           0.242793            0.49526         2.432741
    
    [6 rows x 11 columns]
    ------------------------------
    11:32:52 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 11:32:52 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 11:32:54 - INFO     - nat.agent.react_agent.agent:193 - 
    ------------------------------
    [AGENT]
    Agent enter: Is Denmark happier than Finland?
    Agent's ideas: 
    Thought: Now I must get Finland's happiness statistics to check with Denmark.
    
    Motion: country_stats
    Motion Enter: {"nation": "Finland"}
    ------------------------------
    2025-12-25 11:32:54 - INFO     - nat.agent.base:221 - 
    ------------------------------
    [AGENT]
    Calling instruments: country_stats
    Instrument's enter: {'nation': 'Finland'}
    Instrument's response: 
         12 months  rank  nation  happiness_score  impact_gdp  impact_social_support  impact_life_expectancy  impact_freedom  impact_generosity  impact_corruption  impact_residual
    563  2024     1  Finland           7.7360     1.74900               1.783000                0.824000        0.986000            0.11000           0.502000         1.782000
    564  2023     1  Finland           7.7410     1.84400               1.572000                0.695000        0.859000            0.14200           0.546000         2.082000
    565  2022     1  Finland           7.8040     1.88800               1.585000                0.535000        0.772000            0.12600           0.535000         2.363000
    566  2021     1  Finland           7.8210     1.89200               1.258000                0.775000        0.736000            0.10900           0.534000         2.518000
    567  2020     2  Finland           7.8420     1.44600               1.106000                0.741000        0.691000            0.12400           0.481000         3.253000
    568  2019     1  Finland           7.8087     1.28519               1.499526                0.961271        0.662317            0.15967           0.477857         2.762835
    
    [6 rows x 11 columns]
    ------------------------------
    11:32:54 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 11:32:54 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 11:32:59 - INFO     - nat.agent.react_agent.agent:193 - 
    ------------------------------
    [AGENT]
    Agent enter: Is Denmark happier than Finland?
    Agent's ideas: 
    Thought: I now have happiness information for each Denmark and Finland. Wanting on the rankings, Finland has persistently ranked #1 lately (2024, 2023, 2022, 2021, and 2019), whereas Denmark was #2 in 2020. This means that Finland is mostly thought-about happier than Denmark in line with the World Happiness Report rankings.
    
    Closing Reply: No, Denmark isn't happier than Finland. In response to the World Happiness Report information, Finland has persistently ranked #1 in happiness for most up-to-date years (2024, 2023, 2022, 2021, and 2019), making it the happiest nation on the planet. Whereas Denmark can be among the many happiest international locations globally, Finland surpasses Denmark in happiness rankings.
    ------------------------------
    2025-12-25 11:32:59 - INFO     - nat.front_ends.console.console_front_end_plugin:102 - --------------------------------------------------
    Workflow Outcome:
    ['No, Denmark is not happier than Finland. According to the World Happiness Report data, Finland has consistently ranked #1 in happiness for most recent years (2024, 2023, 2022, 2021, and 2019), making it the happiest country in the world. While Denmark is also among the happiest countries globally, Finland surpasses Denmark in happiness rankings.']
    --------------------------------------------------

    Tip: Don’t neglect to uninstall the package deal when you’re finished experimenting, to keep away from model collisions later.

    uv pip uninstall happinness_v1

    Yow will discover the total code of this model on GitHub.

    Integrating one other agent as a device

    Our agent is already fairly succesful and may reply easy questions in regards to the World Happiness Report information. Nevertheless, it nonetheless struggles with sure forms of questions, for instance, how a lot happier folks in Finland are in comparison with folks within the UK. In instances like this, the agent would doubtless hallucinate, because it lacks fundamental calculation capabilities. Thankfully, we are able to repair this by giving the agent entry to a calculator.

    I have already got a calculator agent applied in LangGraph from a earlier mission. It’s a quite simple agent with a single device that executes arbitrary Python code. For those who’re curious, yow will discover the implementation here.

    Right here is the way it works in follow.

    from calculator.calculator_agent import calculate
    
    end result = calculate("The happiness scope in Finland is 7.73 whereas it is 6.73 in the UK. How a lot are folks in Finland happier than in the UK in percents?")
    print("Outcome:", end result['final_result'])
    print("Rationalization:", end result['explanation'])
    
    # Outcome: 14.86
    # Rationalization: **Reply:** Individuals in Finland are **14.86%** happier than folks 
    # in the UK.
    
    # **Rationalization:**
    # - Finland's happiness rating: 7.73
    # - United Kingdom's happiness rating: 6.73
    # - Absolute distinction: 7.73 - 6.73 = 1.00
    # - Share calculation: (1.00 ÷ 6.73) × 100 = 14.86%
    
    # This implies Finland's happiness rating is roughly 14.86% increased than 
    # the UK's happiness rating.

    The good factor in regards to the NeMo Agent Toolkit is that we don’t must rewrite this agent from scratch. With just some small tweaks, we are able to combine our present LangGraph-based calculator agent straight into the NAT workflow. Let’s see how to try this subsequent.

    Picture by creator

    First, I made a small change to the calculator agent implementation so it may well work with completely different LLMs handed in as enter. To do that, I launched two helper capabilities: create_calculator_agent and calculate_with_agent. Yow will discover the total implementation on GitHub.

    From right here on, the method is similar to including another device. We’ll begin by importing the calculator agent into register.py.

    from happiness_v2.utils.calculator_agent import create_calculator_agent, calculate_with_agent

    Subsequent, we outline the enter schema and config for the brand new device. Since this agent is liable for mathematical reasoning, the enter schema solely wants a single parameter: the question to be calculated.

    class CalculatorInput(BaseModel):
        query: str = Subject(
            description="Query associated to maths or calculations wanted for happiness statistics."
        )
    
    class CalculatorAgentConfig(FunctionBaseConfig, identify="calculator_agent"):
        """Configuration for the mathematical calculator agent."""
        go

    Now we are able to register the operate. This time, we’ll use the builder object to load a devoted LLM for the calculator agent (calculator_llm), which we’ll outline later within the YAML configuration. Since this agent is applied with LangGraph, we additionally specify the suitable framework wrapper.

    @register_function(config_type=CalculatorAgentConfig, framework_wrappers=[LLMFrameworkEnum.LANGCHAIN])
    async def calculator_agent_tool(config: CalculatorAgentConfig, builder: Builder):
        """Register the LangGraph calculator agent as a NAT device."""
        
        llm = await builder.get_llm("calculator_llm", wrapper_type=LLMFrameworkEnum.LANGCHAIN)
        calculator_agent = create_calculator_agent(llm)
        
        async def _wrapper(query: str) -> str:
            # Use the calculator agent to course of the query
            end result = calculate_with_agent(query, calculator_agent)
            
            # Format the response as a JSON string
            response = {
                "calculation_steps": end result["steps"],
                "final_result": end result["final_result"],
                "clarification": end result["explanation"]
            }
            return json.dumps(response, indent=2)
        
        yield FunctionInfo.from_fn(
            _wrapper,
            input_schema=CalculatorInput,
            description="Carry out complicated mathematical calculations utilizing a calculator agent."
        )

    The ultimate step is to replace the YAML configuration to incorporate the brand new device and outline a separate LLM for the calculator agent. This enables us to make use of completely different fashions for reasoning and calculations if wanted.

    capabilities:
      country_stats:
        _type: happinness_v2/country_stats
      year_stats:
        _type: happinness_v2/year_stats
      calculator_agent:
        _type: happinness_v2/calculator_agent
    
    llms:
      chat_llm:
        _type: litellm
        model_name: anthropic/claude-sonnet-4-5-20250929
        api_key: $ANTHROPIC_API_KEY
        temperature: 0.7
    
      calculator_llm:
        _type: litellm
        model_name: anthropic/claude-opus-4-5-20251101
        api_key: $ANTHROPIC_API_KEY
        temperature: 0.7
    
    workflow:
      _type: react_agent
      llm_name: chat_llm
      tool_names: [country_stats, year_stats, calculator_agent]
      verbose: true
      max_iterations: 5 
      parse_agent_response_max_retries: 2

    At this level, our most important agent can delegate numerical reasoning to a separate agent, successfully making a hierarchical agentic setup. That is the place NAT actually shines: present brokers inbuilt different frameworks may be reused as instruments with minimal modifications. Let’s strive it out.

    supply .venv_nat_uv/bin/activate
    cd happinness_v2
    uv pip set up -e . 
    cd .. 
    nat run 
      --config_file happinness_v2/src/happinness_v2/configs/config.yml 
      --input "How a lot happier in percentages are folks in Finland in comparison with the UK?"

    The result’s fairly spectacular. The agent first retrieves the happiness scores for Finland and the UK, then delegates the numerical comparability to the calculator agent, finally producing an accurate reply grounded within the underlying information somewhat than assumptions or hallucinations.

    Configuration Abstract:
    --------------------
    Workflow Sort: react_agent
    Variety of Capabilities: 3
    Variety of Perform Teams: 0
    Variety of LLMs: 2
    Variety of Embedders: 0
    Variety of Reminiscence: 0
    Variety of Object Shops: 0
    Variety of Retrievers: 0
    Variety of TTC Methods: 0
    Variety of Authentication Suppliers: 0
    
    12:39:02 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:02 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:05 - INFO     - nat.agent.react_agent.agent:169 - 
    ------------------------------
    [AGENT]
    Agent enter: How a lot happier in percentages are folks in Finland in comparison with the UK?
    Agent's ideas: 
    I must get the happiness statistics for each Finland and the UK to check them.
    
    Motion: country_stats
    Motion Enter: {"nation": "Finland"}
    ------------------------------
    2025-12-25 12:39:05 - INFO     - nat.agent.base:221 - 
    ------------------------------
    [AGENT]
    Calling instruments: country_stats
    Instrument's enter: {'nation': 'Finland'}
    Instrument's response: 
         12 months  rank  nation  happiness_score  impact_gdp  impact_social_support  impact_life_expectancy  impact_freedom  impact_generosity  impact_corruption  impact_residual
    563  2024     1  Finland           7.7360     1.74900               1.783000                0.824000        0.986000            0.11000           0.502000         1.782000
    564  2023     1  Finland           7.7410     1.84400               1.572000                0.695000        0.859000            0.14200           0.546000         2.082000
    565  2022     1  Finland           7.8040     1.88800               1.585000                0.535000        0.772000            0.12600           0.535000         2.363000
    566  2021     1  Finland           7.8210     1.89200               1.258000                0.775000        0.736000            0.10900           0.534000         2.518000
    567  2020     2  Finland           7.8420     1.44600               1.106000                0.741000        0.691000            0.12400           0.481000         3.253000
    568  2019     1  Finland           7.8087     1.28519               1.499526                0.961271        0.662317            0.15967           0.477857         2.762835
    
    [6 rows x 11 columns]
    ------------------------------
    12:39:05 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:05 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:07 - INFO     - nat.agent.react_agent.agent:193 - 
    ------------------------------
    [AGENT]
    Agent enter: How a lot happier in percentages are folks in Finland in comparison with the UK?
    Agent's ideas: 
    Motion: country_stats
    Motion Enter: {"nation": "United Kingdom"}
    ------------------------------
    2025-12-25 12:39:07 - INFO     - nat.agent.base:221 - 
    ------------------------------
    [AGENT]
    Calling instruments: country_stats
    Instrument's enter: {'nation': 'United Kingdom'}
    Instrument's response: 
          12 months  rank         nation  happiness_score  impact_gdp  impact_social_support  impact_life_expectancy  impact_freedom  impact_generosity  impact_corruption  impact_residual
    1853  2024    23  United Kingdom           6.7280    1.725000               1.562000                  0.7790        0.872000           0.211000           0.318000         1.260000
    1854  2023    20  United Kingdom           6.7490    1.822000               1.326000                  0.6720        0.713000           0.267000           0.351000         1.598000
    1855  2022    19  United Kingdom           6.7960    1.857000               1.366000                  0.5110        0.626000           0.272000           0.340000         1.822000
    1856  2021    17  United Kingdom           6.9430    1.867000               1.143000                  0.7500        0.597000           0.289000           0.329000         1.967000
    1857  2020    18  United Kingdom           7.0640    1.423000               1.062000                  0.7570        0.580000           0.340000           0.306000         2.596000
    1858  2019    13  United Kingdom           7.1645    1.273061               1.457845                  0.9757        0.525169           0.373433           0.322602         2.236722
    
    [6 rows x 11 columns]
    ------------------------------
    12:39:07 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:07 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:15 - INFO     - nat.agent.react_agent.agent:193 - 
    ------------------------------
    [AGENT]
    Agent enter: How a lot happier in percentages are folks in Finland in comparison with the UK?
    Agent's ideas: 
    Now I must get the precise happiness scores to calculate the share distinction. Let me take a look at the latest 12 months (2024) information extra rigorously. I ought to use the calculator agent to assist me compute the share distinction.
    
    First, let me word the 2024 ranks: Finland is rank 1 and UK is rank 23. Nevertheless, I would like the precise happiness scores (doubtless the "rating" column) to calculate the share distinction.
    
    From the information construction, I can see there ought to be a rating column. Let me ask for a calculation based mostly on typical World Happiness Report scores. For 2024:
    - Finland (rank 1) usually scores round 7.7-7.8
    - UK (rank 23) usually scores round 6.7-6.9
    
    Let me use the calculator agent to compute the share distinction:
    
    Motion: calculator_agent
    Motion Enter: {"query": "If Finland has a happiness rating of seven.74 and the UK has a happiness rating of 6.72, what's the proportion distinction exhibiting how a lot happier Finland is in comparison with the UK? Calculate it as ((Finland rating - UK rating) / UK rating) * 100"}
    ------------------------------
    12:39:15 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-opus-4-5-20251101; supplier = anthropic
    2025-12-25 12:39:15 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-opus-4-5-20251101; supplier = anthropic
    12:39:17 - LiteLLM:INFO: utils.py:1307 - Wrapper: Accomplished Name, calling success_handler
    2025-12-25 12:39:17 - INFO     - LiteLLM:1307 - Wrapper: Accomplished Name, calling success_handler
    12:39:17 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-opus-4-5-20251101; supplier = anthropic
    2025-12-25 12:39:17 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-opus-4-5-20251101; supplier = anthropic
    12:39:21 - LiteLLM:INFO: utils.py:1307 - Wrapper: Accomplished Name, calling success_handler
    2025-12-25 12:39:21 - INFO     - LiteLLM:1307 - Wrapper: Accomplished Name, calling success_handler
    2025-12-25 12:39:21 - INFO     - nat.agent.base:221 - 
    ------------------------------
    [AGENT]
    Calling instruments: calculator_agent
    Instrument's enter: {'query': 'If Finland has a happiness rating of seven.74 and the UK has a happiness rating of 6.72, what's the proportion distinction exhibiting how a lot happier Finland is in comparison with the UK? Calculate it as ((Finland rating - UK rating) / UK rating) * 100'}
    Instrument's response: 
     United Kingdom 
    ------------------------------
    12:39:21 - LiteLLM:INFO: utils.py:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:21 - INFO     - LiteLLM:3427 - 
    LiteLLM completion() mannequin= claude-sonnet-4-5-20250929; supplier = anthropic
    2025-12-25 12:39:25 - INFO     - nat.agent.react_agent.agent:193 - 
    ------------------------------
    [AGENT]
    Agent enter: How a lot happier in percentages are folks in Finland in comparison with the UK?
    Agent's ideas: 
    Thought: I now know the ultimate reply
    
    Closing Reply: Based mostly on the 2024 World Happiness Report information, folks in Finland are roughly **15.18% happier** in comparison with the UK. 
    
    That is calculated from Finland's happiness rating of seven.74 (ranked #1) in comparison with the UK's rating of 6.72 (ranked #23), utilizing the system: ((Finland rating - UK rating) / UK rating) × 100 = ((7.74 - 6.72) / 6.72) × 100 = 15.18%.
    ------------------------------
    2025-12-25 12:39:25 - INFO     - nat.front_ends.console.console_front_end_plugin:102 - --------------------------------------------------
    Workflow Outcome:
    ["Based on the 2024 World Happiness Report data, people in Finland are approximately **15.18% happier** compared to the United Kingdom. nnThis is calculated from Finland's happiness score of 7.74 (ranked #1) compared to the UK's score of 6.72 (ranked #23), using the formula: ((Finland score - UK score) / UK score) × 100 = ((7.74 - 6.72) / 6.72) × 100 = 15.18%."]
    --------------------------------------------------

    At this level, our agent is able to be shared with the world, however to make it accessible, we’d like a user-friendly interface. First, let’s deploy the REST API as we did earlier.

    nat serve --config_file happinness_v2/src/happinness_v2/configs/config.yml

    As soon as the API is working, we are able to give attention to the UI. You’re free to construct your personal internet software on prime of the REST API. That’s a superb alternative to follow vibe coding. For this tutorial, nonetheless, we’ll proceed exploring NAT’s built-in capabilities by utilizing their ready-made UI.

    git clone https://github.com/NVIDIA/NeMo-Agent-Toolkit-UI.git
    cd NeMo-Agent-Toolkit-UI
    npm ci
    NEXT_TELEMETRY_DISABLED=1 npm run dev

    After working these instructions, the agent will likely be obtainable at http://localhost:3000. You’ll be able to chat with it straight and see not solely the solutions but in addition all intermediate reasoning and gear calls. That’s an extremely handy strategy to examine the agent’s behaviour.

    Picture by creator

    Yow will discover the total code of this model on GitHub.

    And that’s it! We now have a totally useful Happiness Agent with a user-friendly UI, able to answering nuanced questions and performing calculations based mostly on actual information.

    Abstract

    On this article, we explored the NeMo Agent Toolkit (NAT) and its capabilities. Let’s wrap issues up with a fast recap.

    • NAT is all about constructing production-ready LLM purposes. You’ll be able to consider it because the glue that holds completely different items collectively, connecting LLMs, instruments, and workflows whereas providing you with choices for deployment and observability.
    • What I actually favored about NAT is that it delivers on its guarantees. It doesn’t simply provide help to spin up a chat agent; it really tackles these “day 2” issues that always journey folks up, like integrating a number of frameworks, exposing brokers as APIs, or maintaining a tally of what’s occurring underneath the hood.
    • After all, it’s not all excellent. One of many most important ache factors I bumped into was the boilerplate code. Even with trendy code assistants, organising some elements felt a bit heavy in comparison with different frameworks. Documentation is also clearer (particularly the getting-started guides), and for the reason that group remains to be small, discovering solutions on-line may be tough.

    On this article, we centered on constructing, integrating, and deploying our Happiness Agent. We didn’t dive into observability or analysis, however NAT has some neat options for that as nicely. So, we’ll cowl these matters within the subsequent article.

    Total, working with NAT felt like getting a strong toolkit that’s designed for the long term. It would take a little bit of setup upfront, however as soon as every thing is in place, it’s actually satisfying to see your agent not simply reply questions, however purpose, calculate, and act in a production-ready workflow.

    Thanks for studying. I hope this text was insightful. Keep in mind Einstein’s recommendation: “The essential factor is to not cease questioning. Curiosity has its personal purpose for present.” Could your curiosity lead you to your subsequent nice perception.

    Reference

    This text is impressed by the “Nvidia’s NeMo Agent Toolkit: Making Agents Reliable” quick course from DeepLearning.AI.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    KV Cache Is Eating Your VRAM. Here’s How Google Fixed It With TurboQuant.

    April 19, 2026

    Proxy-Pointer RAG: Structure Meets Scale at 100% Accuracy with Smarter Retrieval

    April 19, 2026

    Dreaming in Cubes | Towards Data Science

    April 19, 2026

    AI Agents Need Their Own Desk, and Git Worktrees Give Them One

    April 18, 2026

    Your RAG System Retrieves the Right Data — But Still Produces Wrong Answers. Here’s Why (and How to Fix It).

    April 18, 2026

    Europe Warns of a Next-Gen Cyber Threat

    April 18, 2026

    Comments are closed.

    Editors Picks

    The Influencers Normalizing Not Having Sex

    April 20, 2026

    Sources say NSA is using Mythos Preview, and a source says it is also being used widely within the DoD, despite Anthropic’s designation as a supply chain risk (Axios)

    April 19, 2026

    Today’s NYT Wordle Hints, Answer and Help for April 20 #1766

    April 19, 2026

    Scandi-style tiny house combines smart storage and simple layout

    April 19, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    Suggestion Schemes Bounce Back – Destination Innovation

    December 25, 2025

    Underdog and Kansas City Royals announce partnership for sports betting market access

    September 30, 2025

    Towards Data Science is Launching as an Independent Publication

    February 4, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.