Skip to content

Conversation

@xingdi-eric-yuan
Copy link
Collaborator

@xingdi-eric-yuan xingdi-eric-yuan commented Aug 1, 2025

This pull request introduces a new RAGAgent (Retrieval-Augmented Generation Agent) to the debug_gym framework, enabling retrieval-based decision-making by integrating with a standalone retrieval service. The changes include the implementation of the agent, configuration updates, and mock-based tests for validation. Below is a summary of the most important changes:

New Feature: RAGAgent Implementation

  • Added RAGAgent class in debug_gym/agents/rag_agent.py, which integrates with a retrieval service to retrieve relevant examples for decision-making. It includes configuration options for indexing methods, retrieval parameters, and caching. The agent conditionally imports the retrieval service client and raises an error if unavailable.
  • Updated debug_gym/agents/__init__.py to conditionally import RAGAgent only if the retrieval service is installed, ensuring compatibility with setups without the retrieval service.

Configuration Updates

  • Added a configuration section for rag_agent in scripts/config_swesmith.yaml, specifying tools, retrieval parameters, and the experience trajectory path for building indexes.

Code Refinements

  • Enhanced the run_agent function in scripts/run.py to refine handling of previous run statuses, ensuring better control over task execution. [1] [2]

Testing Enhancements

  • Introduced tests/agents/test_rag_agent_mock_only.py to provide mock-based tests for RAGAgent, covering import error handling, indexing method parsing, query text extraction, configuration defaults, retrieval service client interface, and prompt-building logic. These tests ensure the agent's logic can be validated without requiring the retrieval service.

@xingdi-eric-yuan xingdi-eric-yuan changed the title External retrieval server [WIP] External retrieval server Aug 1, 2025
@xingdi-eric-yuan xingdi-eric-yuan changed the title [WIP] External retrieval server RAG Agent that calls external retrieval server Aug 1, 2025
@xingdi-eric-yuan xingdi-eric-yuan marked this pull request as ready for review August 1, 2025 17:10
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.

1 participant