Complexity: 🟢 Beginner
This example demonstrates a NVIDIA NeMo Agent Toolkit workflow connecting to a third-party A2A server, the LangGraph-based currency agent. The workflow acts as an A2A client to perform currency conversions and financial queries with time-based context.
- Per-User A2A Client: Each user gets isolated A2A client connections to external services
- External A2A Integration: Connects to a third-party LangGraph currency agent
- Hybrid Tool Architecture: Combines A2A currency tools with MCP time services
- Simple Real-world Use Case: Currency conversion with historical date context
- Multi-User Support: Demonstrates user isolation with different session cookies
flowchart LR
subgraph "Currency Agent Workflow"
CW[Currency Agent Workflow]
CW --> CAC[Currency A2A Client]
CW --> TMC[Time MCP Client]
end
CAC --> AP[A2A Protocol<br/>localhost:11000]
AP --> LG[LangGraph Currency Agent<br/>External Service]
subgraph "External Currency Agent"
LG --> CT[Currency Tools]
end
style CW fill:#e1f5fe,color:#000
style LG fill:#f3e5f5,color:#000
style AP fill:#fff3e0,color:#000
Follow the instructions in the Install Guide to create the development environment and install NeMo Agent Toolkit.
Set your NVIDIA and OpenAI API keys as environment variables:
export NVIDIA_API_KEY=<YOUR_API_KEY>
export OPENAI_API_KEY=<YOUR_API_KEY>The currency agent runs as an external service using the a2a-samples repository:
# Step 1: Clone the a2a-samples repository and checkout a tested tag
cd external
git clone https://github.com/a2aproject/a2a-samples.git
cd a2a-samples
git checkout eb3885f # tested on 12/2025 with NAT 1.4.0
# Step 2: Navigate to the LangGraph agent
cd samples/python/agents/langgraph
# Step 3: Set the environment variables for the currency agent
# For OpenAI models:
cat <<EOF > .env
API_KEY=$OPENAI_API_KEY
model_source=openai
TOOL_LLM_URL=https://api.openai.com/v1
TOOL_LLM_NAME=gpt-4o-mini
EOF
# Step 4: Run the currency agent on port 11000
uv run app --port 11000From the root directory of the NeMo Agent Toolkit library, install this example:
uv pip install -e examples/A2A/currency_agent_a2aFirst, verify the external currency agent is running:
# Check the external agent discovery card
nat a2a client discover --url http://localhost:11000In a separate terminal, run the client workflow:
# Terminal 2: Run the currency agent client
nat run --config_file examples/A2A/currency_agent_a2a/configs/config.yml \
--input "What was the USD to EUR exchange rate this day last year?"For comprehensive examples, see data/sample_queries.json.
This example uses a per-user workflow pattern because A2A clients are per-user function groups:
- Each user gets isolated connections to the external A2A service
- Independent session state and request tracking per user
The workflow is configured to use the core per-user ReAct agent:
workflow:
_type: per_user_react_agent # Per-user ReAct agent
tool_names:
- mcp_date_time.get_current_time_mcp_tool
- currency_agent # Per-user A2A client to external service
llm_name: nim_llmThe configuration demonstrates two types of tool integration:
-
A2A Client Tools (
currency_agent) - Per-User:- Connects to external LangGraph currency agent
- Each user gets isolated connection to the external service
- Provides currency conversion and exchange rate queries
-
MCP Client Tools (
mcp_date_time) - Shared:- Local MCP server for time operations
- Provides:
get_current_time_mcp_toolfunction
External Server Not Running:
# Check if the LangGraph agent is running
curl http://localhost:11000/.well-known/agent-card.json | jqPort Conflicts:
- Ensure port 11000 is available for the currency agent
- Check for other services using the port
- Modify the port in both the external agent startup and config.yml if needed
Timeouts:
- Increase
task_timeoutin config if queries take longer - Check network connectivity to the external service
- Math Assistant A2A - NeMo Agent Toolkit A2A with hybrid tools (unprotected)
- OAuth2 Protected Math Assistant A2A - OAuth2-protected A2A example