NAT#
This example demonstrates how to use NVIDIA’s Context-Aware RAG (CA-RAG) system with NAT (NeMo Agent Toolkit) for document processing and question answering. The example shows how to:
Ingest documents using NAT
Perform question answering using NAT
Prerequisites#
NVIDIA API Keys:
Get your API key from: build.nvidia.com
Export the following environment variable:
export NVIDIA_API_KEY=your_api_key
Install NAT and Context-Aware RAG:
Follow the installation instructions in the NAT Plugin Guide
Make sure you have both NAT and Context-Aware RAG installed in your environment
Set up pre-requisites containers:
Setup#
Start the NAT services:
Start Ingestion Service:
nat serve --config_file=./packages/vss_ctx_rag_nat/src/vss_ctx_rag/plugins/nat/nat_config/workflow/config-ingestion-workflow.yml --port 8000
Start Retrieval Service:
nat serve --config_file=./packages/vss_ctx_rag_nat/src/vss_ctx_rag/plugins/nat/nat_config/workflow/config-retrieval-workflow.yml --port 8001
Usage#
Document Ingestion:
Documents are processed and uploaded to the NAT ingestion service
The system maintains document order
Question Answering:
Send questions to the NAT retrieval service
Receive answers based on the ingested document content
Example Notebook#
The qna_nat.ipynb notebook provides a step-by-step walkthrough of the entire process, including:
Service initialization
Document processing and ingestion
Question answering examples
Notes#
Make sure to stop the NAT services when you’re done by pressing
Ctrl+C
in the terminal windows