Skip to content

Conversation

@wizardlancet
Copy link
Contributor

Add RAG example

Copilot AI review requested due to automatic review settings July 28, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive RAG (Retrieval-Augmented Generation) agent example to the AgentLightning framework. The example demonstrates how to build and train an agent that answers questions using Wikipedia retrieval capabilities through an MCP (Model Context Protocol) server.

  • Implements a RAG agent using Wikipedia retrieval with FAISS indexing and sentence transformers
  • Sets up MCP server infrastructure for retrieval operations
  • Provides training configuration and evaluation utilities for the RAG system

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/rag_agent/wiki_retriever_mcp/wiki_retriever_mcp.py MCP server implementation for Wikipedia retrieval using FAISS and sentence transformers
examples/rag_agent/wiki_retriever_mcp/wiki_retriever_install.sh Environment setup script for the MCP server dependencies
examples/rag_agent/utils.py Evaluation utilities for computing F1 scores, exact match, and other metrics
examples/rag_agent/train.sh Training configuration script with hyperparameters and model settings
examples/rag_agent/rag_agent.py Main RAG agent implementation with training and validation logic
examples/rag_agent/README.md Setup instructions and documentation for the RAG example
Comments suppressed due to low confidence (1)

examples/rag_agent/rag_agent.py:66

  • The variable resources shadows the parameter of the same name. Consider using a different name like validation_resources to avoid confusion.
        resources = {

@Kwen-Chen
Copy link

Is there anything wrong with this PR? Can it be implemented correctly and used as a reference?

@ultmaster ultmaster merged commit ea692fc into main Aug 11, 2025
8 of 9 checks passed
@ultmaster ultmaster deleted the feat-rag_example branch October 28, 2025 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants